Browse Source

Merging with @bhouston.

Mr.doob 12 years ago
parent
commit
58a236742d
1 changed files with 9 additions and 14 deletions
  1. 9 14
      src/core/Box3.js

+ 9 - 14
src/core/Box3.js

@@ -4,19 +4,16 @@
 
 THREE.Box3 = function ( min, max ) {
 
-	if ( min === undefined && max === undefined ) {
+	if( min == undefined && max === undefined ) {
 
 		this.min = new THREE.Vector3();
 		this.max = new THREE.Vector3();
 		this.makeEmpty();
-
-	} else {
-
+	}
+	else {
 		this.min = min || new THREE.Vector3();
 		this.max = max || new THREE.Vector3().copy( this.min ); // This is done on purpose so you can make a box using a single point and then expand it.
-
 	}
-
 };
 
 THREE.Box3.prototype = {
@@ -84,7 +81,6 @@ THREE.Box3.prototype = {
 		}
 
 		return this;
-
 	},
 
 	setFromCenterAndSize: function ( center, size ) {
@@ -119,7 +115,6 @@ THREE.Box3.prototype = {
 	empty: function () {
 
 		// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes
-
 		return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z );
 
 	},
@@ -172,8 +167,8 @@ THREE.Box3.prototype = {
 	containsPoint: function ( point ) {
 
 		if ( ( this.min.x <= point.x ) && ( point.x <= this.max.x ) &&
-			 ( this.min.y <= point.y ) && ( point.y <= this.max.y ) &&
-			 ( this.min.z <= point.z ) && ( point.z <= this.max.z ) ) {
+			( this.min.y <= point.y ) && ( point.y <= this.max.y ) &&
+			( this.min.z <= point.z ) && ( point.z <= this.max.z ) ) {
 
 			return true;
 
@@ -186,8 +181,8 @@ THREE.Box3.prototype = {
 	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 ) ) {
+			( 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;
 
@@ -214,8 +209,8 @@ THREE.Box3.prototype = {
 		// using 6 splitting planes to rule out intersections.
 
 		if ( ( this.max.x < box.min.x ) || ( box.min.x > this.max.x ) ||
-			 ( this.max.y < box.min.y ) || ( box.min.y > this.max.y ) ||
-			 ( this.max.z < box.min.z ) || ( box.min.z > this.max.z ) ) {
+			( this.max.y < box.min.y ) || ( box.min.y > this.max.y ) ||
+			( this.max.z < box.min.z ) || ( box.min.z > this.max.z ) ) {
 
 			return false;