diff --git a/include/bounce/dynamics/contacts/contact.h b/include/bounce/dynamics/contacts/contact.h index 283301f..3988f38 100644 --- a/include/bounce/dynamics/contacts/contact.h +++ b/include/bounce/dynamics/contacts/contact.h @@ -22,9 +22,7 @@ #include #include #include - -struct b3Manifold; -struct b3WorldManifold; +#include class b3Shape; class b3Body; @@ -82,10 +80,16 @@ public: const b3Shape* GetShapeB() const; b3Shape* GetShapeB(); + // Get the manifold capacity from this contact. + u32 GetManifoldCapacity() const; + // Get a contact manifold from this contact. const b3Manifold* GetManifold(u32 index) const; b3Manifold* GetManifold(u32 index); + // Get the number of manifolds from this contact. + u32 GetManifoldCount() const; + // Get a world contact manifold from this contact. void GetWorldManifold(b3WorldManifold* out, u32 index) const; @@ -165,6 +169,28 @@ inline const b3Shape* b3Contact::GetShapeB() const return m_pair.shapeB; } +inline u32 b3Contact::GetManifoldCapacity() const +{ + return m_manifoldCapacity; +} + +inline const b3Manifold* b3Contact::GetManifold(u32 index) const +{ + B3_ASSERT(index < m_manifoldCount); + return m_manifolds + index; +} + +inline b3Manifold* b3Contact::GetManifold(u32 index) +{ + B3_ASSERT(index < m_manifoldCount); + return m_manifolds + index; +} + +inline u32 b3Contact::GetManifoldCount() const +{ + return m_manifoldCount; +} + inline bool b3Contact::IsOverlapping() const { return (m_flags & e_overlapFlag) != 0; diff --git a/src/bounce/dynamics/contacts/contact.cpp b/src/bounce/dynamics/contacts/contact.cpp index 5968963..c25f1dc 100644 --- a/src/bounce/dynamics/contacts/contact.cpp +++ b/src/bounce/dynamics/contacts/contact.cpp @@ -17,24 +17,11 @@ */ #include -#include #include #include #include #include -const b3Manifold* b3Contact::GetManifold(u32 index) const -{ - B3_ASSERT(index < m_manifoldCount); - return m_manifolds + index; -} - -b3Manifold* b3Contact::GetManifold(u32 index) -{ - B3_ASSERT(index < m_manifoldCount); - return m_manifolds + index; -} - void b3Contact::GetWorldManifold(b3WorldManifold* out, u32 index) const { B3_ASSERT(index < m_manifoldCount);