16#ifndef BT_PERSISTENT_MANIFOLD_H
17#define BT_PERSISTENT_MANIFOLD_H
26struct btCollisionResult;
51#define MANIFOLD_CACHE_SIZE 4
113#ifdef DEBUG_PERSISTENCY
114 void DebugPersistency();
168 if(index != lastUsedIndex)
192#define MAINTAIN_PERSISTENCY 1
193#ifdef MAINTAIN_PERSISTENCY
199 bool replacePoint =
true;
210 btScalar a = appliedLateralImpulse1 * appliedLateralImpulse1 + appliedLateralImpulse2 * appliedLateralImpulse2;
211 btScalar b = eps + mu * appliedImpulse;
213 replacePoint = (a) > (b);
@ BT_CONTACT_FLAG_FRICTION_ANCHOR
ContactEndedCallback gContactEndedCallback
void(* ContactEndedCallback)(btPersistentManifold *const &manifold)
ContactStartedCallback gContactStartedCallback
ContactProcessedCallback gContactProcessedCallback
bool(* ContactDestroyedCallback)(void *userPersistentData)
void(* ContactStartedCallback)(btPersistentManifold *const &manifold)
@ 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 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 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)
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]
rudimentary class to provide type info