viral-viewer-2 2.9.4 → 2.9.6

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.
@@ -34037,7 +34037,7 @@ function workerFunction() {
34037
34037
  }
34038
34038
  }
34039
34039
  //#endregion
34040
- //My code
34040
+ //#regionMy code
34041
34041
  //////////////////
34042
34042
  const maxPolygonPerObject = 1000;
34043
34043
  const maxPolygonForEdge = 1000;
@@ -34109,8 +34109,7 @@ function workerFunction() {
34109
34109
  // In case number of polygon larger than expect, merge them to reduce polygon first, for optimize purpose
34110
34110
  if (dummyGeometry.attributes.position.count > maxPolygonPerObject) {
34111
34111
  const modifier = new SimplifyModifier();
34112
- const ratio = maxPolygonPerObject /
34113
- dummyGeometry.attributes.position.count;
34112
+ const ratio = maxPolygonPerObject / dummyGeometry.attributes.position.count;
34114
34113
  const count = Math.floor(dummyGeometry.attributes.position.count * ratio); // number of polygon to remove
34115
34114
  geometry = modifier.modify(dummyGeometry, count);
34116
34115
  console.log(dummyGeometry.attributes.position.count, geometry.attributes.position.count);
@@ -34160,9 +34159,13 @@ function workerFunction() {
34160
34159
  bufferGeometry.setIndex(indices);
34161
34160
  const line = new LineSegments(bufferGeometry, new LineBasicMaterial({ color: "#666", linewidth: 0.5 }));
34162
34161
  line.applyMatrix4(matrix4);
34162
+ line.updateMatrix();
34163
34163
  childMesh.add(line);
34164
34164
  }
34165
34165
  }
34166
+ childMesh.instanceMatrix.needsUpdate = true;
34167
+ childMesh.updateMatrix();
34168
+ childMesh.updateMatrixWorld(true);
34166
34169
  let jsonData = childMesh.toJSON();
34167
34170
  self.postMessage(jsonData);
34168
34171
  }
@@ -34197,6 +34200,7 @@ function workerFunction() {
34197
34200
  this.Instances = [];
34198
34201
  }
34199
34202
  }
34203
+ //#endregion
34200
34204
  }
34201
34205
  exports.workerCode = workerFunction;
34202
34206
  //# sourceMappingURL=threejs.types.js.map