16#ifndef BT_PERSISTENT_MANIFOLD_H
17#define BT_PERSISTENT_MANIFOLD_H
25struct btCollisionResult;
52#define MANIFOLD_CACHE_SIZE 4
116#ifdef DEBUG_PERSISTENCY
117 void DebugPersistency();
170 if (index != lastUsedIndex)
195#define MAINTAIN_PERSISTENCY 1
196#ifdef MAINTAIN_PERSISTENCY
203 bool replacePoint =
true;
214 btScalar a = appliedLateralImpulse1 * appliedLateralImpulse1 + appliedLateralImpulse2 * appliedLateralImpulse2;
217 replacePoint = (a) > (b);
366#ifdef BT_USE_DOUBLE_PRECISION
367#define btPersistentManifoldData btPersistentManifoldDoubleData
368#define btPersistentManifoldDataName "btPersistentManifoldDoubleData"
370#define btPersistentManifoldData btPersistentManifoldFloatData
371#define btPersistentManifoldDataName "btPersistentManifoldFloatData"
@ BT_CONTACT_FLAG_FRICTION_ANCHOR
void(* ContactEndedCallback)(btPersistentManifold *const &manifold)
ContactEndedCallback gContactEndedCallback
ContactStartedCallback gContactStartedCallback
void(* ContactStartedCallback)(btPersistentManifold *const &manifold)
ContactProcessedCallback gContactProcessedCallback
bool(* ContactDestroyedCallback)(void *userPersistentData)
@ MIN_CONTACT_MANIFOLD_TYPE
@ BT_PERSISTENT_MANIFOLD_TYPE
ContactDestroyedCallback gContactDestroyedCallback
#define MANIFOLD_CACHE_SIZE
btScalar gContactBreakingThreshold
maximum contact breaking and merging threshold
bool(* ContactProcessedCallback)(btManifoldPoint &cp, void *body0, void *body1)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
#define SIMD_FORCE_INLINE
btCollisionObject can be used to manage collision detection objects.
ManifoldContactPoint collects and maintains persistent contactpoints.
btScalar m_appliedImpulseLateral2
btScalar m_appliedImpulse
void * m_userPersistentData
btScalar m_appliedImpulseLateral1
btScalar m_combinedFriction
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
const btCollisionObject * m_body1
btScalar m_contactBreakingThreshold
const btManifoldPoint & getContactPoint(int index) const
bool validContactDistance(const btManifoldPoint &pt) const
const char * serialize(const class btPersistentManifold *manifold, void *dataBuffer, class btSerializer *serializer) const
const btCollisionObject * getBody0() const
int getCacheEntry(const btManifoldPoint &newPoint) const
void replaceContactPoint(const btManifoldPoint &newPoint, int insertIndex)
void setContactBreakingThreshold(btScalar contactBreakingThreshold)
btManifoldPoint & getContactPoint(int index)
void refreshContactPoints(const btTransform &trA, const btTransform &trB)
calculated new worldspace coordinates and depth, and reject points that exceed the collision margin
int calculateSerializeBufferSize() const
int sortCachedPoints(const btManifoldPoint &pt)
sort cached points so most isolated points come first
void setBodies(const btCollisionObject *body0, const btCollisionObject *body1)
int findContactPoint(const btManifoldPoint *unUsed, int numUnused, const btManifoldPoint &pt)
const btCollisionObject * getBody1() const
btScalar m_contactProcessingThreshold
BT_DECLARE_ALIGNED_ALLOCATOR()
void clearUserCache(btManifoldPoint &pt)
void removeContactPoint(int index)
void deSerialize(const struct btPersistentManifoldDoubleData *manifoldDataPtr)
int getNumContacts() const
void setNumContacts(int cachedPoints)
the setNumContacts API is usually not used, except when you gather/fill all contacts manually
int addManifoldPoint(const btManifoldPoint &newPoint, bool isPredictive=false)
btScalar getContactBreakingThreshold() const
btScalar getContactProcessingThreshold() const
void setContactProcessingThreshold(btScalar contactProcessingThreshold)
btPersistentManifold(const btCollisionObject *body0, const btCollisionObject *body1, int, btScalar contactBreakingThreshold, btScalar contactProcessingThreshold)
const btCollisionObject * m_body0
this two body pointers can point to the physics rigidbody class.
btManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE]
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
double m_pointCachePrevRHS[4]
int m_pointCachePartId0[4]
btVector3DoubleData m_pointCacheLateralFrictionDir1[4]
btVector3DoubleData m_pointCachePositionWorldOnB[4]
double m_contactProcessingThreshold
double m_pointCacheCombinedRollingFriction[4]
double m_contactBreakingThreshold
int m_pointCacheContactPointFlags[4]
double m_pointCacheDistance[4]
int m_pointCacheLifeTime[4]
btVector3DoubleData m_pointCacheLocalPointB[4]
double m_pointCacheAppliedImpulseLateral2[4]
double m_pointCacheCombinedContactDamping1[4]
btVector3DoubleData m_pointCachePositionWorldOnA[4]
double m_pointCacheAppliedImpulseLateral1[4]
double m_pointCacheContactMotion2[4]
double m_pointCacheCombinedContactStiffness1[4]
int m_pointCacheIndex0[4]
double m_pointCacheContactERP[4]
double m_pointCacheContactMotion1[4]
btVector3DoubleData m_pointCacheNormalWorldOnB[4]
btCollisionObjectDoubleData * m_body0
double m_pointCacheContactCFM[4]
btCollisionObjectDoubleData * m_body1
btVector3DoubleData m_pointCacheLateralFrictionDir2[4]
double m_pointCacheAppliedImpulse[4]
int m_pointCachePartId1[4]
double m_pointCacheCombinedRestitution[4]
double m_pointCacheFrictionCFM[4]
double m_pointCacheCombinedSpinningFriction[4]
int m_pointCacheIndex1[4]
double m_pointCacheCombinedFriction[4]
btVector3DoubleData m_pointCacheLocalPointA[4]
btCollisionObjectFloatData * m_body1
int m_pointCachePartId0[4]
float m_pointCacheDistance[4]
float m_pointCacheAppliedImpulse[4]
float m_pointCacheAppliedImpulseLateral1[4]
btVector3FloatData m_pointCacheNormalWorldOnB[4]
float m_pointCacheContactERP[4]
int m_pointCacheIndex0[4]
int m_pointCacheLifeTime[4]
float m_pointCacheCombinedContactDamping1[4]
float m_pointCacheContactMotion2[4]
float m_pointCacheCombinedFriction[4]
btVector3FloatData m_pointCacheLocalPointB[4]
float m_contactBreakingThreshold
float m_pointCacheCombinedContactStiffness1[4]
float m_pointCacheFrictionCFM[4]
int m_pointCacheIndex1[4]
float m_pointCacheContactMotion1[4]
int m_pointCacheContactPointFlags[4]
btCollisionObjectFloatData * m_body0
float m_pointCacheCombinedRollingFriction[4]
float m_pointCacheAppliedImpulseLateral2[4]
btVector3FloatData m_pointCachePositionWorldOnB[4]
float m_pointCachePrevRHS[4]
float m_pointCacheCombinedRestitution[4]
float m_pointCacheContactCFM[4]
btVector3FloatData m_pointCacheLocalPointA[4]
float m_pointCacheCombinedSpinningFriction[4]
btVector3FloatData m_pointCachePositionWorldOnA[4]
btVector3FloatData m_pointCacheLateralFrictionDir1[4]
float m_contactProcessingThreshold
int m_pointCachePartId1[4]
btVector3FloatData m_pointCacheLateralFrictionDir2[4]
rudimentary class to provide type info