123456789101112131415161718192021222324252627282930313233 |
- #include "tests/ViewTests.h"
- #include "math/View.h"
- #include "test/Test.h"
- using V3 = Core::Vector3;
- static void testFromAngles() {
- Core::View v;
- v.updateDirections(0.0f, 0.0f);
- CORE_TEST_VECTOR(V3(0.0f, 1.0f, 0.0f), v.getUp());
- CORE_TEST_VECTOR(V3(0.0f, -1.0f, 0.0f), v.getDown());
- CORE_TEST_VECTOR(V3(0.0f, 0.0f, -1.0f), v.getLeft());
- CORE_TEST_VECTOR(V3(0.0f, 0.0f, 1.0f), v.getRight());
- CORE_TEST_VECTOR(V3(1.0f, 0.0f, 0.0f), v.getFront());
- CORE_TEST_VECTOR(V3(-1.0f, 0.0f, 0.0f), v.getBack());
- }
- static void testFromQuaternion() {
- Core::View v;
- v.updateDirections(Core::Quaternion());
- CORE_TEST_VECTOR(V3(0.0f, 1.0f, 0.0f), v.getUp());
- CORE_TEST_VECTOR(V3(0.0f, -1.0f, 0.0f), v.getDown());
- CORE_TEST_VECTOR(V3(0.0f, 0.0f, -1.0f), v.getLeft());
- CORE_TEST_VECTOR(V3(0.0f, 0.0f, 1.0f), v.getRight());
- CORE_TEST_VECTOR(V3(1.0f, 0.0f, 0.0f), v.getFront());
- CORE_TEST_VECTOR(V3(-1.0f, 0.0f, 0.0f), v.getBack());
- }
- void Core::ViewTests::test() {
- testFromAngles();
- testFromQuaternion();
- }
|