|
|
|
|
@ -29,6 +29,8 @@ class DualQuaternionTest: public Corrade::TestSuite::Tester {
|
|
|
|
|
void constructDefault(); |
|
|
|
|
void constructFromVector(); |
|
|
|
|
|
|
|
|
|
void constExpressions(); |
|
|
|
|
|
|
|
|
|
void lengthSquared(); |
|
|
|
|
void length(); |
|
|
|
|
void normalized(); |
|
|
|
|
@ -60,6 +62,8 @@ DualQuaternionTest::DualQuaternionTest() {
|
|
|
|
|
&DualQuaternionTest::constructDefault, |
|
|
|
|
&DualQuaternionTest::constructFromVector, |
|
|
|
|
|
|
|
|
|
&DualQuaternionTest::constExpressions, |
|
|
|
|
|
|
|
|
|
&DualQuaternionTest::lengthSquared, |
|
|
|
|
&DualQuaternionTest::length, |
|
|
|
|
&DualQuaternionTest::normalized, |
|
|
|
|
@ -93,6 +97,24 @@ void DualQuaternionTest::constructFromVector() {
|
|
|
|
|
CORRADE_COMPARE(DualQuaternion({1.0f, 2.0f, 3.0f}), DualQuaternion({{0.0f, 0.0f, 0.0f}, 1.0f}, {{1.0f, 2.0f, 3.0f}, 0.0f})); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DualQuaternionTest::constExpressions() { |
|
|
|
|
/* Default constructor */ |
|
|
|
|
constexpr DualQuaternion a; |
|
|
|
|
CORRADE_COMPARE(a, DualQuaternion({{0.0f, 0.0f, 0.0f}, 1.0f}, {{0.0f, 0.0f, 0.0f}, 0.0f})); |
|
|
|
|
|
|
|
|
|
/* Value constructor */ |
|
|
|
|
constexpr DualQuaternion b({{1.0f, 2.0f, -3.0f}, -3.5f}, {{4.5f, -7.0f, 2.0f}, 1.0f}); |
|
|
|
|
CORRADE_COMPARE(b, DualQuaternion({{1.0f, 2.0f, -3.0f}, -3.5f}, {{4.5f, -7.0f, 2.0f}, 1.0f})); |
|
|
|
|
|
|
|
|
|
/* Vector constructor */ |
|
|
|
|
constexpr DualQuaternion c({1.5f, -5.0f, 3.0f}); |
|
|
|
|
CORRADE_COMPARE(c, DualQuaternion({{0.0f, 0.0f, 0.0f}, 1.0f}, {{1.5f, -5.0f, 3.0f}, 0.0f})); |
|
|
|
|
|
|
|
|
|
/* Copy constructor */ |
|
|
|
|
constexpr DualQuaternion d(b); |
|
|
|
|
CORRADE_COMPARE(d, DualQuaternion({{1.0f, 2.0f, -3.0f}, -3.5f}, {{4.5f, -7.0f, 2.0f}, 1.0f})); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DualQuaternionTest::lengthSquared() { |
|
|
|
|
CORRADE_COMPARE(DualQuaternion().lengthSquared(), 1.0f); |
|
|
|
|
|
|
|
|
|
|