diff --git a/sources/reactphysics3d/engine/CollisionEngine.cpp b/sources/reactphysics3d/engine/CollisionEngine.cpp index 2489c6a0..22a4dbe3 100644 --- a/sources/reactphysics3d/engine/CollisionEngine.cpp +++ b/sources/reactphysics3d/engine/CollisionEngine.cpp @@ -27,7 +27,7 @@ using namespace reactphysics3d; // Constructor -CollisionEngine::CollisionEngine(CollisionWorld* world, const Time& timeStep) +CollisionEngine::CollisionEngine(PhysicsWorld* world, const Time& timeStep) :DynamicEngine(world, timeStep) { } @@ -38,20 +38,18 @@ CollisionEngine::~CollisionEngine() { // Update the physics simulation void CollisionEngine::update() { - CollisionWorld* collisionWorld = dynamic_cast(world); - assert(collisionWorld != 0); // While the time accumulator is not empty while(timer.getAccumulator() >= timer.getTimeStep().getValue()) { // Remove all old collision contact constraints - collisionWorld->removeAllContactConstraints(); + world->removeAllContactConstraints(); // Compute the collision detection - if (collisionDetection.computeCollisionDetection(collisionWorld)) { + if (collisionDetection.computeCollisionDetection(world)) { // TODO : Delete this ---------------------------------------------------------- - for (std::vector::const_iterator it = collisionWorld->getConstraintListStartIterator(); it != collisionWorld->getConstraintListEndIterator(); ++it) { + for (std::vector::const_iterator it = world->getConstraintListStartIterator(); it != world->getConstraintListEndIterator(); ++it) { RigidBody* rigidBody1 = dynamic_cast((*it)->getBody1()); RigidBody* rigidBody2 = dynamic_cast((*it)->getBody2()); rigidBody1->setIsMotionEnabled(false); diff --git a/sources/reactphysics3d/engine/CollisionEngine.h b/sources/reactphysics3d/engine/CollisionEngine.h index d9bf99b8..d63cf384 100644 --- a/sources/reactphysics3d/engine/CollisionEngine.h +++ b/sources/reactphysics3d/engine/CollisionEngine.h @@ -39,7 +39,7 @@ class CollisionEngine : public DynamicEngine { // ConstraintSolver constraintSolver; // Constraint solver public : - CollisionEngine(CollisionWorld* world, const Time& timeStep); // Constructor + CollisionEngine(PhysicsWorld* world, const Time& timeStep); // Constructor virtual ~CollisionEngine(); // Destructor virtual void update(); // Update the physics simulation diff --git a/sources/reactphysics3d/engine/DynamicEngine.cpp b/sources/reactphysics3d/engine/DynamicEngine.cpp index b25e3502..73469100 100644 --- a/sources/reactphysics3d/engine/DynamicEngine.cpp +++ b/sources/reactphysics3d/engine/DynamicEngine.cpp @@ -27,7 +27,7 @@ using namespace reactphysics3d; // Constructor -DynamicEngine::DynamicEngine(DynamicWorld* world, const Time& timeStep) +DynamicEngine::DynamicEngine(PhysicsWorld* world, const Time& timeStep) :PhysicsEngine(world, timeStep) { // Check if the pointer to the world is not NULL if (world == 0) { diff --git a/sources/reactphysics3d/engine/DynamicEngine.h b/sources/reactphysics3d/engine/DynamicEngine.h index ef27d6ef..e74aa8ac 100644 --- a/sources/reactphysics3d/engine/DynamicEngine.h +++ b/sources/reactphysics3d/engine/DynamicEngine.h @@ -26,7 +26,7 @@ #include "../body/Body.h" #include "../body/RigidBody.h" #include "../body/BodyState.h" -#include "DynamicWorld.h" +#include "PhysicsWorld.h" #include "../physics/physics.h" // Namespace ReactPhysics3D @@ -46,7 +46,7 @@ class DynamicEngine : public PhysicsEngine { void updateBodyState(RigidBody* const rigidBody, const Time& timeStep); // Update the state of a rigid body public : - DynamicEngine(DynamicWorld* world, const Time& timeStep); // Constructor + DynamicEngine(PhysicsWorld* world, const Time& timeStep); // Constructor DynamicEngine(const DynamicEngine& engine); // Copy-constructor virtual ~DynamicEngine(); // Destructor