Merge pull request #7605 from oscarlorentzon/bug/threejs-vector4-axisangle

Correct parameter type for Vector4.setAxisAngleFromRotationMatrix.
This commit is contained in:
Masahiro Wakame
2016-01-23 22:09:52 +09:00
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -3524,4 +3524,16 @@
ok( a.equals( b ), "Passed!" );
ok( b.equals( a ), "Passed!" );
});
test( "setAxisAngleFromRotationMatrix", function() {
var TOL = 1e-9;
var r = new THREE.Matrix4().makeRotationZ(Math.PI / 2);
var v = new THREE.Vector4().setAxisAngleFromRotationMatrix(r);
ok( v.x == 0, "Passed!" );
ok( v.y == 0, "Passed!" );
ok( v.z == 1, "Passed!" );
ok( Math.abs(v.w - Math.PI / 2) < TOL, "Passed!" );
});
};
+1 -1
View File
@@ -4166,7 +4166,7 @@ declare module THREE {
* http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm
* @param m assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
*/
setAxisAngleFromRotationMatrix(m: Matrix3): Vector4;
setAxisAngleFromRotationMatrix(m: Matrix4): Vector4;
min(v: Vector4): Vector4;
max(v: Vector4): Vector4;