41 #ifdef DEBUG_PERSISTENCY
43 void btPersistentManifold::DebugPersistency()
49 printf(
"m_pointCache[%d].m_userPersistentData = %x\n",i,
m_pointCache[i].m_userPersistentData);
52 #endif //DEBUG_PERSISTENCY
60 #ifdef DEBUG_PERSISTENCY
69 printf(
"error in clearUserCache\n");
73 #endif //DEBUG_PERSISTENCY
81 #ifdef DEBUG_PERSISTENCY
114 int maxPenetrationIndex = -1;
115 #define KEEP_DEEPEST_POINT 1
116 #ifdef KEEP_DEEPEST_POINT
118 for (
int i=0;i<4;i++)
122 maxPenetrationIndex = i;
126 #endif //KEEP_DEEPEST_POINT
132 if (maxPenetrationIndex != 0)
139 if (maxPenetrationIndex != 1)
147 if (maxPenetrationIndex != 2)
155 if (maxPenetrationIndex != 3)
165 if(maxPenetrationIndex != 0) {
169 if(maxPenetrationIndex != 1) {
173 if(maxPenetrationIndex != 2) {
177 if(maxPenetrationIndex != 3) {
192 int nearestPoint = -1;
193 for(
int i = 0; i <
size; i++ )
199 if( distToManiPoint < shortestDist )
201 shortestDist = distToManiPoint;
218 #if MANIFOLD_CACHE_SIZE >= 4
250 #ifdef DEBUG_PERSISTENCY
251 printf(
"refreshContactPoints posA = (%f,%f,%f) posB = (%f,%f,%f)\n",
258 #endif //DEBUG_PERSISTENCY
271 btVector3 projectedDifference,projectedPoint;
285 distance2d = projectedDifference.
dot(projectedDifference);
293 (*gContactProcessedCallback)(manifoldPoint,(
void*)
m_body0,(
void*)
m_body1);
297 #ifdef DEBUG_PERSISTENCY
int getCacheEntry(const btManifoldPoint &newPoint) const
const btCollisionObject * m_body1
void refreshContactPoints(const btTransform &trA, const btTransform &trB)
calculated new worldspace coordinates and depth, and reject points that exceed the collision margin ...
btScalar getContactBreakingThreshold() const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
ManifoldContactPoint collects and maintains persistent contactpoints.
#define MANIFOLD_CACHE_SIZE
int sortCachedPoints(const btManifoldPoint &pt)
sort cached points so most isolated points come first
btScalar dot(const btVector3 &v) const
Return the dot product.
const btScalar & getZ() const
Return the z value.
btVector3 m_normalWorldOnB
void * m_userPersistentData
btVector3 m_positionWorldOnB
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
const btScalar & getY() const
Return the y value.
static btScalar calcArea4Points(const btVector3 &p0, const btVector3 &p1, const btVector3 &p2, const btVector3 &p3)
const btScalar & getX() const
Return the x value.
btVector3 m_positionWorldOnA
m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity ...
bool(* ContactProcessedCallback)(btManifoldPoint &cp, void *body0, void *body1)
ContactDestroyedCallback gContactDestroyedCallback
btScalar gContactBreakingThreshold
maximum contact breaking and merging threshold
btVector3 can be used to represent 3D points and vectors.
btScalar length2() const
Return the length of the vector squared.
void removeContactPoint(int index)
rudimentary class to provide type info
int getNumContacts() const
void clearUserCache(btManifoldPoint &pt)
static float4 cross(const float4 &a, const float4 &b)
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
btScalar getDistance() const
const btCollisionObject * m_body0
this two body pointers can point to the physics rigidbody class.
int addManifoldPoint(const btManifoldPoint &newPoint, bool isPredictive=false)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
bool(* ContactDestroyedCallback)(void *userPersistentData)
bool validContactDistance(const btManifoldPoint &pt) const
ContactProcessedCallback gContactProcessedCallback
btManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE]