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