Просмотр исходного кода

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

Michael Herzog 7 месяцев назад
Родитель
Сommit
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号