git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@354 92aac97c-a6ce-11dd-a772-7fcde58d38e6
This commit is contained in:
parent
b0f2dbadcd
commit
1cc6a39fb6
|
@ -87,7 +87,10 @@ void Contact::evaluate() {
|
|||
upperBound = INFINITY_CONST;
|
||||
|
||||
// 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)
|
||||
Vector3D r1CrossU1 = r1.crossProduct(frictionVectors[0]);
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
namespace reactphysics3d {
|
||||
|
||||
// Constants
|
||||
const double FRICTION_COEFFICIENT = 0.2; // Friction coefficient
|
||||
const double PENETRATION_FACTOR = 0.1; // Penetration factor (between 0 and 1) which specify the importance of the
|
||||
const double FRICTION_COEFFICIENT = 0.1; // Friction coefficient
|
||||
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
|
||||
|
||||
/* -------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user