diff --git a/sources/reactphysics3d/engine/CollisionEngine.cpp b/sources/reactphysics3d/engine/CollisionEngine.cpp index ea86c329..9689fef6 100644 --- a/sources/reactphysics3d/engine/CollisionEngine.cpp +++ b/sources/reactphysics3d/engine/CollisionEngine.cpp @@ -43,15 +43,14 @@ void CollisionEngine::update() { // While the time accumulator is not empty while(timer.getAccumulator() >= timer.getTimeStep().getValue()) { - // Remove all old collision contact constraints collisionWorld->removeAllContactConstraints(); - Time timeFirst = 0; // First collision time - Time timeLast = DBL_MAX; // Last collision separation time + Time timeFirst(0); // First collision time + Time timeLast(DBL_MAX); // Last collision separation time // Compute the collision detection - if(collisionDetection.computeCollisionDetection(collisionWorld, timer.getTimeStep(), timeFirst, timeLast)) { + if (collisionDetection.computeCollisionDetection(collisionWorld, timer.getTimeStep(), timeFirst, timeLast)) { // For each body in the dynamic world for(std::vector::const_iterator it = world->getBodyListStartIterator(); it != world->getBodyListEndIterator(); ++it) { // If the body is a RigidBody and if the rigid body motion is enabled @@ -60,6 +59,9 @@ void CollisionEngine::update() { // Update the state of the rigid body updateBodyState(rigidBody, timeFirst); } + + // Stop the body (TO DELETE) + rigidBody->setIsMotionEnabled(false); // TODO : DELETE THIS } } else { @@ -70,6 +72,7 @@ void CollisionEngine::update() { if (rigidBody && rigidBody->getIsMotionEnabled()) { // Update the state of the rigid body with an entire time step updateBodyState(rigidBody, timer.getTimeStep()); + std::cout << "NO NO NO" << std::endl; // TODO : DELETE THIS } } }