소스 검색

Ray: Slightly optimize .intersectsSphere()

Mugen87 7 년 전
부모
커밋
8288ae7c33
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/math/Ray.js

+ 1 - 1
src/math/Ray.js

@@ -290,7 +290,7 @@ Object.assign( Ray.prototype, {
 
 	intersectsSphere: function ( sphere ) {
 
-		return this.distanceToPoint( sphere.center ) <= sphere.radius;
+		return this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius );
 
 	},