소스 검색

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 ) {