add function
This commit is contained in:
@ -22,9 +22,7 @@
|
|||||||
#include <bounce/common/math/math.h>
|
#include <bounce/common/math/math.h>
|
||||||
#include <bounce/common/template/list.h>
|
#include <bounce/common/template/list.h>
|
||||||
#include <bounce/common/template/array.h>
|
#include <bounce/common/template/array.h>
|
||||||
|
#include <bounce/dynamics/contacts/manifold.h>
|
||||||
struct b3Manifold;
|
|
||||||
struct b3WorldManifold;
|
|
||||||
|
|
||||||
class b3Shape;
|
class b3Shape;
|
||||||
class b3Body;
|
class b3Body;
|
||||||
@ -82,10 +80,16 @@ public:
|
|||||||
const b3Shape* GetShapeB() const;
|
const b3Shape* GetShapeB() const;
|
||||||
b3Shape* GetShapeB();
|
b3Shape* GetShapeB();
|
||||||
|
|
||||||
|
// Get the manifold capacity from this contact.
|
||||||
|
u32 GetManifoldCapacity() const;
|
||||||
|
|
||||||
// Get a contact manifold from this contact.
|
// Get a contact manifold from this contact.
|
||||||
const b3Manifold* GetManifold(u32 index) const;
|
const b3Manifold* GetManifold(u32 index) const;
|
||||||
b3Manifold* GetManifold(u32 index);
|
b3Manifold* GetManifold(u32 index);
|
||||||
|
|
||||||
|
// Get the number of manifolds from this contact.
|
||||||
|
u32 GetManifoldCount() const;
|
||||||
|
|
||||||
// Get a world contact manifold from this contact.
|
// Get a world contact manifold from this contact.
|
||||||
void GetWorldManifold(b3WorldManifold* out, u32 index) const;
|
void GetWorldManifold(b3WorldManifold* out, u32 index) const;
|
||||||
|
|
||||||
@ -165,6 +169,28 @@ inline const b3Shape* b3Contact::GetShapeB() const
|
|||||||
return m_pair.shapeB;
|
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
|
inline bool b3Contact::IsOverlapping() const
|
||||||
{
|
{
|
||||||
return (m_flags & e_overlapFlag) != 0;
|
return (m_flags & e_overlapFlag) != 0;
|
||||||
|
@ -17,24 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bounce/dynamics/contacts/contact.h>
|
#include <bounce/dynamics/contacts/contact.h>
|
||||||
#include <bounce/dynamics/contacts/manifold.h>
|
|
||||||
#include <bounce/dynamics/shapes/shape.h>
|
#include <bounce/dynamics/shapes/shape.h>
|
||||||
#include <bounce/dynamics/body.h>
|
#include <bounce/dynamics/body.h>
|
||||||
#include <bounce/dynamics/world.h>
|
#include <bounce/dynamics/world.h>
|
||||||
#include <bounce/dynamics/world_listeners.h>
|
#include <bounce/dynamics/world_listeners.h>
|
||||||
|
|
||||||
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
|
void b3Contact::GetWorldManifold(b3WorldManifold* out, u32 index) const
|
||||||
{
|
{
|
||||||
B3_ASSERT(index < m_manifoldCount);
|
B3_ASSERT(index < m_manifoldCount);
|
||||||
|
Reference in New Issue
Block a user