|
|
|
|
@ -381,7 +381,8 @@ void VectorTest::bitwise() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void VectorTest::dot() { |
|
|
|
|
CORRADE_COMPARE(Math::dot(Vector4{1.0f, 0.5f, 0.75f, 1.5f}, {2.0f, 4.0f, 1.0f, 7.0f}), 15.25f); |
|
|
|
|
/* MSVC 2013 needs explicit type for both */ |
|
|
|
|
CORRADE_COMPARE(Math::dot(Vector4{1.0f, 0.5f, 0.75f, 1.5f}, Vector4{2.0f, 4.0f, 1.0f, 7.0f}), 15.25f); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void VectorTest::dotSelf() { |
|
|
|
|
@ -452,11 +453,13 @@ void VectorTest::projectedOntoNormalized() {
|
|
|
|
|
void VectorTest::angle() { |
|
|
|
|
std::ostringstream o; |
|
|
|
|
Error::setOutput(&o); |
|
|
|
|
Math::angle(Vector3(2.0f, 3.0f, 4.0f).normalized(), {1.0f, -2.0f, 3.0f}); |
|
|
|
|
/* MSVC 2013 needs explicit type for both */ |
|
|
|
|
Math::angle(Vector3(2.0f, 3.0f, 4.0f).normalized(), Vector3{1.0f, -2.0f, 3.0f}); |
|
|
|
|
CORRADE_COMPARE(o.str(), "Math::angle(): vectors must be normalized\n"); |
|
|
|
|
|
|
|
|
|
o.str({}); |
|
|
|
|
Math::angle({2.0f, 3.0f, 4.0f}, Vector3(1.0f, -2.0f, 3.0f).normalized()); |
|
|
|
|
/* MSVC 2013 needs explicit type for both */ |
|
|
|
|
Math::angle(Vector3{2.0f, 3.0f, 4.0f}, Vector3(1.0f, -2.0f, 3.0f).normalized()); |
|
|
|
|
CORRADE_COMPARE(o.str(), "Math::angle(): vectors must be normalized\n"); |
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(Math::angle(Vector3(2.0f, 3.0f, 4.0f).normalized(), |
|
|
|
|
|