소스 검색

Revert "Improve Box3 closure performance"

This reverts commit 7ea7d9db8968e446fff6a92573a4685293b1be70.
Joe Fox 8 년 전
부모
커밋
77eacf7cae
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/math/Box3.js

+ 3 - 1
src/math/Box3.js

@@ -308,10 +308,12 @@ Object.assign( Box3.prototype, {
 
 	intersectsSphere: ( function () {
 
-		var closestPoint = new Vector3();
+		var closestPoint;
 
 		return function intersectsSphere( sphere ) {
 
+			if ( closestPoint === undefined ) closestPoint = new Vector3();
+
 			// Find the point on the AABB closest to the sphere center.
 			this.clampPoint( sphere.center, closestPoint );