mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
refactored using stuff
This commit is contained in:
@@ -28,7 +28,7 @@ namespace omath::primitives
|
|||||||
class Mesh final
|
class Mesh final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using NumericType = float;
|
using VectorType = VertType::VectorType;
|
||||||
using VertexType = VertType;
|
using VertexType = VertType;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -40,7 +40,7 @@ namespace omath::primitives
|
|||||||
Vao m_vertex_array_object;
|
Vao m_vertex_array_object;
|
||||||
|
|
||||||
Mesh(Vbo vbo, Vao vao,
|
Mesh(Vbo vbo, Vao vao,
|
||||||
const Vector3<NumericType> scale =
|
const VectorType scale =
|
||||||
{
|
{
|
||||||
1,
|
1,
|
||||||
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))
|
: m_vertex_buffer(std::move(vbo)), m_vertex_array_object(std::move(vao)), m_scale(std::move(scale))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
void set_origin(const Vector3<NumericType>& new_origin)
|
void set_origin(const VectorType& new_origin)
|
||||||
{
|
{
|
||||||
m_origin = new_origin;
|
m_origin = new_origin;
|
||||||
m_to_world_matrix = std::nullopt;
|
m_to_world_matrix = std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_scale(const Vector3<NumericType>& new_scale)
|
void set_scale(const VectorType& new_scale)
|
||||||
{
|
{
|
||||||
m_scale = new_scale;
|
m_scale = new_scale;
|
||||||
m_to_world_matrix = std::nullopt;
|
m_to_world_matrix = std::nullopt;
|
||||||
@@ -68,13 +68,13 @@ namespace omath::primitives
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
const Vector3<NumericType>& get_origin() const
|
const VectorType& get_origin() const
|
||||||
{
|
{
|
||||||
return m_origin;
|
return m_origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
const Vector3<NumericType>& get_scale() const
|
const VectorType& get_scale() const
|
||||||
{
|
{
|
||||||
return m_scale;
|
return m_scale;
|
||||||
}
|
}
|
||||||
@@ -115,8 +115,8 @@ namespace omath::primitives
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Vector3<NumericType> m_origin;
|
VectorType m_origin;
|
||||||
Vector3<NumericType> m_scale;
|
VectorType m_scale;
|
||||||
|
|
||||||
RotationAngles m_rotation_angles;
|
RotationAngles m_rotation_angles;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ namespace omath::collision
|
|||||||
class MeshCollider
|
class MeshCollider
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using NumericType = MeshType::NumericType;
|
|
||||||
|
|
||||||
using VertexType = MeshType::VertexType;
|
using VertexType = MeshType::VertexType;
|
||||||
using VectorType = VertexType::VectorType;
|
using VectorType = VertexType::VectorType;
|
||||||
|
|||||||
Reference in New Issue
Block a user