Browse Source

Moved Box* legacy code.

Mr.doob 9 years ago
parent
commit
70b2bd4bf7
3 changed files with 24 additions and 24 deletions
  1. 24 0
      src/Three.Legacy.js
  2. 0 8
      src/math/Box2.js
  3. 0 16
      src/math/Box3.js

+ 24 - 0
src/Three.Legacy.js

@@ -2,6 +2,30 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
+Object.defineProperties( THREE.Box2.prototype, {
+	isIntersectionBox: {
+		value: function ( box ) {
+			console.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' );
+			return this.intersectsBox( box );
+		}
+	}
+} );
+
+Object.defineProperties( THREE.Box3.prototype, {
+	isIntersectionBox: {
+		value: function ( box ) {
+			console.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' );
+			return this.intersectsBox( box );
+		}
+	},
+	isIntersectionSphere: {
+		value: function ( sphere ) {
+			console.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
+			return this.intersectsSphere( sphere );
+		}
+	}
+} );
+
 Object.defineProperties( THREE.Light.prototype, {
 	onlyShadow: {
 		set: function ( value ) {

+ 0 - 8
src/math/Box2.js

@@ -180,14 +180,6 @@ THREE.Box2.prototype = {
 
 	},
 
-	isIntersectionBox: function ( box ) {
-
-		console.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' );
-
-		return this.intersectsBox( box );
-
-	},
-
 	clampPoint: function ( point, optionalTarget ) {
 
 		var result = optionalTarget || new THREE.Vector2();

+ 0 - 16
src/math/Box3.js

@@ -247,14 +247,6 @@ THREE.Box3.prototype = {
 
 	},
 
-	isIntersectionBox: function ( box ) {
-
-		console.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' );
-
-		return this.intersectsBox( box );
-
-	},
-
 	intersectsSphere: ( function () {
 
 		var closestPoint;
@@ -273,14 +265,6 @@ THREE.Box3.prototype = {
 
 	} )(),
 
-	isIntersectionSphere: function ( sphere ) {
-
-		console.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
-
-		return this.intersectsSphere( sphere );
-
-	},
-
 	intersectsPlane: function ( plane ) {
 
 		// We compute the minimum and maximum dot product values. If those values