36 if (friction < -MAX_FRICTION)
37 friction = -MAX_FRICTION;
38 if (friction > MAX_FRICTION)
39 friction = MAX_FRICTION;
48 if (friction < -MAX_FRICTION)
49 friction = -MAX_FRICTION;
50 if (friction > MAX_FRICTION)
51 friction = MAX_FRICTION;
61 if (friction < -MAX_FRICTION)
62 friction = -MAX_FRICTION;
63 if (friction > MAX_FRICTION)
64 friction = MAX_FRICTION;
86 return combinedStiffness;
91 m_body0Wrap(body0Wrap),
92 m_body1Wrap(body1Wrap)
99 m_closestPointDistanceThreshold(0)
115 btVector3 pointA = pointInWorld + normalOnBInWorld * depth;
175 if (insertIndex >= 0)
@ 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...
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