|
@@ -244,29 +244,13 @@ Box3.prototype = {
|
|
|
|
|
|
containsPoint: function ( point ) {
|
|
|
|
|
|
- if ( point.x < this.min.x || point.x > this.max.x ||
|
|
|
- point.y < this.min.y || point.y > this.max.y ||
|
|
|
- point.z < this.min.z || point.z > this.max.z ) {
|
|
|
-
|
|
|
- return false;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
+ return !(point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z);
|
|
|
|
|
|
},
|
|
|
|
|
|
containsBox: function ( box ) {
|
|
|
|
|
|
- if ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) &&
|
|
|
- ( this.min.y <= box.min.y ) && ( box.max.y <= this.max.y ) &&
|
|
|
- ( this.min.z <= box.min.z ) && ( box.max.z <= this.max.z ) ) {
|
|
|
-
|
|
|
- return true;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) && ( this.min.y <= box.min.y ) && ( box.max.y <= this.max.y ) && ( this.min.z <= box.min.z ) && ( box.max.z <= this.max.z );
|
|
|
|
|
|
},
|
|
|
|
|
@@ -289,15 +273,7 @@ Box3.prototype = {
|
|
|
|
|
|
// using 6 splitting planes to rule out intersections.
|
|
|
|
|
|
- if ( box.max.x < this.min.x || box.min.x > this.max.x ||
|
|
|
- box.max.y < this.min.y || box.min.y > this.max.y ||
|
|
|
- box.max.z < this.min.z || box.min.z > this.max.z ) {
|
|
|
-
|
|
|
- return false;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
+ return !(box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z);
|
|
|
|
|
|
},
|
|
|
|