Skip to content

Commit 2901f76

Browse files
bhoustonmrdoob
authored andcommitted
Box3.intersect should ensure that empty intersections result in fully empty boxes
1 parent a58012b commit 2901f76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/math/Box3.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ THREE.Box3.prototype = {
385385
this.min.max( box.min );
386386
this.max.min( box.max );
387387

388+
// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.
389+
if( this.isEmpty() ) this.makeEmpty();
390+
388391
return this;
389392

390393
},

0 commit comments

Comments
 (0)