From 785e2701bd848c5878158d4f35e322f27ce23f45 Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Mon, 29 Mar 2010 21:46:50 +0000 Subject: [PATCH] git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@301 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- .../reactphysics3d/constraint/Constraint.cpp | 4 ++-- sources/reactphysics3d/constraint/Contact.cpp | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sources/reactphysics3d/constraint/Constraint.cpp b/sources/reactphysics3d/constraint/Constraint.cpp index 2bd69ab0..67e1fe92 100644 --- a/sources/reactphysics3d/constraint/Constraint.cpp +++ b/sources/reactphysics3d/constraint/Constraint.cpp @@ -25,8 +25,8 @@ using namespace reactphysics3d; // Constructor Constraint::Constraint(Body* const body1, Body* const body2, unsigned int nbAuxConstraints, bool active) - :body1(body1), body2(body2), active(true), nbAuxConstraints(nbAuxConstraints), - lowerBound(lowerBound), upperBound(upperBound), active(active) { + :body1(body1), body2(body2), active(active), nbAuxConstraints(nbAuxConstraints), + lowerBound(lowerBound), upperBound(upperBound) { } diff --git a/sources/reactphysics3d/constraint/Contact.cpp b/sources/reactphysics3d/constraint/Contact.cpp index 228026da..1477d5dc 100644 --- a/sources/reactphysics3d/constraint/Contact.cpp +++ b/sources/reactphysics3d/constraint/Contact.cpp @@ -54,8 +54,8 @@ void Contact::evaluate() { // Compute the friction vectors that span the tangential friction plane computeFrictionVectors(); - Vector3D r1 = point - rigidBody1.getCurrentBodyState().getPosition(); - Vector3D r2 = point - rigidBody2.getCurrentBodyState().getPosition(); + Vector3D r1 = point - rigidBody1->getCurrentBodyState().getPosition(); + Vector3D r2 = point - rigidBody2->getCurrentBodyState().getPosition(); Vector3D r1CrossN = r1.crossProduct(normal); Vector3D r2CrossN = r2.crossProduct(normal); @@ -115,15 +115,15 @@ void Contact::evaluate() { // Compute the auxiliary lower and upper bounds // TODO : Now mC is only the mass of the first body but it is probably wrong // TODO : Now g is 9.81 but we should use the true gravity value of the physics world. - double mu_mc_g = FRICTION_COEFFICIENT * rigidBody1.getMass().getValue() * 9.81; - auxLowerBounds.setValue(0, 0, -mu_mc_g); - auxLowerBounds.setValue(1, 0, -mu_mc_g); - auxUpperBounds.setValue(0, 0, mu_mc_g); - auxUpperBounds.setValue(1, 0, mu_mc_g); + double mu_mc_g = FRICTION_COEFFICIENT * rigidBody1->getMass().getValue() * 9.81; + auxLowerBounds.setValue(0, -mu_mc_g); + auxLowerBounds.setValue(1, -mu_mc_g); + auxUpperBounds.setValue(0, mu_mc_g); + auxUpperBounds.setValue(1, mu_mc_g); // Compute the error auxiliary values - auxErrorValues.setValue(0, 0, 0.0); - auxErrorValues.setValue(1, 0, 0.0); + auxErrorValues.setValue(0, 0.0); + auxErrorValues.setValue(1, 0.0); ;} // TODO : Delete this (Used to debug collision detection)