فهرست منبع

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 );
 
 	},