@woosh/meep-engine 2.81.2 → 2.81.3
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.
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Group, Matrix4, Mesh } from "three";
|
|
2
|
+
import { mergeBufferGeometries } from "three/examples/jsm/utils/BufferGeometryUtils.js";
|
|
3
|
+
import { array_copy } from "../../../../../core/collection/array/array_copy.js";
|
|
2
4
|
import { HashMap } from "../../../../../core/collection/map/HashMap.js";
|
|
5
|
+
import { m4_multiply } from "../../../../../core/geom/3d/mat4/m4_multiply.js";
|
|
6
|
+
import { MATRIX_4_IDENTITY } from "../../../../../core/geom/3d/mat4/MATRIX_4_IDENTITY.js";
|
|
7
|
+
import { StaticMaterialCache } from "../../../../asset/loaders/material/StaticMaterialCache.js";
|
|
3
8
|
import { computeGeometryEquality } from "../../buffered/computeGeometryEquality.js";
|
|
4
9
|
import { computeGeometryHash } from "../../buffered/computeGeometryHash.js";
|
|
5
|
-
import { array_copy } from "../../../../../core/collection/array/array_copy.js";
|
|
6
|
-
import { mat4 } from "gl-matrix";
|
|
7
|
-
import { Group, Matrix4, Mesh } from "three";
|
|
8
|
-
import { mergeBufferGeometries } from "three/examples/jsm/utils/BufferGeometryUtils.js";
|
|
9
10
|
|
|
10
11
|
class GeometryContext {
|
|
11
12
|
constructor() {
|
|
12
|
-
this.matrix = new Float32Array(
|
|
13
|
+
this.matrix = new Float32Array(MATRIX_4_IDENTITY);
|
|
13
14
|
this.material = null;
|
|
14
15
|
this.geometry = null;
|
|
15
16
|
}
|
|
@@ -51,12 +52,12 @@ function compute_transform_matrix(object, ancestor_root, result) {
|
|
|
51
52
|
//
|
|
52
53
|
path.reverse();
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
result.set(MATRIX_4_IDENTITY);
|
|
55
56
|
|
|
56
57
|
for (let i = 0; i < path.length; i++) {
|
|
57
58
|
const el = path[i];
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
m4_multiply(result, result, el.matrix.elements);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
}
|
|
@@ -132,7 +133,6 @@ function merge_contexts(contexts) {
|
|
|
132
133
|
|
|
133
134
|
const merged_context = new GeometryContext();
|
|
134
135
|
|
|
135
|
-
mat4.identity(merged_context.matrix);
|
|
136
136
|
merged_context.geometry = merged;
|
|
137
137
|
merged_context.material = contexts[0].material;
|
|
138
138
|
|