From 96786c2f9e87bf3f04658c4659130a97f44db3d8 Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Mon, 17 May 2010 21:38:51 +0000 Subject: [PATCH] Make it compile git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@316 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- sources/reactphysics3d/engine/PhysicsWorld.cpp | 16 ++++++++-------- sources/reactphysics3d/engine/PhysicsWorld.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sources/reactphysics3d/engine/PhysicsWorld.cpp b/sources/reactphysics3d/engine/PhysicsWorld.cpp index 0be49688..d2fc2b71 100644 --- a/sources/reactphysics3d/engine/PhysicsWorld.cpp +++ b/sources/reactphysics3d/engine/PhysicsWorld.cpp @@ -39,7 +39,7 @@ void PhysicsWorld::addBody(Body* body) throw(std::invalid_argument) { // Check if the body pointer is not null if (body != 0) { // Check if the body pointer isn't already in the bodyList - for(std::vector::iterator it = bodyList.begin(); it != bodyList.end(); ++it) { + for(std::vector::iterator it = bodies.begin(); it != bodies.end(); ++it) { if (*it == body) { // The body is already in the bodyList, therefore we throw an exception throw std::invalid_argument("Exception in PhysicsWorld::addBody() : The argument body is already in the PhysicsWorld"); @@ -47,7 +47,7 @@ void PhysicsWorld::addBody(Body* body) throw(std::invalid_argument) { } // The body isn't already in the bodyList, therefore we add it to the list - bodyList.push_back(body); + bodies.push_back(body); } else { // Throw an exception @@ -60,8 +60,8 @@ void PhysicsWorld::removeBody(Body const* const body) throw(std::invalid_argumen // Check if the body pointer is not null if (body != 0) { // Look for the body to remove in the bodyList - std::vector::iterator it = bodyList.begin(); - while(it != bodyList.end() && *it != body) { + std::vector::iterator it = bodies.begin(); + while(it != bodies.end() && *it != body) { // Increment the iterator ++it; } @@ -69,7 +69,7 @@ void PhysicsWorld::removeBody(Body const* const body) throw(std::invalid_argumen // If we have found the body to remove in the bodyList if (*it == body) { // Remove the body - bodyList.erase(it); + bodies.erase(it); } else { // The body is not in the bodyList, therfore we throw an exception throw std::invalid_argument("Exception in PhysicsWorld::removeBody() : The argument body to remove is not in the PhysicsWorld"); @@ -84,7 +84,7 @@ void PhysicsWorld::removeBody(Body const* const body) throw(std::invalid_argumen // Add a constraint into the physics world void PhysicsWorld::addConstraint(Constraint* constraint) throw(std::invalid_argument) { assert(constraint != 0); - constraintList.push_back(constraint); + constraints.push_back(constraint); } // Remove a constraint @@ -95,7 +95,7 @@ void PhysicsWorld::removeConstraint(Constraint* constraint) throw(std::invalid_a // Remove all collision contacts constraints void PhysicsWorld::removeAllContactConstraints() { // For all constraints - for (std::vector::iterator it = constraintList.begin(); it != constraintList.end(); ) { + for (std::vector::iterator it = constraints.begin(); it != constraints.end(); ) { // Try a downcasting Contact* contact = dynamic_cast(*it); @@ -104,7 +104,7 @@ void PhysicsWorld::removeAllContactConstraints() { if (contact != 0) { // Delete the contact delete (*it); - it = constraintList.erase(it); + it = constraints.erase(it); } else { ++it; diff --git a/sources/reactphysics3d/engine/PhysicsWorld.h b/sources/reactphysics3d/engine/PhysicsWorld.h index 4e1ce8ec..2e93b7d7 100644 --- a/sources/reactphysics3d/engine/PhysicsWorld.h +++ b/sources/reactphysics3d/engine/PhysicsWorld.h @@ -61,8 +61,8 @@ class PhysicsWorld { void removeAllContactConstraints(); // Remove all collision contacts constraints std::vector::const_iterator getConstraintListStartIterator() const; // Return a start iterator on the constraint list std::vector::const_iterator getConstraintListEndIterator() const; // Return a end iterator on the constraint list - std::vector& getBodies() const; // Return a reference to the bodies of the physics world - std::vector& getConstraints() const; // Return a reference to the constraints of the physics world + std::vector& getBodies(); // Return a reference to the bodies of the physics world + std::vector& getConstraints(); // Return a reference to the constraints of the physics world }; // --- Inline functions --- // @@ -105,12 +105,12 @@ inline std::vector::const_iterator PhysicsWorld::getConstraintListE } // Return a reference to the bodies of the physics world -std::vector& PhysicsWorld::getBodies() const { +std::vector& PhysicsWorld::getBodies() { return bodies; } // Return a reference to the constraints of the physics world -std::vector& PhysicsWorld::getConstraints() const { +std::vector& PhysicsWorld::getConstraints() { return constraints; }