26 m_contactManifold(*contactManifold)
70 const btVector3& normal = contactNormalOnB;
79 rel_vel = normal.
dot(vel);
82 btScalar restitution = combinedRestitution * -rel_vel;
85 btScalar velocityError = -(1.0f + restitution) * rel_vel;
89 btScalar jacDiagABInv = relaxation / (denom0 + denom1);
91 btScalar penetrationImpulse = positionalError * jacDiagABInv;
92 btScalar velocityImpulse = velocityError * jacDiagABInv;
94 btScalar normalImpulse = penetrationImpulse + velocityImpulse;
95 normalImpulse = 0.f > normalImpulse ? 0.f : normalImpulse;
99 body2->
applyImpulse(-normal * (normalImpulse), rel_pos2);
101 return normalImpulse;
141 rel_vel = normal.
dot(vel);
146#ifdef ONLY_USE_LINEAR_MASS
148 impulse = -contactDamping * rel_vel * massTerm;
150 btScalar velocityImpulse = -contactDamping * rel_vel * jacDiagABInv;
151 impulse = velocityImpulse;
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btFabs(btScalar x)
@ CONTACT_CONSTRAINT_TYPE
btCollisionObject can be used to manage collision detection objects.
btTransform & getWorldTransform()
Jacobian entry is an abstraction that allows to describe constraints it can be used in combination wi...
btScalar getDiagonal() const
btScalar getRelativeVelocity(const btVector3 &linvelA, const btVector3 &angvelA, const btVector3 &linvelB, const btVector3 &angvelB)
btMatrix3x3 transpose() const
Return the transpose of the matrix.
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
The btRigidBody is the main class for rigid body objects.
btVector3 getVelocityInLocalPoint(const btVector3 &rel_pos) const
btScalar getInvMass() const
const btVector3 & getInvInertiaDiagLocal() const
const btTransform & getCenterOfMassTransform() const
void applyImpulse(const btVector3 &impulse, const btVector3 &rel_pos)
const btVector3 & getAngularVelocity() const
const btVector3 & getCenterOfMassPosition() const
btScalar computeImpulseDenominator(const btVector3 &pos, const btVector3 &normal) const
static const btRigidBody * upcast(const btCollisionObject *colObj)
to keep collision detection and dynamics separate we don't store a rigidbody pointer but a rigidbody ...
const btVector3 & getLinearVelocity() const
TypedConstraint is the baseclass for Bullet constraints and vehicles.
btVector3 can be used to represent 3D points and vectors.
btScalar dot(const btVector3 &v) const
Return the dot product.
btScalar length2() const
Return the length of the vector squared.