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