diff --git a/include/Nazara/Physics3D/Collider3D.hpp b/include/Nazara/Physics3D/Collider3D.hpp index 351508f27..52bf5e552 100644 --- a/include/Nazara/Physics3D/Collider3D.hpp +++ b/include/Nazara/Physics3D/Collider3D.hpp @@ -54,7 +54,7 @@ namespace Nz virtual float ComputeVolume() const; NewtonCollision* GetHandle(PhysWorld3D* world) const; - virtual GeomType GetType() const = 0; + virtual ColliderType3D GetType() const = 0; Collider3D& operator=(const Collider3D&) = delete; Collider3D& operator=(Collider3D&&) = delete; @@ -90,7 +90,7 @@ namespace Nz float ComputeVolume() const override; Vector3f GetLengths() const; - GeomType GetType() const override; + ColliderType3D GetType() const override; template static BoxCollider3DRef New(Args&&... args); @@ -114,7 +114,7 @@ namespace Nz float GetLength() const; float GetRadius() const; - GeomType GetType() const override; + ColliderType3D GetType() const override; template static CapsuleCollider3DRef New(Args&&... args); @@ -137,7 +137,7 @@ namespace Nz CompoundCollider3D(Collider3D** geoms, std::size_t geomCount); const std::vector& GetGeoms() const; - GeomType GetType() const override; + ColliderType3D GetType() const override; template static CompoundCollider3DRef New(Args&&... args); @@ -160,7 +160,7 @@ namespace Nz float GetLength() const; float GetRadius() const; - GeomType GetType() const override; + ColliderType3D GetType() const override; template static ConeCollider3DRef New(Args&&... args); @@ -183,7 +183,7 @@ namespace Nz ConvexCollider3D(const void* vertices, unsigned int vertexCount, unsigned int stride = sizeof(Vector3f), float tolerance = 0.002f, const Matrix4f& transformMatrix = Matrix4f::Identity()); ConvexCollider3D(const void* vertices, unsigned int vertexCount, unsigned int stride, float tolerance, const Vector3f& translation, const Quaternionf& rotation = Quaternionf::Identity()); - GeomType GetType() const override; + ColliderType3D GetType() const override; template static ConvexCollider3DRef New(Args&&... args); @@ -209,7 +209,7 @@ namespace Nz float GetLength() const; float GetRadius() const; - GeomType GetType() const override; + ColliderType3D GetType() const override; template static CylinderCollider3DRef New(Args&&... args); @@ -233,7 +233,7 @@ namespace Nz void ComputeInertialMatrix(Vector3f* inertia, Vector3f* center) const override; - GeomType GetType() const override; + ColliderType3D GetType() const override; template static NullCollider3DRef New(Args&&... args); @@ -256,7 +256,7 @@ namespace Nz float ComputeVolume() const override; float GetRadius() const; - GeomType GetType() const override; + ColliderType3D GetType() const override; template static SphereCollider3DRef New(Args&&... args); diff --git a/include/Nazara/Physics3D/Enums.hpp b/include/Nazara/Physics3D/Enums.hpp index 853f30b23..1b8920cbc 100644 --- a/include/Nazara/Physics3D/Enums.hpp +++ b/include/Nazara/Physics3D/Enums.hpp @@ -4,24 +4,27 @@ #pragma once -#ifndef NAZARA_ENUMS_PHYSICS_HPP -#define NAZARA_ENUMS_PHYSICS_HPP +#ifndef NAZARA_ENUMS_PHYSICS3D_HPP +#define NAZARA_ENUMS_PHYSICS3D_HPP -enum GeomType +namespace Nz { - GeomType_Box, - GeomType_Capsule, - GeomType_Cone, - GeomType_Compound, - GeomType_ConvexHull, - GeomType_Cylinder, - GeomType_Heightfield, - GeomType_Null, - GeomType_Scene, - GeomType_Sphere, - GeomType_Tree, + enum ColliderType3D + { + ColliderType3D_Box, + ColliderType3D_Capsule, + ColliderType3D_Cone, + ColliderType3D_Compound, + ColliderType3D_ConvexHull, + ColliderType3D_Cylinder, + ColliderType3D_Heightfield, + ColliderType3D_Null, + ColliderType3D_Scene, + ColliderType3D_Sphere, + ColliderType3D_Tree, - GeomType_Max = GeomType_Tree + ColliderType3D_Max = ColliderType3D_Tree + }; }; -#endif // NAZARA_ENUMS_PHYSICS_HPP +#endif // NAZARA_ENUMS_PHYSICS3D_HPP diff --git a/src/Nazara/Physics3D/Collider3D.cpp b/src/Nazara/Physics3D/Collider3D.cpp index 451686530..f61f64efc 100644 --- a/src/Nazara/Physics3D/Collider3D.cpp +++ b/src/Nazara/Physics3D/Collider3D.cpp @@ -193,9 +193,9 @@ namespace Nz return m_lengths; } - GeomType BoxCollider3D::GetType() const + ColliderType3D BoxCollider3D::GetType() const { - return GeomType_Box; + return ColliderType3D_Box; } NewtonCollision* BoxCollider3D::CreateHandle(PhysWorld3D* world) const @@ -227,9 +227,9 @@ namespace Nz return m_radius; } - GeomType CapsuleCollider3D::GetType() const + ColliderType3D CapsuleCollider3D::GetType() const { - return GeomType_Capsule; + return ColliderType3D_Capsule; } NewtonCollision* CapsuleCollider3D::CreateHandle(PhysWorld3D* world) const @@ -251,9 +251,9 @@ namespace Nz return m_geoms; } - GeomType CompoundCollider3D::GetType() const + ColliderType3D CompoundCollider3D::GetType() const { - return GeomType_Compound; + return ColliderType3D_Compound; } NewtonCollision* CompoundCollider3D::CreateHandle(PhysWorld3D* world) const @@ -263,7 +263,7 @@ namespace Nz NewtonCompoundCollisionBeginAddRemove(compoundCollision); for (const Collider3DRef& geom : m_geoms) { - if (geom->GetType() == GeomType_Compound) + if (geom->GetType() == ColliderType3D_Compound) { CompoundCollider3D* compoundGeom = static_cast(geom.Get()); for (const Collider3DRef& piece : compoundGeom->GetGeoms()) @@ -301,9 +301,9 @@ namespace Nz return m_radius; } - GeomType ConeCollider3D::GetType() const + ColliderType3D ConeCollider3D::GetType() const { - return GeomType_Cone; + return ColliderType3D_Cone; } NewtonCollision* ConeCollider3D::CreateHandle(PhysWorld3D* world) const @@ -335,9 +335,9 @@ namespace Nz { } - GeomType ConvexCollider3D::GetType() const + ColliderType3D ConvexCollider3D::GetType() const { - return GeomType_Compound; + return ColliderType3D_Compound; } NewtonCollision* ConvexCollider3D::CreateHandle(PhysWorld3D* world) const @@ -369,9 +369,9 @@ namespace Nz return m_radius; } - GeomType CylinderCollider3D::GetType() const + ColliderType3D CylinderCollider3D::GetType() const { - return GeomType_Cylinder; + return ColliderType3D_Cylinder; } NewtonCollision* CylinderCollider3D::CreateHandle(PhysWorld3D* world) const @@ -385,9 +385,9 @@ namespace Nz { } - GeomType NullCollider3D::GetType() const + ColliderType3D NullCollider3D::GetType() const { - return GeomType_Null; + return ColliderType3D_Null; } void NullCollider3D::ComputeInertialMatrix(Vector3f* inertia, Vector3f* center) const @@ -436,9 +436,9 @@ namespace Nz return m_radius; } - GeomType SphereCollider3D::GetType() const + ColliderType3D SphereCollider3D::GetType() const { - return GeomType_Sphere; + return ColliderType3D_Sphere; } NewtonCollision* SphereCollider3D::CreateHandle(PhysWorld3D* world) const