mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-02 11:24:32 +08:00
Correct parameter type for Vector4.setAxisAngleFromRotationMatrix.
The parameter to Vector4.setAxisAngleFromRotationMatrix is a Matrix4 from which the upper 3x3 matrix is used, not a Matrix3. See https://github.com/mrdoob/three.js/blob/master/src/math/Vector4.js#L271 for a reference.
This commit is contained in:
@@ -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!" );
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user