提交 800d0f8e 编写于 作者: B Ben Houston

rename Plane.flip() -> Plane.negate() per @mrdoob

上级 af4b73c0
......@@ -74,7 +74,7 @@ THREE.Plane.prototype = {
},
flip: function () {
negate: function () {
this.constant *= -1;
this.normal.negate();
......
......@@ -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!" );
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册