@woosh/meep-engine 2.37.11 → 2.37.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -117,8 +117,6 @@ export class Transform {
|
|
|
117
117
|
|
|
118
118
|
updateMatrix() {
|
|
119
119
|
compose_matrix4_array(this.matrix, this.position, this.rotation, this.scale);
|
|
120
|
-
|
|
121
|
-
this.clearFlag(TransformFlags.MatrixNeedsUpdate);
|
|
122
120
|
}
|
|
123
121
|
|
|
124
122
|
/**
|
|
@@ -158,8 +156,6 @@ export class Transform {
|
|
|
158
156
|
} else {
|
|
159
157
|
this.scale.copy(Vector3.one);
|
|
160
158
|
}
|
|
161
|
-
|
|
162
|
-
this.setFlag(TransformFlags.MatrixNeedsUpdate);
|
|
163
159
|
}
|
|
164
160
|
|
|
165
161
|
toJSON() {
|
|
@@ -236,14 +232,6 @@ export class Transform {
|
|
|
236
232
|
* @param {Transform} b
|
|
237
233
|
*/
|
|
238
234
|
multiplyTransforms(a, b) {
|
|
239
|
-
if (a.getFlag(TransformFlags.MatrixNeedsUpdate)) {
|
|
240
|
-
a.updateMatrix();
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
if (b.getFlag(TransformFlags.MatrixNeedsUpdate)) {
|
|
244
|
-
b.updateMatrix();
|
|
245
|
-
}
|
|
246
|
-
|
|
247
235
|
mat4.multiply(m4_0, a.matrix, b.matrix);
|
|
248
236
|
|
|
249
237
|
this.fromMatrix4(m4_0);
|
|
@@ -278,8 +266,6 @@ export class Transform {
|
|
|
278
266
|
|
|
279
267
|
decompose_matrix_4_array(m, this.position, this.rotation, this.scale);
|
|
280
268
|
|
|
281
|
-
this.clearFlag(TransformFlags.MatrixNeedsUpdate);
|
|
282
|
-
|
|
283
269
|
this.writeFlag(TransformFlags.AutomaticChangeDetection, ad);
|
|
284
270
|
}
|
|
285
271
|
|
|
@@ -230,14 +230,6 @@ export class ShadedGeometry {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
updateTransform() {
|
|
233
|
-
const t = this.__c_transform;
|
|
234
|
-
|
|
235
|
-
if (t.getFlag(TransformFlags.MatrixNeedsUpdate)) {
|
|
236
|
-
t.updateMatrix();
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
//this.__transform.set(t.matrix);
|
|
240
|
-
|
|
241
233
|
this.update_bounds();
|
|
242
234
|
|
|
243
235
|
this.__bvh_tree.node_move_aabb(this.__bvh_leaf_id, this.__bvh_aabb);
|
|
@@ -22,7 +22,6 @@ import TaskState from "../../../../core/process/task/TaskState.js";
|
|
|
22
22
|
import {
|
|
23
23
|
bvh_query_user_data_overlaps_frustum
|
|
24
24
|
} from "../../../../core/bvh2/bvh3/bvh_query_user_data_overlaps_frustum.js";
|
|
25
|
-
import { TransformFlags } from "../../../ecs/transform/TransformFlags.js";
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
/**
|
|
@@ -37,6 +36,10 @@ const scratch_point = new SurfacePoint3();
|
|
|
37
36
|
*/
|
|
38
37
|
const scratch_m4 = new Float32Array(16);
|
|
39
38
|
|
|
39
|
+
/**
|
|
40
|
+
* @readonly
|
|
41
|
+
* @type {Float32Array}
|
|
42
|
+
*/
|
|
40
43
|
const scratch_ray_0 = new Float32Array(6);
|
|
41
44
|
|
|
42
45
|
export class ShadedGeometrySystem extends System {
|
|
@@ -251,23 +254,21 @@ export class ShadedGeometrySystem extends System {
|
|
|
251
254
|
t.rotation.onChanged.add(sg.updateTransform, sg);
|
|
252
255
|
t.scale.onChanged.add(sg.updateTransform, sg);
|
|
253
256
|
|
|
254
|
-
if (t.getFlag(TransformFlags.MatrixNeedsUpdate)) {
|
|
255
|
-
t.updateMatrix();
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// sg.__transform.set(t.matrix);
|
|
259
257
|
sg.update_bounds();
|
|
260
258
|
|
|
261
259
|
// remember entity for lookups
|
|
262
260
|
sg.__entity = entity;
|
|
263
261
|
|
|
264
262
|
// insert BVH entry
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
const bvh = this.__bvh_binary;
|
|
264
|
+
|
|
265
|
+
const bvh_node_id = bvh.allocate_node();
|
|
266
|
+
|
|
267
|
+
bvh.node_set_aabb(bvh_node_id, sg.__bvh_aabb);
|
|
268
|
+
bvh.node_set_user_data(bvh_node_id, entity);
|
|
269
|
+
bvh.insert_leaf(bvh_node_id);
|
|
269
270
|
|
|
270
|
-
sg.__bvh_tree =
|
|
271
|
+
sg.__bvh_tree = bvh;
|
|
271
272
|
sg.__bvh_leaf_id = bvh_node_id;
|
|
272
273
|
|
|
273
274
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"productName": "Meep",
|
|
6
6
|
"description": "production-ready JavaScript game engine based on Entity Component System Architecture",
|
|
7
7
|
"author": "Alexander Goldring",
|
|
8
|
-
"version": "2.37.
|
|
8
|
+
"version": "2.37.12",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"gl-matrix": "3.4.3",
|
|
11
11
|
"fast-levenshtein": "2.0.6",
|