diff --git a/src/math/Plane.js b/src/math/Plane.js index 9caee8a62677e683641e99e574138e32f4a1c555..9f40151792f8dcc57ca16be561afd3b3e9bc8894 100644 --- a/src/math/Plane.js +++ b/src/math/Plane.js @@ -74,7 +74,7 @@ THREE.Plane.prototype = { }, - flip: function () { + negate: function () { this.constant *= -1; this.normal.negate(); diff --git a/test/unit/math/Plane.js b/test/unit/math/Plane.js index 844053b36e2313d6f4c9672134fb66bee3cd4565..13f908eebe1c3f66f6ce2145b5be9b139fe991c4 100644 --- a/test/unit/math/Plane.js +++ b/test/unit/math/Plane.js @@ -94,14 +94,14 @@ test( "normalize", function() { ok( a.constant == 1, "Passed!" ); }); -test( "flip/distanceToPoint", function() { +test( "negate/distanceToPoint", function() { var a = new THREE.Plane( new THREE.Vector3( 2, 0, 0 ), -2 ); a.normalize(); ok( a.distanceToPoint( new THREE.Vector3( 4, 0, 0 ) ) === 3, "Passed!" ); ok( a.distanceToPoint( new THREE.Vector3( 1, 0, 0 ) ) === 0, "Passed!" ); - a.flip(); + a.negate(); ok( a.distanceToPoint( new THREE.Vector3( 4, 0, 0 ) ) === -3, "Passed!" ); ok( a.distanceToPoint( new THREE.Vector3( 1, 0, 0 ) ) === 0, "Passed!" ); });