git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@354 92aac97c-a6ce-11dd-a772-7fcde58d38e6

This commit is contained in:
chappuis.daniel 2010-07-19 19:22:25 +00:00
parent b0f2dbadcd
commit 1cc6a39fb6
2 changed files with 6 additions and 3 deletions

View File

@ -87,7 +87,10 @@ void Contact::evaluate() {
upperBound = INFINITY_CONST; upperBound = INFINITY_CONST;
// Compute the error value of the constraint // Compute the error value of the constraint
errorValue = -PENETRATION_FACTOR * penetrationDepth; Vector3D velocity1 = rigidBody1->getCurrentBodyState().getLinearVelocity();
Vector3D velocity2 = rigidBody2->getCurrentBodyState().getLinearVelocity();
double restitutionCoeff = rigidBody1->getRestitution() * rigidBody2->getRestitution();
errorValue = restitutionCoeff * (normal.scalarProduct(velocity1) - normal.scalarProduct(velocity2)) + PENETRATION_FACTOR * penetrationDepth; // TODO : Add penetration
// Compute the auxiliary jacobian matrix (this corresponds to the friction constraint) // Compute the auxiliary jacobian matrix (this corresponds to the friction constraint)
Vector3D r1CrossU1 = r1.crossProduct(frictionVectors[0]); Vector3D r1CrossU1 = r1.crossProduct(frictionVectors[0]);

View File

@ -29,8 +29,8 @@
namespace reactphysics3d { namespace reactphysics3d {
// Constants // Constants
const double FRICTION_COEFFICIENT = 0.2; // Friction coefficient const double FRICTION_COEFFICIENT = 0.1; // Friction coefficient
const double PENETRATION_FACTOR = 0.1; // Penetration factor (between 0 and 1) which specify the importance of the const double PENETRATION_FACTOR = 0.6; // Penetration factor (between 0 and 1) which specify the importance of the
// penetration depth in order to calculate the correct impulse for the contact // penetration depth in order to calculate the correct impulse for the contact
/* ------------------------------------------------------------------- /* -------------------------------------------------------------------