From 48bf06f69c25dede68fbd722674a6baf95dda048 Mon Sep 17 00:00:00 2001 From: Orange Date: Sat, 29 Nov 2025 16:35:43 +0300 Subject: [PATCH] refactored using stuff --- include/omath/3d_primitives/mesh.hpp | 16 ++++++++-------- include/omath/collision/mesh_collider.hpp | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/omath/3d_primitives/mesh.hpp b/include/omath/3d_primitives/mesh.hpp index aa2f4d3..f5f47b7 100644 --- a/include/omath/3d_primitives/mesh.hpp +++ b/include/omath/3d_primitives/mesh.hpp @@ -28,7 +28,7 @@ namespace omath::primitives class Mesh final { public: - using NumericType = float; + using VectorType = VertType::VectorType; using VertexType = VertType; private: @@ -40,7 +40,7 @@ namespace omath::primitives Vao m_vertex_array_object; Mesh(Vbo vbo, Vao vao, - const Vector3 scale = + const VectorType scale = { 1, 1, @@ -49,13 +49,13 @@ namespace omath::primitives : m_vertex_buffer(std::move(vbo)), m_vertex_array_object(std::move(vao)), m_scale(std::move(scale)) { } - void set_origin(const Vector3& new_origin) + void set_origin(const VectorType& new_origin) { m_origin = new_origin; m_to_world_matrix = std::nullopt; } - void set_scale(const Vector3& new_scale) + void set_scale(const VectorType& new_scale) { m_scale = new_scale; m_to_world_matrix = std::nullopt; @@ -68,13 +68,13 @@ namespace omath::primitives } [[nodiscard]] - const Vector3& get_origin() const + const VectorType& get_origin() const { return m_origin; } [[nodiscard]] - const Vector3& get_scale() const + const VectorType& get_scale() const { return m_scale; } @@ -115,8 +115,8 @@ namespace omath::primitives } private: - Vector3 m_origin; - Vector3 m_scale; + VectorType m_origin; + VectorType m_scale; RotationAngles m_rotation_angles; diff --git a/include/omath/collision/mesh_collider.hpp b/include/omath/collision/mesh_collider.hpp index 8603e44..cfe9c1c 100644 --- a/include/omath/collision/mesh_collider.hpp +++ b/include/omath/collision/mesh_collider.hpp @@ -11,7 +11,6 @@ namespace omath::collision class MeshCollider { public: - using NumericType = MeshType::NumericType; using VertexType = MeshType::VertexType; using VectorType = VertexType::VectorType;