Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions | Variables
btPersistentManifold.h File Reference
#include "LinearMath/btVector3.h"
#include "LinearMath/btTransform.h"
#include "btManifoldPoint.h"
#include "LinearMath/btAlignedAllocator.h"

Go to the source code of this file.

Classes

struct  btPersistentManifoldDoubleData
 
struct  btPersistentManifoldFloatData
 

Macros

#define MANIFOLD_CACHE_SIZE   4
 
#define MAINTAIN_PERSISTENCY   1
 
#define btPersistentManifoldData   btPersistentManifoldFloatData
 
#define btPersistentManifoldDataName   "btPersistentManifoldFloatData"
 

Typedefs

typedef bool(* ContactDestroyedCallback) (void *userPersistentData)
 
typedef bool(* ContactProcessedCallback) (btManifoldPoint &cp, void *body0, void *body1)
 
typedef void(* ContactStartedCallback) (btPersistentManifold *const &manifold)
 
typedef void(* ContactEndedCallback) (btPersistentManifold *const &manifold)
 

Enumerations

enum  btContactManifoldTypes { MIN_CONTACT_MANIFOLD_TYPE = 1024 , BT_PERSISTENT_MANIFOLD_TYPE }
 

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)
 
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btPersistentManifold ()
 
 btPersistentManifold (const btCollisionObject *body0, const btCollisionObject *body1, int, btScalar contactBreakingThreshold, btScalar contactProcessingThreshold)
 
SIMD_FORCE_INLINE const btCollisionObjectgetBody0 () const
 
SIMD_FORCE_INLINE const btCollisionObjectgetBody1 () const
 
void setBodies (const btCollisionObject *body0, const btCollisionObject *body1)
 
void clearUserCache (btManifoldPoint &pt)
 
SIMD_FORCE_INLINE int getNumContacts () const
 
void setNumContacts (int cachedPoints)
 the setNumContacts API is usually not used, except when you gather/fill all contacts manually More...
 
SIMD_FORCE_INLINE const btManifoldPointgetContactPoint (int index) const
 
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...
 
SIMD_FORCE_INLINE 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)
 

Variables

btScalar gContactBreakingThreshold
 maximum contact breaking and merging threshold More...
 
ContactDestroyedCallback gContactDestroyedCallback
 
ContactProcessedCallback gContactProcessedCallback
 
ContactStartedCallback gContactStartedCallback
 
ContactEndedCallback gContactEndedCallback
 
btPersistentManifold __pad0__
 
const btCollisionObjectm_body0
 this two body pointers can point to the physics rigidbody class. More...
 
const btCollisionObjectm_body1
 
int m_cachedPoints
 
btScalar m_contactBreakingThreshold
 
btScalar m_contactProcessingThreshold
 
int m_companionIdA
 
int m_companionIdB
 
int m_index1a
 

Macro Definition Documentation

◆ btPersistentManifoldData

#define btPersistentManifoldData   btPersistentManifoldFloatData

Definition at line 370 of file btPersistentManifold.h.

◆ btPersistentManifoldDataName

#define btPersistentManifoldDataName   "btPersistentManifoldFloatData"

Definition at line 371 of file btPersistentManifold.h.

◆ MAINTAIN_PERSISTENCY

#define MAINTAIN_PERSISTENCY   1

◆ MANIFOLD_CACHE_SIZE

#define MANIFOLD_CACHE_SIZE   4

Definition at line 52 of file btPersistentManifold.h.

Typedef Documentation

◆ ContactDestroyedCallback

typedef bool(* ContactDestroyedCallback) (void *userPersistentData)

Definition at line 35 of file btPersistentManifold.h.

◆ ContactEndedCallback

typedef void(* ContactEndedCallback) (btPersistentManifold *const &manifold)

Definition at line 38 of file btPersistentManifold.h.

◆ ContactProcessedCallback

typedef bool(* ContactProcessedCallback) (btManifoldPoint &cp, void *body0, void *body1)

Definition at line 36 of file btPersistentManifold.h.

◆ ContactStartedCallback

typedef void(* ContactStartedCallback) (btPersistentManifold *const &manifold)

Definition at line 37 of file btPersistentManifold.h.

Enumeration Type Documentation

◆ btContactManifoldTypes

Enumerator
MIN_CONTACT_MANIFOLD_TYPE 
BT_PERSISTENT_MANIFOLD_TYPE 

Definition at line 46 of file btPersistentManifold.h.

Function Documentation

◆ addManifoldPoint()

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

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ btPersistentManifold() [1/2]

btPersistentManifold::btPersistentManifold ( )

◆ btPersistentManifold() [2/2]

btPersistentManifold ( const btCollisionObject body0,
const btCollisionObject body1,
int  ,
btScalar  contactBreakingThreshold,
btScalar  contactProcessingThreshold 
)

Definition at line 92 of file btPersistentManifold.h.

◆ calculateSerializeBufferSize()

int calculateSerializeBufferSize ( ) const

◆ clearManifold()

SIMD_FORCE_INLINE void clearManifold ( )

Definition at line 248 of file btPersistentManifold.h.

References clearUserCache(), gContactEndedCallback, and m_cachedPoints.

◆ clearUserCache()

void btPersistentManifold::clearUserCache ( btManifoldPoint pt)

◆ deSerialize() [1/2]

void deSerialize ( const struct btPersistentManifoldDoubleData manifoldDataPtr)

◆ deSerialize() [2/2]

void deSerialize ( const struct btPersistentManifoldFloatData manifoldDataPtr)

◆ findContactPoint()

int findContactPoint ( const btManifoldPoint unUsed,
int  numUnused,
const btManifoldPoint pt 
)

◆ getBody0()

SIMD_FORCE_INLINE const btCollisionObject* getBody0 ( ) const

Definition at line 105 of file btPersistentManifold.h.

References m_body0.

◆ getBody1()

SIMD_FORCE_INLINE const btCollisionObject* getBody1 ( ) const

Definition at line 106 of file btPersistentManifold.h.

References m_body1.

◆ getCacheEntry()

int btPersistentManifold::getCacheEntry ( const btManifoldPoint newPoint) const

◆ getContactBreakingThreshold()

btScalar btPersistentManifold::getContactBreakingThreshold ( ) const
Todo:
: get this margin from the current physics / collision environment

Definition at line 242 of file btPersistentManifold.cpp.

References m_contactBreakingThreshold.

Referenced by validContactDistance().

◆ getContactPoint()

SIMD_FORCE_INLINE btManifoldPoint & getContactPoint ( int  index) const

Definition at line 130 of file btPersistentManifold.h.

References btAssert, and m_cachedPoints.

◆ getContactProcessingThreshold()

btScalar getContactProcessingThreshold ( ) const

Definition at line 145 of file btPersistentManifold.h.

References m_contactProcessingThreshold.

◆ getNumContacts()

SIMD_FORCE_INLINE int getNumContacts ( ) const

◆ refreshContactPoints()

void refreshContactPoints ( const btTransform trA,
const btTransform trB 
)

calculated new worldspace coordinates and depth, and reject points that exceed the collision margin

◆ removeContactPoint()

void removeContactPoint ( int  index)

◆ replaceContactPoint()

void replaceContactPoint ( const btManifoldPoint newPoint,
int  insertIndex 
)

◆ serialize()

const char* serialize ( const class btPersistentManifold manifold,
void dataBuffer,
class btSerializer serializer 
) const

◆ setBodies()

void setBodies ( const btCollisionObject body0,
const btCollisionObject body1 
)

Definition at line 108 of file btPersistentManifold.h.

References m_body0, and m_body1.

◆ setContactBreakingThreshold()

void setContactBreakingThreshold ( btScalar  contactBreakingThreshold)

Definition at line 150 of file btPersistentManifold.h.

References m_contactBreakingThreshold.

◆ setContactProcessingThreshold()

void setContactProcessingThreshold ( btScalar  contactProcessingThreshold)

Definition at line 155 of file btPersistentManifold.h.

References m_contactProcessingThreshold.

◆ setNumContacts()

void setNumContacts ( int  cachedPoints)

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

Definition at line 125 of file btPersistentManifold.h.

References m_cachedPoints.

◆ sortCachedPoints()

int btPersistentManifold::sortCachedPoints ( const btManifoldPoint pt)

◆ validContactDistance()

bool validContactDistance ( const btManifoldPoint pt) const

Variable Documentation

◆ __pad0__

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

◆ gContactBreakingThreshold

btScalar gContactBreakingThreshold
extern

maximum contact breaking and merging threshold

Definition at line 26 of file btPersistentManifold.cpp.

◆ gContactDestroyedCallback

ContactDestroyedCallback gContactDestroyedCallback
extern

Definition at line 27 of file btPersistentManifold.cpp.

Referenced by clearUserCache().

◆ gContactEndedCallback

ContactEndedCallback gContactEndedCallback
extern

Definition at line 30 of file btPersistentManifold.cpp.

Referenced by clearManifold(), and removeContactPoint().

◆ gContactProcessedCallback

ContactProcessedCallback gContactProcessedCallback
extern

Definition at line 28 of file btPersistentManifold.cpp.

◆ gContactStartedCallback

ContactStartedCallback gContactStartedCallback
extern

Definition at line 29 of file btPersistentManifold.cpp.

Referenced by btManifoldResult::addContactPoint().

◆ m_body0

const btCollisionObject* m_body0

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

Definition at line 69 of file btPersistentManifold.h.

Referenced by getBody0(), and setBodies().

◆ m_body1

const btCollisionObject* m_body1

Definition at line 70 of file btPersistentManifold.h.

Referenced by getBody1(), and setBodies().

◆ m_cachedPoints

int m_cachedPoints

◆ m_companionIdA

int m_companionIdA

Definition at line 85 of file btPersistentManifold.h.

◆ m_companionIdB

int m_companionIdB

Definition at line 86 of file btPersistentManifold.h.

◆ m_contactBreakingThreshold

btScalar m_contactBreakingThreshold

◆ m_contactProcessingThreshold

btScalar m_contactProcessingThreshold

◆ m_index1a

int m_index1a

Definition at line 88 of file btPersistentManifold.h.