Merge pull request #105 from lioncash/collision

CCollisionPrimitive: Minor cleanup
This commit is contained in:
Phillip Stephens 2019-10-12 07:29:04 -07:00 committed by GitHub
commit 6996ebfbec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -8,7 +8,7 @@ namespace urde {
const CCollisionPrimitive::Type CCollidableAABox::sType(CCollidableAABox::SetStaticTableIndex, "CCollidableAABox");
u32 CCollidableAABox::sTableIndex = -1;
CCollidableAABox::CCollidableAABox() {}
CCollidableAABox::CCollidableAABox() = default;
CCollidableAABox::CCollidableAABox(const zeus::CAABox& aabox, const CMaterialList& list)
: CCollisionPrimitive(list), x10_aabox(aabox) {}

View File

@ -44,11 +44,12 @@ class COBBTree;
class CCollisionInfo;
class CCollisionInfoList;
class CInternalRayCastStructure;
typedef bool (*ComparisonFunc)(const CInternalCollisionStructure&, CCollisionInfoList&);
typedef bool (*MovingComparisonFunc)(const CInternalCollisionStructure&, const zeus::CVector3f&, double&,
CCollisionInfo&);
typedef bool (*BooleanComparisonFunc)(const CInternalCollisionStructure&);
typedef void (*PrimitiveSetter)(u32);
using BooleanComparisonFunc = bool (*)(const CInternalCollisionStructure&);
using ComparisonFunc = bool (*)(const CInternalCollisionStructure&, CCollisionInfoList&);
using MovingComparisonFunc = bool (*)(const CInternalCollisionStructure&, const zeus::CVector3f&, double&,
CCollisionInfo&);
using PrimitiveSetter = void (*)(u32);
class CCollisionPrimitive {
public:
@ -136,7 +137,7 @@ public:
virtual zeus::CAABox CalculateAABox(const zeus::CTransform&) const = 0;
virtual zeus::CAABox CalculateLocalAABox() const = 0;
virtual FourCC GetPrimType() const = 0;
virtual ~CCollisionPrimitive() {}
virtual ~CCollisionPrimitive() = default;
virtual CRayCastResult CastRayInternal(const CInternalRayCastStructure&) const = 0;
CRayCastResult CastRay(const zeus::CVector3f& start, const zeus::CVector3f& dir, float length,
const CMaterialFilter& filter, const zeus::CTransform& xf) const;