浏览代码

fix duplicate array creation

webglzhang 5 年之前
父节点
当前提交
f649588c9c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/objects/InstancedMesh.js

+ 2 - 2
src/objects/InstancedMesh.js

@@ -53,7 +53,7 @@ InstancedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
 			_instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix );
 			_instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix );
 
 
 
 
-			//The agent mesh represents this single instance
+			//The mesh represents this single instance
 
 
 			_mesh.matrixWorld = _instanceWorldMatrix;
 			_mesh.matrixWorld = _instanceWorldMatrix;
 
 
@@ -69,7 +69,7 @@ InstancedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
 
 
 				intersects.push( _instanceIntersects[ 0 ] );
 				intersects.push( _instanceIntersects[ 0 ] );
 
 
-				_instanceIntersects = [];
+				_instanceIntersects.length = 0;
 
 
 			}
 			}