فهرست منبع

Ray: Clean up (#25524)

* Ray: Clean up

* Don't move t0

* Update Ray.js

---------

Co-authored-by: mrdoob <[email protected]>
Levi Pesin 2 سال پیش
والد
کامیت
90e4e6caee
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/math/Ray.js

+ 2 - 2
src/math/Ray.js

@@ -234,8 +234,8 @@ class Ray {
 		// t1 = second intersect point - exit point on back of sphere
 		const t1 = tca + thc;
 
-		// test to see if both t0 and t1 are behind the ray - if so, return null
-		if ( t0 < 0 && t1 < 0 ) return null;
+		// test to see if t1 is behind the ray - if so, return null
+		if ( t1 < 0 ) return null;
 
 		// test to see if t0 is behind the ray:
 		// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,