Bullet Collision Detection & Physics Library
|
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping in the broadphase. More...
#include <btPersistentManifold.h>
Public Member Functions | |
BT_DECLARE_ALIGNED_ALLOCATOR () | |
btPersistentManifold () | |
btPersistentManifold (const btCollisionObject *body0, const btCollisionObject *body1, int, btScalar contactBreakingThreshold, btScalar contactProcessingThreshold) | |
const btCollisionObject * | getBody0 () const |
const btCollisionObject * | getBody1 () const |
void | setBodies (const btCollisionObject *body0, const btCollisionObject *body1) |
void | clearUserCache (btManifoldPoint &pt) |
int | getNumContacts () const |
void | setNumContacts (int cachedPoints) |
the setNumContacts API is usually not used, except when you gather/fill all contacts manually More... | |
const btManifoldPoint & | getContactPoint (int index) const |
btManifoldPoint & | getContactPoint (int index) |
btScalar | getContactBreakingThreshold () const |
btScalar | getContactProcessingThreshold () const |
void | setContactBreakingThreshold (btScalar contactBreakingThreshold) |
void | setContactProcessingThreshold (btScalar contactProcessingThreshold) |
int | getCacheEntry (const btManifoldPoint &newPoint) const |
int | addManifoldPoint (const btManifoldPoint &newPoint, bool isPredictive=false) |
void | removeContactPoint (int index) |
void | replaceContactPoint (const btManifoldPoint &newPoint, int insertIndex) |
bool | validContactDistance (const btManifoldPoint &pt) const |
void | refreshContactPoints (const btTransform &trA, const btTransform &trB) |
calculated new worldspace coordinates and depth, and reject points that exceed the collision margin More... | |
void | clearManifold () |
int | calculateSerializeBufferSize () const |
const char * | serialize (const class btPersistentManifold *manifold, void *dataBuffer, class btSerializer *serializer) const |
void | deSerialize (const struct btPersistentManifoldDoubleData *manifoldDataPtr) |
void | deSerialize (const struct btPersistentManifoldFloatData *manifoldDataPtr) |
![]() | |
btTypedObject (int objectType) | |
int | getObjectType () const |
Public Attributes | |
int | m_companionIdA |
int | m_companionIdB |
int | m_index1a |
![]() | |
int | m_objectType |
Private Member Functions | |
int | sortCachedPoints (const btManifoldPoint &pt) |
sort cached points so most isolated points come first More... | |
int | findContactPoint (const btManifoldPoint *unUsed, int numUnused, const btManifoldPoint &pt) |
Private Attributes | |
btManifoldPoint | m_pointCache [MANIFOLD_CACHE_SIZE] |
const btCollisionObject * | m_body0 |
this two body pointers can point to the physics rigidbody class. More... | |
const btCollisionObject * | m_body1 |
int | m_cachedPoints |
btScalar | m_contactBreakingThreshold |
btScalar | m_contactProcessingThreshold |
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping in the broadphase.
Those contact points are created by the collision narrow phase. The cache can be empty, or hold 1,2,3 or 4 points. Some collision algorithms (GJK) might only add one point at a time. updates/refreshes old contact points, and throw them away if necessary (distance becomes too large) reduces the cache to 4 points, when more then 4 points are added, using following rules: the contact point with deepest penetration is always kept, and it tries to maximuze the area covered by the points note that some pairs of objects might have more then one contact manifold.
Definition at line 65 of file btPersistentManifold.h.
btPersistentManifold::btPersistentManifold | ( | ) |
Definition at line 37 of file btPersistentManifold.cpp.
|
inline |
Definition at line 96 of file btPersistentManifold.h.
int btPersistentManifold::addManifoldPoint | ( | const btManifoldPoint & | newPoint, |
bool | isPredictive = false |
||
) |
Definition at line 218 of file btPersistentManifold.cpp.
btPersistentManifold::BT_DECLARE_ALIGNED_ALLOCATOR | ( | ) |
int btPersistentManifold::calculateSerializeBufferSize | ( | ) | const |
Definition at line 314 of file btPersistentManifold.cpp.
|
inline |
Definition at line 249 of file btPersistentManifold.h.
void btPersistentManifold::clearUserCache | ( | btManifoldPoint & | pt | ) |
Definition at line 64 of file btPersistentManifold.cpp.
void btPersistentManifold::deSerialize | ( | const struct btPersistentManifoldDoubleData * | manifoldDataPtr | ) |
Definition at line 369 of file btPersistentManifold.cpp.
void btPersistentManifold::deSerialize | ( | const struct btPersistentManifoldFloatData * | manifoldDataPtr | ) |
Definition at line 415 of file btPersistentManifold.cpp.
|
private |
|
inline |
Definition at line 107 of file btPersistentManifold.h.
|
inline |
Definition at line 108 of file btPersistentManifold.h.
int btPersistentManifold::getCacheEntry | ( | const btManifoldPoint & | newPoint | ) | const |
Definition at line 198 of file btPersistentManifold.cpp.
btScalar btPersistentManifold::getContactBreakingThreshold | ( | ) | const |
Definition at line 250 of file btPersistentManifold.cpp.
|
inline |
Definition at line 130 of file btPersistentManifold.h.
|
inline |
Definition at line 136 of file btPersistentManifold.h.
|
inline |
Definition at line 145 of file btPersistentManifold.h.
|
inline |
Definition at line 122 of file btPersistentManifold.h.
void btPersistentManifold::refreshContactPoints | ( | const btTransform & | trA, |
const btTransform & | trB | ||
) |
calculated new worldspace coordinates and depth, and reject points that exceed the collision margin
first refresh worldspace positions and distance
then
Definition at line 257 of file btPersistentManifold.cpp.
|
inline |
Definition at line 167 of file btPersistentManifold.h.
|
inline |
we keep existing contact points for friction anchors if the friction force is within the Coulomb friction cone
Definition at line 193 of file btPersistentManifold.h.
const char * btPersistentManifold::serialize | ( | const class btPersistentManifold * | manifold, |
void * | dataBuffer, | ||
class btSerializer * | serializer | ||
) | const |
Definition at line 319 of file btPersistentManifold.cpp.
|
inline |
Definition at line 110 of file btPersistentManifold.h.
|
inline |
Definition at line 150 of file btPersistentManifold.h.
|
inline |
Definition at line 155 of file btPersistentManifold.h.
|
inline |
the setNumContacts API is usually not used, except when you gather/fill all contacts manually
Definition at line 124 of file btPersistentManifold.h.
|
private |
sort cached points so most isolated points come first
Definition at line 119 of file btPersistentManifold.cpp.
|
inline |
Definition at line 241 of file btPersistentManifold.h.
|
private |
this two body pointers can point to the physics rigidbody class.
Definition at line 71 of file btPersistentManifold.h.
|
private |
Definition at line 72 of file btPersistentManifold.h.
|
private |
Definition at line 74 of file btPersistentManifold.h.
int btPersistentManifold::m_companionIdA |
Definition at line 89 of file btPersistentManifold.h.
int btPersistentManifold::m_companionIdB |
Definition at line 90 of file btPersistentManifold.h.
|
private |
Definition at line 76 of file btPersistentManifold.h.
|
private |
Definition at line 77 of file btPersistentManifold.h.
int btPersistentManifold::m_index1a |
Definition at line 92 of file btPersistentManifold.h.
|
private |
Definition at line 68 of file btPersistentManifold.h.