diff --git a/include/omath/3d_primitives/mesh.hpp b/include/omath/3d_primitives/mesh.hpp index 311b10f..2c82e6f 100644 --- a/include/omath/3d_primitives/mesh.hpp +++ b/include/omath/3d_primitives/mesh.hpp @@ -11,24 +11,25 @@ namespace omath::primitives { - struct Vertex + template> + struct Vertex final { - using VectorType = Vector3; - Vector3 position; - Vector3 normal; - Vector3 uv; + using VectorType = T; + VectorType position; + VectorType normal; + VectorType uv; }; template concept HasPosition = requires(T vertex) { vertex.position; }; template concept HasNormal = requires(T vertex) { vertex.normal; }; template concept HasUv = requires(T vertex) { vertex.uv; }; - template + template> class Mesh final { public: using NumericType = float; - using VertexType = Vertex; + using VertexType = VertType; private: using Vbo = std::vector; using Vao = std::vector>; diff --git a/tests/general/unit_test_colider.cpp b/tests/general/unit_test_colider.cpp index e5d08e6..4800ea2 100644 --- a/tests/general/unit_test_colider.cpp +++ b/tests/general/unit_test_colider.cpp @@ -8,7 +8,7 @@ TEST(UnitTestColider, CheckToWorld) { omath::source_engine::Mesh mesh = { - std::vector{ + std::vector>{ { { 1.f, 1.f, 1.f }, {}, {} }, { {-1.f, -1.f, -1.f }, {}, {} } }, diff --git a/tests/general/unit_test_epa.cpp b/tests/general/unit_test_epa.cpp index 5131405..c0b8464 100644 --- a/tests/general/unit_test_epa.cpp +++ b/tests/general/unit_test_epa.cpp @@ -14,7 +14,7 @@ using EPA = omath::collision::Epa; TEST(UnitTestEpa, TestCollisionTrue) { // Unit cube [-1,1]^3 - std::vector vbo = { + std::vector> vbo = { { {-1.f, -1.f, -1.f}, {}, {} }, { {-1.f, -1.f, 1.f}, {}, {} }, { {-1.f, 1.f, -1.f}, {}, {} }, @@ -88,7 +88,7 @@ TEST(UnitTestEpa, TestCollisionTrue) } TEST(UnitTestEpa, TestCollisionTrue2) { - std::vector vbo = { + std::vector> vbo = { { { -1.f, -1.f, -1.f }, {}, {} }, { { -1.f, -1.f, 1.f }, {}, {} }, { { -1.f, 1.f, -1.f }, {}, {} },