提交 42d586f7 编写于 作者: B Ben Houston

minor fixes.

上级 44478c4f
......@@ -106,7 +106,7 @@ THREE.Box2.prototype = {
},
volume: function () {
area: function () {
return ( this.max.x - this.min.x ) * ( this.max.y - this.min.y );
......
......@@ -51,9 +51,9 @@ test( "empty/makeEmpty", function() {
ok( a.empty(), "Passed!" );
});
test( "volume", function() {
test( "area", function() {
var a = new THREE.Box2( zero, one );
ok( a.volume() == 1, "Passed!" );
ok( a.area() == 1, "Passed!" );
});
test( "center", function() {
......@@ -86,16 +86,21 @@ test( "expandByPoint", function() {
a.expandByPoint( one.clone().negate() );
ok( a.size().equals( one.clone().multiplyScalar( 2 ) ), "Passed!" );
console.log( a );
console.log( a.center() );
ok( a.center().equals( zero ), "Passed!" );
});
test( "expandByVector", function() {
var a = new THREE.Box2( zero );
console.log( a );
a.expandByVector( zero );
console.log( a );
ok( a.size().equals( zero ), "Passed!" );
a.expandByVector( one );
console.log( a );
ok( a.size().equals( one.clone().multiplyScalar( 2 ) ), "Passed!" );
ok( a.center().equals( zero ), "Passed!" );
});
......
......@@ -11,8 +11,6 @@ test( "constructor", function() {
ok( a.normal.z == 0, "Passed!" );
ok( a.constant == 0, "Passed!" );
console.log( one );
a = new THREE.Plane( one, 0 );
ok( a.normal.x == 1, "Passed!" );
ok( a.normal.y == 1, "Passed!" );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册