Pārlūkot izejas kodu

Updated tests affected by previous commit.

Mr.doob 12 gadi atpakaļ
vecāks
revīzija
cfc98f59be

+ 2 - 3
test/unit/math/Box3.js

@@ -254,10 +254,9 @@ test( "transform", function() {
 	var c = new THREE.Box3( one3.clone().negate(), one3.clone() );
 	var d = new THREE.Box3( one3.clone().negate(), zero3.clone() );
 
-	var m = new THREE.Matrix4();
-
+	var m = new THREE.Matrix4().makeTranslation( 1, -2, 1 );
 	var t1 = new THREE.Vector3( 1, -2, 1 );
-	m.makeTranslation( t1 );
+
 	ok( compareBox( a.clone().transform( m ), a.clone().translate( t1 ) ), "Passed!" );
 	ok( compareBox( b.clone().transform( m ), b.clone().translate( t1 ) ), "Passed!" );
 	ok( compareBox( c.clone().transform( m ), c.clone().translate( t1 ) ), "Passed!" );

+ 2 - 2
test/unit/math/Matrix3.js

@@ -165,8 +165,8 @@ test( "getInverse", function() {
 		new THREE.Matrix4().makeRotationY( -0.3 ),
 		new THREE.Matrix4().makeRotationZ( 0.3 ),
 		new THREE.Matrix4().makeRotationZ( -0.3 ),
-		new THREE.Matrix4().makeScale( new THREE.Vector3( 1, 2, 3 ) ),
-		new THREE.Matrix4().makeScale( new THREE.Vector3( 1/8, 1/2, 1/3 ) )
+		new THREE.Matrix4().makeScale( 1, 2, 3 ),
+		new THREE.Matrix4().makeScale( 1/8, 1/2, 1/3 )
 		];
 
 	for( var i = 0, il = testMatrices.length; i < il; i ++ ) {

+ 3 - 3
test/unit/math/Matrix4.js

@@ -182,11 +182,11 @@ test( "getInverse", function() {
 		new THREE.Matrix4().makeRotationY( -0.3 ),
 		new THREE.Matrix4().makeRotationZ( 0.3 ),
 		new THREE.Matrix4().makeRotationZ( -0.3 ),
-		new THREE.Matrix4().makeScale( new THREE.Vector3( 1, 2, 3 ) ),
-		new THREE.Matrix4().makeScale( new THREE.Vector3( 1/8, 1/2, 1/3 ) ),
+		new THREE.Matrix4().makeScale( 1, 2, 3 ),
+		new THREE.Matrix4().makeScale( 1/8, 1/2, 1/3 ),
 		new THREE.Matrix4().makeFrustum( -1, 1, -1, 1, 1, 1000 ),
 		new THREE.Matrix4().makeFrustum( -16, 16, -9, 9, 0.1, 10000 ),
-		new THREE.Matrix4().makeTranslation( new THREE.Vector3( 1, 2, 3 ) )
+		new THREE.Matrix4().makeTranslation( 1, 2, 3 )
 		];
 
 	for( var i = 0, il = testMatrices.length; i < il; i ++ ) {

+ 2 - 2
test/unit/math/Plane.js

@@ -191,6 +191,6 @@ test( "transform/translate", function() {
 	a = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ), -1 );
 	ok( comparePlane( a.clone().transform( m ), new THREE.Plane( new THREE.Vector3( -1, 0, 0 ), -1 ) ), "Passed!" );
 
-	m.makeTranslation( new THREE.Vector3( 1, 1, 1 ) );
+	m.makeTranslation( 1, 1, 1 );
 	ok( comparePlane( a.clone().transform( m ), a.clone().translate( new THREE.Vector3( 1, 1, 1 ) ) ), "Passed!" );
-});
+});

+ 1 - 3
test/unit/math/Sphere.js

@@ -88,9 +88,7 @@ test( "getBoundingBox", function() {
 test( "transform", function() {
 	var a = new THREE.Sphere( one3, 1 );
 
-	var m = new THREE.Matrix4();
-	var t1 = new THREE.Vector3( 1, -2, 1 );
-	m.makeTranslation( t1 );
+	var m = new THREE.Matrix4().makeTranslation( 1, -2, 1 );
 
 	ok( a.clone().transform( m ).getBoundingBox().equals( a.getBoundingBox().transform( m ) ), "Passed!" );
 });