Bullet Collision Detection & Physics Library: btPersistentManifold Class Reference

Bullet Collision Detection & Physics Library

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
btPersistentManifold Class Reference

btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping in the broadphase. More...

`#include <btPersistentManifold.h>`

Inheritance diagram for btPersistentManifold:
[legend]
Collaboration diagram for btPersistentManifold:
[legend]

## 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 ()
Public Member Functions inherited from btTypedObject
| btTypedObject (int objectType)
int | getObjectType () const

## Public Attributes
int | m_companionIdA
int | m_companionIdB
int | m_index1a
Public Attributes inherited from btTypedObject
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

## Detailed Description

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 55 of file btPersistentManifold.h.

## Constructor & Destructor Documentation

## § btPersistentManifold() [1/2]

btPersistentManifold::btPersistentManifold | ( |  | ) |

Definition at line 29 of file btPersistentManifold.cpp.

## § btPersistentManifold() [2/2]

btPersistentManifold::btPersistentManifold | ( | const btCollisionObject * | body0,
|  | const btCollisionObject * | body1,
|  | int | ,
|  | btScalar | contactBreakingThreshold,
|  | btScalar | contactProcessingThreshold
| ) |  |
| inline

Definition at line 86 of file btPersistentManifold.h.

## Member Function Documentation

## § addManifoldPoint()

int btPersistentManifold::addManifoldPoint | ( | const btManifoldPoint & | newPoint,
|  | bool | isPredictive = `false`
| ) |  |

Definition at line 208 of file btPersistentManifold.cpp.

## § BT_DECLARE_ALIGNED_ALLOCATOR()

btPersistentManifold::BT_DECLARE_ALIGNED_ALLOCATOR | ( |  | ) |

## § clearManifold()

void btPersistentManifold::clearManifold | ( |  | ) |
| inline

Definition at line 216 of file btPersistentManifold.h.

## § clearUserCache()

void btPersistentManifold::clearUserCache | ( | btManifoldPoint & | pt | ) |

Definition at line 54 of file btPersistentManifold.cpp.

## § findContactPoint()

int btPersistentManifold::findContactPoint | ( | const btManifoldPoint * | unUsed,
|  | int | numUnused,
|  | const btManifoldPoint & | pt
| ) |  |
| private

## § getBody0()

const btCollisionObject* btPersistentManifold::getBody0 | ( |  | ) | const
| inline

Definition at line 94 of file btPersistentManifold.h.

## § getBody1()

const btCollisionObject* btPersistentManifold::getBody1 | ( |  | ) | const
| inline

Definition at line 95 of file btPersistentManifold.h.

## § getCacheEntry()

int btPersistentManifold::getCacheEntry | ( | const btManifoldPoint & | newPoint | ) | const

Definition at line 188 of file btPersistentManifold.cpp.

## § getContactBreakingThreshold()

btScalar btPersistentManifold::getContactBreakingThreshold | ( |  | ) | const

Definition at line 240 of file btPersistentManifold.cpp.

## § getContactPoint() [1/2]

const btManifoldPoint& btPersistentManifold::getContactPoint | ( | int | index | ) | const
| inline

Definition at line 117 of file btPersistentManifold.h.

## § getContactPoint() [2/2]

btManifoldPoint& btPersistentManifold::getContactPoint | ( | int | index | ) |
| inline

Definition at line 123 of file btPersistentManifold.h.

## § getContactProcessingThreshold()

btScalar btPersistentManifold::getContactProcessingThreshold | ( |  | ) | const
| inline

Definition at line 132 of file btPersistentManifold.h.

## § getNumContacts()

int btPersistentManifold::getNumContacts | ( |  | ) | const
| inline

Definition at line 109 of file btPersistentManifold.h.

## § refreshContactPoints()

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 247 of file btPersistentManifold.cpp.

## § removeContactPoint()

void btPersistentManifold::removeContactPoint | ( | int | index | ) |
| inline

Definition at line 154 of file btPersistentManifold.h.

## § replaceContactPoint()

void btPersistentManifold::replaceContactPoint | ( | const btManifoldPoint & | newPoint,
|  | int | insertIndex
| ) |  |
| inline

Definition at line 175 of file btPersistentManifold.h.

## § setBodies()

void btPersistentManifold::setBodies | ( | const btCollisionObject * | body0,
|  | const btCollisionObject * | body1
| ) |  |
| inline

Definition at line 97 of file btPersistentManifold.h.

## § setContactBreakingThreshold()

void btPersistentManifold::setContactBreakingThreshold | ( | btScalar | contactBreakingThreshold | ) |
| inline

Definition at line 137 of file btPersistentManifold.h.

## § setContactProcessingThreshold()

void btPersistentManifold::setContactProcessingThreshold | ( | btScalar | contactProcessingThreshold | ) |
| inline

Definition at line 142 of file btPersistentManifold.h.

## § setNumContacts()

void btPersistentManifold::setNumContacts | ( | int | cachedPoints | ) |
| inline

the setNumContacts API is usually not used, except when you gather/fill all contacts manually

Definition at line 111 of file btPersistentManifold.h.

## § sortCachedPoints()

int btPersistentManifold::sortCachedPoints | ( | const btManifoldPoint & | pt | ) |
| private

sort cached points so most isolated points come first

Definition at line 109 of file btPersistentManifold.cpp.

## § validContactDistance()

bool btPersistentManifold::validContactDistance | ( | const btManifoldPoint & | pt | ) | const
| inline

Definition at line 208 of file btPersistentManifold.h.

## Member Data Documentation

## § m_body0

const btCollisionObject* btPersistentManifold::m_body0
| private

this two body pointers can point to the physics rigidbody class.

Definition at line 61 of file btPersistentManifold.h.

## § m_body1

const btCollisionObject* btPersistentManifold::m_body1
| private

Definition at line 62 of file btPersistentManifold.h.

## § m_cachedPoints

int btPersistentManifold::m_cachedPoints
| private

Definition at line 64 of file btPersistentManifold.h.

## § m_companionIdA

int btPersistentManifold::m_companionIdA

Definition at line 79 of file btPersistentManifold.h.

## § m_companionIdB

int btPersistentManifold::m_companionIdB

Definition at line 80 of file btPersistentManifold.h.

## § m_contactBreakingThreshold

btScalar btPersistentManifold::m_contactBreakingThreshold
| private

Definition at line 66 of file btPersistentManifold.h.

## § m_contactProcessingThreshold

btScalar btPersistentManifold::m_contactProcessingThreshold
| private

Definition at line 67 of file btPersistentManifold.h.

## § m_index1a

int btPersistentManifold::m_index1a

Definition at line 82 of file btPersistentManifold.h.

## § m_pointCache

btManifoldPoint btPersistentManifold::m_pointCache[MANIFOLD_CACHE_SIZE]
| private

Definition at line 58 of file btPersistentManifold.h.

The documentation for this class was generated from the following files:

- btPersistentManifold.h
- btPersistentManifold.cpp