32 if (friction < -MAX_FRICTION)
33 friction = -MAX_FRICTION;
34 if (friction > MAX_FRICTION)
35 friction = MAX_FRICTION;
45 if (friction < -MAX_FRICTION)
46 friction = -MAX_FRICTION;
47 if (friction > MAX_FRICTION)
48 friction = MAX_FRICTION;
58 if (friction < -MAX_FRICTION)
59 friction = -MAX_FRICTION;
60 if (friction > MAX_FRICTION)
61 friction = MAX_FRICTION;
85 return combinedStiffness;
91 m_body0Wrap(body0Wrap),
92 m_body1Wrap(body1Wrap)
93#ifdef DEBUG_PART_INDEX
99 , m_closestPointDistanceThreshold(0)
116 btVector3 pointA = pointInWorld + normalOnBInWorld * depth;
176 if (insertIndex >= 0)
@ BT_CONTACT_FLAG_CONTACT_STIFFNESS_DAMPING
@ BT_CONTACT_FLAG_FRICTION_ANCHOR
ContactAddedCallback gContactAddedCallback
This is to allow MaterialCombiner/Custom Friction/Restitution values.
bool(* ContactAddedCallback)(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1)
ContactStartedCallback gContactStartedCallback
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void btPlaneSpace1(const T &n, T &p, T &q)
btCollisionObject can be used to manage collision detection objects.
@ CF_CUSTOM_MATERIAL_CALLBACK
@ CF_HAS_CONTACT_STIFFNESS_DAMPING
btScalar getContactStiffness() const
btTransform & getWorldTransform()
btScalar getSpinningFriction() const
btScalar getFriction() const
btScalar getContactDamping() const
int getCollisionFlags() const
btScalar getRestitution() const
btScalar getRollingFriction() const
ManifoldContactPoint collects and maintains persistent contactpoints.
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)
const btManifoldPoint & getContactPoint(int index) const
const btCollisionObject * getBody0() const
int getCacheEntry(const btManifoldPoint &newPoint) const
void replaceContactPoint(const btManifoldPoint &newPoint, int insertIndex)
int getNumContacts() const
int addManifoldPoint(const btManifoldPoint &newPoint, bool isPredictive=false)
btScalar getContactBreakingThreshold() const
btVector3 can be used to represent 3D points and vectors.
const btCollisionObject * getCollisionObject() const