From 2b13d3e1963bd6a1a9939ae2ba8a8c1441c70ab8 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 27 Oct 2015 11:59:23 -0400 Subject: [PATCH] Moved Ray legacy code. --- src/Three.Legacy.js | 25 +++++++++++++++++++++++++ src/math/Ray.js | 24 ------------------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/Three.Legacy.js b/src/Three.Legacy.js index e13131d6f0..69d424185d 100644 --- a/src/Three.Legacy.js +++ b/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 () { diff --git a/src/math/Ray.js b/src/math/Ray.js index a9b8dfc6ab..58a4669328 100644 --- a/src/math/Ray.js +++ b/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. -- GitLab