From decc06037a71e09cb9e53f6401af631803ee4812 Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Sun, 6 Jun 2010 21:18:49 +0000 Subject: [PATCH] git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@326 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- .../engine/ConstraintSolver.cpp | 35 +++++++++++++++++-- .../reactphysics3d/engine/ConstraintSolver.h | 1 + .../reactphysics3d/engine/PhysicsEngine.cpp | 2 +- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/sources/reactphysics3d/engine/ConstraintSolver.cpp b/sources/reactphysics3d/engine/ConstraintSolver.cpp index 387466cb..d2568cb1 100644 --- a/sources/reactphysics3d/engine/ConstraintSolver.cpp +++ b/sources/reactphysics3d/engine/ConstraintSolver.cpp @@ -205,8 +205,7 @@ void ConstraintSolver::computeVectorB(double dt) { // Compute the matrix B_sp void ConstraintSolver::computeMatrixB_sp() { - uint indexBody1; - uint indexBody2; + uint indexBody1, indexBody2; // For each constraint for (uint c = 0; csolve(J_sp, B_sp, activeConstraints.size(), nbBodies, bodyMapping, bodyNumberMapping, b, lowerBounds, upperBounds, lambda); - // TODO : Implement this method ... + // Compute the vector V2 + computeVectorV(dt); + + // Update the velocity of each body + // TODO : Put this code somewhere else + for (int i=0; igetIsGravityOn()) { // Apply the current gravity force to the body - rigidBody->getCurrentBodyState().setForce(world->getGravity()); + rigidBody->getCurrentBodyState().setExternalForce(world->getGravity()); } // The current body state of the body becomes the previous body state