提交 2b13d3e1 编写于 作者: M Mr.doob

Moved Ray legacy code.

上级 a943535a
......@@ -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 () {
......
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册