33 btScalar friction = body0->getRollingFriction() * body1->getFriction() + body1->getRollingFriction() * body0->getFriction();
36 if (friction < -MAX_FRICTION)
37 friction = -MAX_FRICTION;
38 if (friction > MAX_FRICTION)
39 friction = MAX_FRICTION;
45 btScalar friction = body0->getSpinningFriction() * body1->getFriction() + body1->getSpinningFriction() * body0->getFriction();
48 if (friction < -MAX_FRICTION)
49 friction = -MAX_FRICTION;
50 if (friction > MAX_FRICTION)
51 friction = MAX_FRICTION;
58 btScalar friction = body0->getFriction() * body1->getFriction();
61 if (friction < -MAX_FRICTION)
62 friction = -MAX_FRICTION;
63 if (friction > MAX_FRICTION)
64 friction = MAX_FRICTION;
70 return body0->getRestitution() * body1->getRestitution();
75 return body0->getContactDamping() + body1->getContactDamping();
80 btScalar s0 = body0->getContactStiffness();
81 btScalar s1 = body1->getContactStiffness();
86 return combinedStiffness;
91 m_body0Wrap(body0Wrap),
92 m_body1Wrap(body1Wrap)
93 #ifdef DEBUG_PART_INDEX
101 m_closestPointDistanceThreshold(0)
117 btVector3 pointA = pointInWorld + normalOnBInWorld * depth;
177 if (insertIndex >= 0)
@ CF_HAS_CONTACT_STIFFNESS_DAMPING
@ CF_CUSTOM_MATERIAL_CALLBACK
btPersistentManifold * m_manifoldPtr
@ BT_CONTACT_FLAG_CONTACT_STIFFNESS_DAMPING
@ BT_CONTACT_FLAG_FRICTION_ANCHOR
CalculateCombinedCallback gCalculateCombinedContactStiffnessCallback
CalculateCombinedCallback gCalculateCombinedContactDampingCallback
ContactAddedCallback gContactAddedCallback
This is to allow MaterialCombiner/Custom Friction/Restitution values.
CalculateCombinedCallback gCalculateCombinedSpinningFrictionCallback
CalculateCombinedCallback gCalculateCombinedFrictionCallback
CalculateCombinedCallback gCalculateCombinedRollingFrictionCallback
CalculateCombinedCallback gCalculateCombinedRestitutionCallback
bool(* ContactAddedCallback)(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1)
btScalar(* CalculateCombinedCallback)(const btCollisionObject *body0, const btCollisionObject *body1)
These callbacks are used to customize the algorith that combine restitution, friction,...
ContactStartedCallback gContactStartedCallback
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
SIMD_FORCE_INLINE void btPlaneSpace1(const T &n, T &p, T &q)
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
btScalar m_combinedSpinningFriction
btScalar m_combinedRollingFriction
btScalar m_combinedContactStiffness1
btScalar m_combinedRestitution
btVector3 m_lateralFrictionDir2
btVector3 m_positionWorldOnA
m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity
btScalar m_combinedContactDamping1
btVector3 m_normalWorldOnB
btScalar m_combinedFriction
btVector3 m_positionWorldOnB
btVector3 m_lateralFrictionDir1
const btCollisionObjectWrapper * m_body0Wrap
static btScalar calculateCombinedFriction(const btCollisionObject *body0, const btCollisionObject *body1)
User can override this material combiner by implementing gContactAddedCallback and setting body0->m_c...
static btScalar calculateCombinedContactDamping(const btCollisionObject *body0, const btCollisionObject *body1)
const btCollisionObjectWrapper * m_body1Wrap
static btScalar calculateCombinedContactStiffness(const btCollisionObject *body0, const btCollisionObject *body1)
static btScalar calculateCombinedSpinningFriction(const btCollisionObject *body0, const btCollisionObject *body1)
static btScalar calculateCombinedRollingFriction(const btCollisionObject *body0, const btCollisionObject *body1)
static btScalar calculateCombinedRestitution(const btCollisionObject *body0, const btCollisionObject *body1)
in the future we can let the user override the methods to combine restitution and friction
btPersistentManifold * m_manifoldPtr
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)
SIMD_FORCE_INLINE const btCollisionObject * getCollisionObject() const