29 m_contactManifold(*contactManifold)
85 const btVector3& normal = contactNormalOnB;
94 rel_vel = normal.
dot(vel);
97 btScalar restitution = combinedRestitution* -rel_vel;
100 btScalar velocityError = -(1.0f + restitution) * rel_vel;
104 btScalar jacDiagABInv = relaxation/(denom0+denom1);
106 btScalar penetrationImpulse = positionalError * jacDiagABInv;
107 btScalar velocityImpulse = velocityError * jacDiagABInv;
109 btScalar normalImpulse = penetrationImpulse+velocityImpulse;
110 normalImpulse = 0.f > normalImpulse ? 0.f: normalImpulse;
116 return normalImpulse;
153 btScalar rel_vel = jac.getRelativeVelocity(
162 rel_vel = normal.dot(vel);
167 #ifdef ONLY_USE_LINEAR_MASS
169 impulse = - contactDamping * rel_vel * massTerm;
171 btScalar velocityImpulse = -contactDamping * rel_vel * jacDiagABInv;
172 impulse = velocityImpulse;
btScalar getInvMass() 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 ...
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
Jacobian entry is an abstraction that allows to describe constraints it can be used in combination wi...
btScalar computeImpulseDenominator(const btVector3 &pos, const btVector3 &normal) const
btScalar dot(const btVector3 &v) const
Return the dot product.
btVector3 getVelocityInLocalPoint(const btVector3 &rel_pos) const
btTransform & getWorldTransform()
const btTransform & getCenterOfMassTransform() const
btScalar getDiagonal() const
const btVector3 & getAngularVelocity() const
btCollisionObject can be used to manage collision detection objects.
const btVector3 & getCenterOfMassPosition() const
The btRigidBody is the main class for rigid body objects.
btVector3 can be used to represent 3D points and vectors.
btScalar length2() const
Return the length of the vector squared.
TypedConstraint is the baseclass for Bullet constraints and vehicles.
btMatrix3x3 transpose() const
Return the transpose of the matrix.
const btVector3 & getInvInertiaDiagLocal() const
const btVector3 & getLinearVelocity() const
void applyImpulse(const btVector3 &impulse, const btVector3 &rel_pos)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btFabs(btScalar x)