43 #ifdef DEBUG_PERSISTENCY 45 void btPersistentManifold::DebugPersistency()
51 printf(
"m_pointCache[%d].m_userPersistentData = %x\n",i,
m_pointCache[i].m_userPersistentData);
54 #endif //DEBUG_PERSISTENCY 62 #ifdef DEBUG_PERSISTENCY 71 printf(
"error in clearUserCache\n");
75 #endif //DEBUG_PERSISTENCY 83 #ifdef DEBUG_PERSISTENCY 116 int maxPenetrationIndex = -1;
117 #define KEEP_DEEPEST_POINT 1 118 #ifdef KEEP_DEEPEST_POINT 120 for (
int i=0;i<4;i++)
124 maxPenetrationIndex = i;
128 #endif //KEEP_DEEPEST_POINT 134 if (maxPenetrationIndex != 0)
141 if (maxPenetrationIndex != 1)
149 if (maxPenetrationIndex != 2)
157 if (maxPenetrationIndex != 3)
167 if(maxPenetrationIndex != 0) {
171 if(maxPenetrationIndex != 1) {
175 if(maxPenetrationIndex != 2) {
179 if(maxPenetrationIndex != 3) {
194 int nearestPoint = -1;
195 for(
int i = 0; i <
size; i++ )
201 if( distToManiPoint < shortestDist )
203 shortestDist = distToManiPoint;
220 #if MANIFOLD_CACHE_SIZE >= 4 252 #ifdef DEBUG_PERSISTENCY 253 printf(
"refreshContactPoints posA = (%f,%f,%f) posB = (%f,%f,%f)\n",
260 #endif //DEBUG_PERSISTENCY 273 btVector3 projectedDifference,projectedPoint;
288 distance2d = projectedDifference.
dot(projectedDifference);
296 (*gContactProcessedCallback)(manifoldPoint,(
void*)
m_body0,(
void*)
m_body1);
300 #ifdef DEBUG_PERSISTENCY ContactStartedCallback gContactStartedCallback
const btCollisionObject * m_body1
btScalar getContactBreakingThreshold() const
void refreshContactPoints(const btTransform &trA, const btTransform &trB)
calculated new worldspace coordinates and depth, and reject points that exceed the collision margin ...
btScalar length2() const
Return the length of the vector squared.
int getNumContacts() const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
bool validContactDistance(const btManifoldPoint &pt) const
const btScalar & getY() const
Return the y value.
ManifoldContactPoint collects and maintains persistent contactpoints.
#define MANIFOLD_CACHE_SIZE
int sortCachedPoints(const btManifoldPoint &pt)
sort cached points so most isolated points come first
const btScalar & getZ() const
Return the z value.
btVector3 m_normalWorldOnB
void * m_userPersistentData
btVector3 m_positionWorldOnB
void(* ContactEndedCallback)(btPersistentManifold *const &manifold)
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.
static btScalar calcArea4Points(const btVector3 &p0, const btVector3 &p1, const btVector3 &p2, const btVector3 &p3)
btVector3 m_positionWorldOnA
m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity ...
bool(* ContactDestroyedCallback)(void *userPersistentData)
ContactDestroyedCallback gContactDestroyedCallback
btScalar gContactBreakingThreshold
maximum contact breaking and merging threshold
void(* ContactStartedCallback)(btPersistentManifold *const &manifold)
btVector3 can be used to represent 3D points and vectors.
ContactEndedCallback gContactEndedCallback
void removeContactPoint(int index)
bool(* ContactProcessedCallback)(btManifoldPoint &cp, void *body0, void *body1)
rudimentary class to provide type info
void clearUserCache(btManifoldPoint &pt)
bool gContactCalcArea3Points
gContactCalcArea3Points will approximate the convex hull area using 3 points when setting it to false...
const T & btMax(const T &a, const T &b)
btScalar dot(const btQuaternion &q1, const btQuaternion &q2)
Calculate the dot product between two quaternions.
btScalar m_contactBreakingThreshold
const btCollisionObject * m_body0
this two body pointers can point to the physics rigidbody class.
int addManifoldPoint(const btManifoldPoint &newPoint, bool isPredictive=false)
btScalar getDistance() const
const btScalar & getX() const
Return the x value.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
ContactProcessedCallback gContactProcessedCallback
btManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE]
int getCacheEntry(const btManifoldPoint &newPoint) const