소스 검색

small performance optimization through math

Marc-Sefan Cassola 8 년 전
부모
커밋
e645952b90
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/objects/Points.js

+ 1 - 1
src/objects/Points.js

@@ -55,7 +55,7 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
 			inverseMatrix.getInverse( matrixWorld );
 			inverseMatrix.getInverse( matrixWorld );
 			ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
 			ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
 
 
-			var localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );
+			var localThreshold = 3 * threshold / ( this.scale.x + this.scale.y + this.scale.z );
 			var localThresholdSq = localThreshold * localThreshold;
 			var localThresholdSq = localThreshold * localThreshold;
 			var position = new Vector3();
 			var position = new Vector3();
 
 

粤ICP备19079148号