瀏覽代碼

InstancedMesh: use renderable instanceMatrix default (#24749)

* InstancedMesh: use renderable instanceMatrix default

* InstancedMesh: lint
Cody Bennett 2 年之前
父節點
當前提交
2f5a5e131f
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/objects/InstancedMesh.js

+ 7 - 0
src/objects/InstancedMesh.js

@@ -7,6 +7,7 @@ const _instanceWorldMatrix = /*@__PURE__*/ new Matrix4();
 
 const _instanceIntersects = [];
 
+const _identity = /*@__PURE__*/ new Matrix4();
 const _mesh = /*@__PURE__*/ new Mesh();
 
 class InstancedMesh extends Mesh {
@@ -24,6 +25,12 @@ class InstancedMesh extends Mesh {
 
 		this.frustumCulled = false;
 
+		for ( let i = 0; i < count; i ++ ) {
+
+			this.setMatrixAt( i, _identity );
+
+		}
+
 	}
 
 	copy( source, recursive ) {