viral-viewer-2 4.2.3 → 4.2.4
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.
|
@@ -34060,7 +34060,8 @@ which can be placed in CurveUtils.
|
|
|
34060
34060
|
self.addEventListener("message", (event) => {
|
|
34061
34061
|
const meshes = progressGeometries(event.data);
|
|
34062
34062
|
if (event.data.Instances && event.data.Instances.length > 0) {
|
|
34063
|
-
const
|
|
34063
|
+
const instanceGroup = new Mesh();
|
|
34064
|
+
const mesh = new Mesh();
|
|
34064
34065
|
for (let index = 0; index < meshes.length; index++) {
|
|
34065
34066
|
const element = meshes[index];
|
|
34066
34067
|
mesh.add(element);
|
|
@@ -34085,13 +34086,15 @@ which can be placed in CurveUtils.
|
|
|
34085
34086
|
//transform first
|
|
34086
34087
|
let matrix4 = new Matrix4();
|
|
34087
34088
|
matrix4.fromArray(numbers);
|
|
34088
|
-
mesh.
|
|
34089
|
-
|
|
34089
|
+
let cloneMesh = mesh.clone();
|
|
34090
|
+
cloneMesh.setMatrixAt(index, matrix4);
|
|
34091
|
+
cloneMesh.setColorAt(index, new Color());
|
|
34092
|
+
cloneMesh.updateMatrix();
|
|
34093
|
+
instanceGroup.add(cloneMesh);
|
|
34090
34094
|
}
|
|
34091
34095
|
// childMesh.instanceMatrix.needsUpdate = true;
|
|
34092
|
-
|
|
34093
|
-
|
|
34094
|
-
let jsonData = mesh.toJSON();
|
|
34096
|
+
instanceGroup.userData.IsInstancedMesh = true;
|
|
34097
|
+
let jsonData = instanceGroup.toJSON();
|
|
34095
34098
|
self.postMessage(jsonData);
|
|
34096
34099
|
}
|
|
34097
34100
|
else {
|