@expofp/renderer 2.2.0 → 2.2.1
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/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1842,7 +1842,8 @@ class MeshSystem extends RenderableSystem {
|
|
|
1842
1842
|
}
|
|
1843
1843
|
updateShape(shapeDef, mesh, instanceId) {
|
|
1844
1844
|
const geometryId = mesh.getGeometryIdAt(instanceId);
|
|
1845
|
-
const
|
|
1845
|
+
const key = `${mesh.uuid}-${instanceId}`;
|
|
1846
|
+
const expectedShapeType = this.mapInstanceIdToShapeType.get(key);
|
|
1846
1847
|
const shape = shapeDef.shape;
|
|
1847
1848
|
const isPolygon = shape instanceof Polygon;
|
|
1848
1849
|
const isRect = shape instanceof Rect;
|
|
@@ -1898,16 +1899,19 @@ class MeshSystem extends RenderableSystem {
|
|
|
1898
1899
|
batchedMesh.setCustomSort((list) => this.sortInstances(batchedMesh, list));
|
|
1899
1900
|
for (const shapeDef of shapes) {
|
|
1900
1901
|
let instanceId;
|
|
1902
|
+
let type;
|
|
1901
1903
|
if (shapeDef.shape instanceof Rect && rectGeometryId !== void 0) {
|
|
1902
1904
|
instanceId = batchedMesh.addInstance(rectGeometryId);
|
|
1903
|
-
|
|
1905
|
+
type = "rect";
|
|
1904
1906
|
} else {
|
|
1905
1907
|
const geometry = shapeDefToGeometry.get(shapeDef);
|
|
1906
1908
|
const { vertices, indices } = countGeometry(geometry);
|
|
1907
1909
|
const polygonGeometryId = batchedMesh.addGeometry(this.placeholderPolygonGeometry, vertices, indices);
|
|
1908
1910
|
instanceId = batchedMesh.addInstance(polygonGeometryId);
|
|
1909
|
-
|
|
1911
|
+
type = "polygon";
|
|
1910
1912
|
}
|
|
1913
|
+
const key = `${batchedMesh.uuid}-${instanceId}`;
|
|
1914
|
+
this.mapInstanceIdToShapeType.set(key, type);
|
|
1911
1915
|
this.registerDefObject(shapeDef, batchedMesh, instanceId);
|
|
1912
1916
|
}
|
|
1913
1917
|
return batchedMesh;
|