From 5606570dcfad561c9c022d17cbc84a705db69413 Mon Sep 17 00:00:00 2001 From: Ben Houston Date: Mon, 31 Dec 2012 08:35:23 -0500 Subject: [PATCH] remove unnecessary Matrix4 unit tests. --- test/unit/math/Matrix4.js | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/test/unit/math/Matrix4.js b/test/unit/math/Matrix4.js index 4a3e13e017..929201fb78 100644 --- a/test/unit/math/Matrix4.js +++ b/test/unit/math/Matrix4.js @@ -217,42 +217,6 @@ test( "transpose", function() { ok( matrixEquals4( b, c ), "Passed!" ); }); -// this function is a duplicate of that in ArrowHelper. -var makeBasis = function ( axis ) { - - var matrix = new THREE.Matrix4(); - - if( axis.distanceTo( new THREE.Vector3( 0, 1, 0 ) ) < 0.001 ) { - matrix.identity(); - } - else if( axis.distanceTo( new THREE.Vector3( 0, -1, 0 ) ) < 0.001 ) { - matrix.makeRotationZ( Math.PI ); - } - else { - var perpendicularAxis = new THREE.Vector3( 0, 1, 0 ).crossSelf( axis ); - perpendicularAxis.normalize(); - var radians = Math.acos( new THREE.Vector3( 0, 1, 0 ).dot( perpendicularAxis ) ); - matrix.makeRotationAxis( perpendicularAxis, radians ); - } - - return matrix; -} - -test( "makeBasis", function() { - var axes = [ - new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ), new THREE.Vector3( 0, 0, 1 ), - new THREE.Vector3( -1, 0, 0 ), new THREE.Vector3( 0, -1, 0 ), new THREE.Vector3( 0, 0, -1 ) - ]; - - var v = new THREE.Vector3( 0, 1, 0 ); - for( var i = 0, il = axes.length; i < il; i ++ ) { - var v0 = axes[i]; - var m = makeBasis( v0 ); - var v1 = m.multiplyVector3( v.clone() ); - ok( v1.distanceTo( v0 ) < 0.001, "Passed!" ); - } -}); - test( "clone", function() { var a = new THREE.Matrix4( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ); var b = a.clone(); -- GitLab