Browse Source

Moved Ray legacy code.

Mr.doob 9 years ago
parent
commit
2b13d3e196
2 changed files with 25 additions and 24 deletions
  1. 25 0
      src/Three.Legacy.js
  2. 0 24
      src/math/Ray.js

+ 25 - 0
src/Three.Legacy.js

@@ -113,6 +113,8 @@ Object.defineProperties( THREE.Matrix4.prototype, {
 	}
 } );
 
+//
+
 Object.defineProperties( THREE.Plane.prototype, {
 	isIntersectionLine: {
 		value: function ( line ) {
@@ -124,6 +126,29 @@ Object.defineProperties( THREE.Plane.prototype, {
 
 //
 
+Object.defineProperties( THREE.Ray.prototype, {
+	isIntersectionBox: {
+		value: function ( box ) {
+			console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' );
+			return this.intersectsBox( box );
+		}
+	},
+	isIntersectionPlane: {
+		value: function ( plane ) {
+			console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' );
+			return this.intersectsPlane( plane );
+		}
+	},
+	isIntersectionSphere: {
+		value: function ( sphere ) {
+			console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
+			return this.intersectsSphere( sphere );
+		}
+	}
+} );
+
+//
+
 Object.defineProperties( THREE.Vector3.prototype, {
 	setEulerFromRotationMatrix: {
 		value: function () {

+ 0 - 24
src/math/Ray.js

@@ -279,14 +279,6 @@ THREE.Ray.prototype = {
 
 	},
 
-	isIntersectionSphere: function ( sphere ) {
-
-		console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
-
-		return this.intersectsSphere( sphere );
-
-	},
-
 	distanceToPlane: function ( plane ) {
 
 		var denominator = plane.normal.dot( this.direction );
@@ -356,14 +348,6 @@ THREE.Ray.prototype = {
 
 	},
 
-	isIntersectionPlane: function ( plane ) {
-
-		console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' );
-
-		return this.intersectsPlane( plane );
-
-	},
-
 	intersectBox: function ( box, optionalTarget ) {
 
 		// http://www.scratchapixel.com/lessons/3d-basic-lessons/lesson-7-intersecting-simple-shapes/ray-box-intersection/
@@ -447,14 +431,6 @@ THREE.Ray.prototype = {
 
 	} )(),
 
-	isIntersectionBox: function ( box ) {
-
-		console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' );
-
-		return this.intersectsBox( box );
-
-	},
-
 	intersectTriangle: function () {
 
 		// Compute the offset origin, edges, and normal.