43#ifdef DEBUG_PERSISTENCY
45void btPersistentManifold::DebugPersistency()
51 printf(
"m_pointCache[%d].m_userPersistentData = %x\n",i,
m_pointCache[i].m_userPersistentData);
59 void* oldPtr =
pt.m_userPersistentData;
62#ifdef DEBUG_PERSISTENCY
71 printf(
"error in clearUserCache\n");
79 (*gContactDestroyedCallback)(
pt.m_userPersistentData);
80 pt.m_userPersistentData = 0;
83#ifdef DEBUG_PERSISTENCY
117#define KEEP_DEEPEST_POINT 1
118#ifdef KEEP_DEEPEST_POINT
120 for (
int i=0;i<4;i++)
195 for(
int i = 0; i <
size; i++ )
220#if MANIFOLD_CACHE_SIZE >= 4
252#ifdef DEBUG_PERSISTENCY
253 printf(
"refreshContactPoints posA = (%f,%f,%f) posB = (%f,%f,%f)\n",
254 trA.getOrigin().getX(),
255 trA.getOrigin().getY(),
256 trA.getOrigin().getZ(),
257 trB.getOrigin().getX(),
258 trB.getOrigin().getY(),
259 trB.getOrigin().getZ());
262 for (i=getNumContacts()-1;i>=0;i--)
300#ifdef DEBUG_PERSISTENCY
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const T & btMax(const T &a, const T &b)
bool gContactCalcArea3Points
gContactCalcArea3Points will approximate the convex hull area using 3 points when setting it to false...
ContactEndedCallback gContactEndedCallback
static btScalar calcArea4Points(const btVector3 &p0, const btVector3 &p1, const btVector3 &p2, const btVector3 &p3)
ContactStartedCallback gContactStartedCallback
ContactProcessedCallback gContactProcessedCallback
ContactDestroyedCallback gContactDestroyedCallback
btScalar gContactBreakingThreshold
maximum contact breaking and merging threshold
void(* ContactEndedCallback)(btPersistentManifold *const &manifold)
ContactProcessedCallback gContactProcessedCallback
bool(* ContactDestroyedCallback)(void *userPersistentData)
void(* ContactStartedCallback)(btPersistentManifold *const &manifold)
@ BT_PERSISTENT_MANIFOLD_TYPE
ContactDestroyedCallback gContactDestroyedCallback
#define MANIFOLD_CACHE_SIZE
bool(* ContactProcessedCallback)(btManifoldPoint &cp, void *body0, void *body1)
btScalar dot(const btQuaternion &q1, const btQuaternion &q2)
Calculate the dot product between two quaternions.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
ManifoldContactPoint collects and maintains persistent contactpoints.
btScalar getDistance() const
btVector3 m_positionWorldOnA
m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity
const btCollisionObject * m_body1
btScalar m_contactBreakingThreshold
bool validContactDistance(const btManifoldPoint &pt) const
int getCacheEntry(const btManifoldPoint &newPoint) const
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 clearUserCache(btManifoldPoint &pt)
void removeContactPoint(int index)
int getNumContacts() const
int addManifoldPoint(const btManifoldPoint &newPoint, bool isPredictive=false)
btScalar getContactBreakingThreshold() const
const btCollisionObject * m_body0
this two body pointers can point to the physics rigidbody class.
btManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE]
btVector3 can be used to represent 3D points and vectors.
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
btScalar dot(const btVector3 &v) const
Return the dot product.
btScalar length2() const
Return the length of the vector squared.
rudimentary class to provide type info