Преглед на файлове

Box3.intersect should ensure that empty intersections result in fully empty boxes

Ben Houston (Clara.io) преди 9 години
родител
ревизия
2901f76492
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      src/math/Box3.js

+ 3 - 0
src/math/Box3.js

@@ -385,6 +385,9 @@ THREE.Box3.prototype = {
 		this.min.max( box.min );
 		this.max.min( box.max );
 
+		// 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.
+		if( this.isEmpty() ) this.makeEmpty();
+
 		return this;
 
 	},