瀏覽代碼

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,