diff --git a/Runtime/Collision/CCollidableAABox.cpp b/Runtime/Collision/CCollidableAABox.cpp index 77ba959e3..947553730 100644 --- a/Runtime/Collision/CCollidableAABox.cpp +++ b/Runtime/Collision/CCollidableAABox.cpp @@ -5,7 +5,7 @@ #include "CInternalRayCastStructure.hpp" namespace urde { -const CCollisionPrimitive::Type CCollidableAABox::sType(CCollidableAABox::SetStaticTableIndex, "CCollidableAABox"); +constexpr CCollisionPrimitive::Type sType(CCollidableAABox::SetStaticTableIndex, "CCollidableAABox"); u32 CCollidableAABox::sTableIndex = -1; CCollidableAABox::CCollidableAABox() = default; diff --git a/Runtime/Collision/CCollidableAABox.hpp b/Runtime/Collision/CCollidableAABox.hpp index 577d12a45..d966d7926 100644 --- a/Runtime/Collision/CCollidableAABox.hpp +++ b/Runtime/Collision/CCollidableAABox.hpp @@ -12,7 +12,6 @@ bool AABox_AABox_Bool(const CInternalCollisionStructure&); } // namespace Collide class CCollidableAABox : public CCollisionPrimitive { - static const Type sType; static u32 sTableIndex; zeus::CAABox x10_aabox; diff --git a/Runtime/Collision/CCollidableCollisionSurface.cpp b/Runtime/Collision/CCollidableCollisionSurface.cpp index 1e96be8f2..3b41ef6bb 100644 --- a/Runtime/Collision/CCollidableCollisionSurface.cpp +++ b/Runtime/Collision/CCollidableCollisionSurface.cpp @@ -1,8 +1,8 @@ #include "CCollidableCollisionSurface.hpp" namespace urde { -const CCollisionPrimitive::Type CCollidableCollisionSurface::sType(CCollidableCollisionSurface::SetStaticTableIndex, - "CCollidableCollisionSurface"); +constexpr CCollisionPrimitive::Type sType(CCollidableCollisionSurface::SetStaticTableIndex, + "CCollidableCollisionSurface"); u32 CCollidableCollisionSurface::sTableIndex = -1; const CCollisionPrimitive::Type& CCollidableCollisionSurface::GetType() { return sType; } diff --git a/Runtime/Collision/CCollidableCollisionSurface.hpp b/Runtime/Collision/CCollidableCollisionSurface.hpp index f1b70e8c6..196fb3a68 100644 --- a/Runtime/Collision/CCollidableCollisionSurface.hpp +++ b/Runtime/Collision/CCollidableCollisionSurface.hpp @@ -5,7 +5,6 @@ namespace urde { class CCollidableCollisionSurface { - static const CCollisionPrimitive::Type sType; static u32 sTableIndex; public: diff --git a/Runtime/Collision/CCollidableOBBTreeGroup.cpp b/Runtime/Collision/CCollidableOBBTreeGroup.cpp index 0bda28720..d5a187bd9 100644 --- a/Runtime/Collision/CCollidableOBBTreeGroup.cpp +++ b/Runtime/Collision/CCollidableOBBTreeGroup.cpp @@ -7,8 +7,7 @@ #include "CToken.hpp" namespace urde { -const CCollisionPrimitive::Type CCollidableOBBTreeGroup::sType(CCollidableOBBTreeGroup::SetStaticTableIndex, - "CCollidableOBBTreeGroup"); +constexpr CCollisionPrimitive::Type sType(CCollidableOBBTreeGroup::SetStaticTableIndex, "CCollidableOBBTreeGroup"); u32 CCollidableOBBTreeGroup::sTableIndex = -1; CCollidableOBBTreeGroupContainer::CCollidableOBBTreeGroupContainer(CInputStream& in) { diff --git a/Runtime/Collision/CCollidableOBBTreeGroup.hpp b/Runtime/Collision/CCollidableOBBTreeGroup.hpp index 3a1329942..9957a9a47 100644 --- a/Runtime/Collision/CCollidableOBBTreeGroup.hpp +++ b/Runtime/Collision/CCollidableOBBTreeGroup.hpp @@ -24,7 +24,6 @@ public: }; class CCollidableOBBTreeGroup : public CCollisionPrimitive { - static const Type sType; static u32 sTableIndex; const CCollidableOBBTreeGroupContainer* x10_container; diff --git a/Runtime/Collision/CCollidableSphere.cpp b/Runtime/Collision/CCollidableSphere.cpp index ebbc83a58..d027defdd 100644 --- a/Runtime/Collision/CCollidableSphere.cpp +++ b/Runtime/Collision/CCollidableSphere.cpp @@ -5,7 +5,7 @@ #include "CInternalRayCastStructure.hpp" namespace urde { -const CCollisionPrimitive::Type CCollidableSphere::sType(CCollidableSphere::SetStaticTableIndex, "CCollidableSphere"); +constexpr CCollisionPrimitive::Type sType(CCollidableSphere::SetStaticTableIndex, "CCollidableSphere"); u32 CCollidableSphere::sTableIndex = -1; namespace Collide { @@ -224,6 +224,8 @@ CRayCastResult CCollidableSphere::CastRayInternal(const CInternalRayCastStructur return {}; } +const CCollisionPrimitive::Type& CCollidableSphere::GetType() { return sType; } + bool CCollidableSphere::CollideMovingAABox(const CInternalCollisionStructure& collision, const zeus::CVector3f& dir, double& dOut, CCollisionInfo& infoOut) { const CCollidableSphere& p0 = static_cast(collision.GetLeft().GetPrim()); diff --git a/Runtime/Collision/CCollidableSphere.hpp b/Runtime/Collision/CCollidableSphere.hpp index 82021abe3..564aef075 100644 --- a/Runtime/Collision/CCollidableSphere.hpp +++ b/Runtime/Collision/CCollidableSphere.hpp @@ -12,8 +12,8 @@ bool Sphere_AABox_Bool(const CInternalCollisionStructure&); bool Sphere_Sphere(const CInternalCollisionStructure&, CCollisionInfoList&); bool Sphere_Sphere_Bool(const CInternalCollisionStructure&); } // namespace Collide + class CCollidableSphere : public CCollisionPrimitive { - static const Type sType; static u32 sTableIndex; zeus::CSphere x10_sphere; @@ -31,7 +31,7 @@ public: FourCC GetPrimType() const override; CRayCastResult CastRayInternal(const CInternalRayCastStructure&) const override; - static const Type& GetType() { return sType; } + static const Type& GetType(); static void SetStaticTableIndex(u32 index) { sTableIndex = index; } static bool CollideMovingAABox(const CInternalCollisionStructure&, const zeus::CVector3f&, double&, CCollisionInfo&); static bool CollideMovingSphere(const CInternalCollisionStructure&, const zeus::CVector3f&, double&, CCollisionInfo&);