فهرست منبع

Ray: Handle empty spheres in `intersectsSphere()`. (#31200)

Michael Herzog 7 ماه پیش
والد
کامیت
ea4ecb7498
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      src/math/Ray.js

+ 2 - 0
src/math/Ray.js

@@ -346,6 +346,8 @@ class Ray {
 	 */
 	intersectsSphere( sphere ) {
 
+		if ( sphere.radius < 0 ) return false; // handle empty spheres, see #31187
+
 		return this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius );
 
 	}

粤ICP备19079148号