Unit test Quaternion::Quaternion(Matrix3x3).
This commit is contained in:
@@ -95,6 +95,20 @@ namespace QuaternionTests {
|
||||
jtest::check(Math::EqualAbs(expected_result.w, from_axis.w, 1e-6f));
|
||||
});
|
||||
|
||||
QuaternionUnit += Test("To&FromMatrix3x3", [] {
|
||||
// TODO: Test multiple rotation values.
|
||||
// https://www.andre-gaschler.com/rotationconverter/
|
||||
Matrix3x3 matrix_rep = {
|
||||
0.9902160, 0.0000000, 0.1395431,
|
||||
0.1273699, 0.4084874, -0.9038334,
|
||||
-0.0570016, 0.9127640, 0.4044908};
|
||||
Quaternion quat_rep = {0.5425029, 0.0586955, 0.0380374, 0.8371371};
|
||||
|
||||
Quaternion from_mat = Quaternion(matrix_rep);
|
||||
|
||||
jtest::check(quat_rep.Equals(from_mat));
|
||||
});
|
||||
|
||||
QuaternionUnit += Test("Mat4x4Conversion", [] { throw("Not Implemented"); });
|
||||
QuaternionUnit += Test("MulOpQuat", [] { throw("Not Implemented"); });
|
||||
QuaternionUnit += Test("DivOpQuat", [] { throw("Not Implemented"); });
|
||||
|
Reference in New Issue
Block a user