changed ebo type

This commit is contained in:
2025-11-29 16:49:19 +03:00
parent 9a89e2467e
commit e54d5e7388
2 changed files with 7 additions and 7 deletions

View File

@@ -33,13 +33,13 @@ namespace omath::primitives
private: private:
using Vbo = std::vector<VertexType>; using Vbo = std::vector<VertexType>;
using Vao = std::vector<Vector3<std::size_t>>; using Ebo = std::vector<Vector3<std::uint32_t>>;
public: public:
Vbo m_vertex_buffer; Vbo m_vertex_buffer;
Vao m_vertex_array_object; Ebo m_vertex_array_object;
Mesh(Vbo vbo, Vao vao, Mesh(Vbo vbo, Ebo vao,
const VectorType scale = const VectorType scale =
{ {
1, 1,
@@ -97,7 +97,7 @@ namespace omath::primitives
} }
[[nodiscard]] [[nodiscard]]
Vector3<float> vertex_to_world_space(const Vector3<float>& vertex_position) const VectorType vertex_to_world_space(const Vector3<float>& vertex_position) const
requires HasPosition<VertexType> requires HasPosition<VertexType>
{ {
auto abs_vec = get_to_world_matrix() * mat_column_from_vector(vertex_position); auto abs_vec = get_to_world_matrix() * mat_column_from_vector(vertex_position);
@@ -106,7 +106,7 @@ namespace omath::primitives
} }
[[nodiscard]] [[nodiscard]]
Triangle<Vector3<float>> make_face_in_world_space(const Vao::const_iterator vao_iterator) const Triangle<VectorType> make_face_in_world_space(const Ebo::const_iterator vao_iterator) const
requires HasPosition<VertexType> requires HasPosition<VertexType>
{ {
return {vertex_to_world_space(m_vertex_buffer.at(vao_iterator->x).position), return {vertex_to_world_space(m_vertex_buffer.at(vao_iterator->x).position),

View File

@@ -24,7 +24,7 @@ TEST(UnitTestEpa, TestCollisionTrue)
{ { 1.f, -1.f, 1.f}, {}, {} }, { { 1.f, -1.f, 1.f}, {}, {} },
{ { 1.f, -1.f, -1.f}, {}, {} } { { 1.f, -1.f, -1.f}, {}, {} }
}; };
std::vector<omath::Vector3<std::size_t>> vao; // not needed std::vector<omath::Vector3<std::uint32_t>> vao; // not needed
Mesh a(vbo, vao, {1, 1, 1}); Mesh a(vbo, vao, {1, 1, 1});
Mesh b(vbo, vao, {1, 1, 1}); Mesh b(vbo, vao, {1, 1, 1});
@@ -98,7 +98,7 @@ TEST(UnitTestEpa, TestCollisionTrue2)
{ { 1.f, -1.f, 1.f }, {}, {} }, { { 1.f, -1.f, 1.f }, {}, {} },
{ { 1.f, -1.f, -1.f }, {}, {} } { { 1.f, -1.f, -1.f }, {}, {} }
}; };
std::vector<omath::Vector3<std::size_t>> vao; // not needed std::vector<omath::Vector3<std::uint32_t>> vao; // not needed
Mesh a(vbo, vao, {1, 1, 1}); Mesh a(vbo, vao, {1, 1, 1});
Mesh b(vbo, vao, {1, 1, 1}); Mesh b(vbo, vao, {1, 1, 1});