From d99ed01f7ca39f17285bac43b31ebedc5961316f Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Sat, 6 Feb 2010 19:13:13 +0000 Subject: [PATCH] git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@263 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- .../reactphysics3d/engine/CollisionEngine.cpp | 2 ++ .../reactphysics3d/engine/CollisionWorld.cpp | 15 ++++++------ .../reactphysics3d/engine/CollisionWorld.h | 23 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sources/reactphysics3d/engine/CollisionEngine.cpp b/sources/reactphysics3d/engine/CollisionEngine.cpp index c7a283e7..2489c6a0 100644 --- a/sources/reactphysics3d/engine/CollisionEngine.cpp +++ b/sources/reactphysics3d/engine/CollisionEngine.cpp @@ -20,6 +20,8 @@ // Libraries #include "CollisionEngine.h" #include +#include // TODO : Remove this in the final version +#include // TODO : Remove this in the final version // We want to use the ReactPhysics3D namespace using namespace reactphysics3d; diff --git a/sources/reactphysics3d/engine/CollisionWorld.cpp b/sources/reactphysics3d/engine/CollisionWorld.cpp index 558ca20b..58e2a05a 100644 --- a/sources/reactphysics3d/engine/CollisionWorld.cpp +++ b/sources/reactphysics3d/engine/CollisionWorld.cpp @@ -18,39 +18,38 @@ ***************************************************************************/ // Libraries -#include "CollisionWorld.h" +#include "PhysicsWorld.h" #include "../constraint/Contact.h" // We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor -CollisionWorld::CollisionWorld(const Vector3D& gravity) - :DynamicWorld(gravity) { +PhysicsWorld::PhysicsWorld(const Vector3D& gravity) : gravity(gravity) { } // Destructor -CollisionWorld::~CollisionWorld() { +PhysicsWorld::~PhysicsWorld() { // Delete all the constraint for (std::vector::iterator it = constraintList.begin(); it != constraintList.end(); ) { delete (*it); } } -// Add a constraint into the collision world -void CollisionWorld::addConstraint(Constraint* constraint) throw(std::invalid_argument) { +// Add a constraint into the physics world +void PhysicsWorld::addConstraint(Constraint* constraint) throw(std::invalid_argument) { assert(constraint != 0); constraintList.push_back(constraint); } // Remove a constraint -void CollisionWorld::removeConstraint(Constraint* constraint) throw(std::invalid_argument) { +void PhysicsWorld::removeConstraint(Constraint* constraint) throw(std::invalid_argument) { // TODO : Implement this method } // Remove all collision contacts constraints -void CollisionWorld::removeAllContactConstraints() { +void PhysicsWorld::removeAllContactConstraints() { // For all constraints for (std::vector::iterator it = constraintList.begin(); it != constraintList.end(); ) { diff --git a/sources/reactphysics3d/engine/CollisionWorld.h b/sources/reactphysics3d/engine/CollisionWorld.h index fce56dd2..f97579d9 100644 --- a/sources/reactphysics3d/engine/CollisionWorld.h +++ b/sources/reactphysics3d/engine/CollisionWorld.h @@ -17,13 +17,12 @@ * along with ReactPhysics3D. If not, see . * ***************************************************************************/ -#ifndef COLLISIONWORLD_H -#define COLLISIONWORLD_H +#ifndef PHYSICSWORLD_H +#define PHYSICSWORLD_H // Libraries #include #include -#include "DynamicWorld.h" #include "../constraint/Constraint.h" #include "../mathematics/mathematics.h" @@ -31,19 +30,19 @@ namespace reactphysics3d { /* ------------------------------------------------------------------- - Class CollisionWorld : - This class represent a physics world where bodies can collide - against each other. This class inherits from the class - DynamicWorld. + Class PhysicsWorld : + This class represent a physics world. The physics world contains + some bodies. ------------------------------------------------------------------- */ -class CollisionWorld : public DynamicWorld { +class PhysicsWorld { private : + Vector3D gravity; // Gravity vector of the physics world std::vector constraintList; // List that contains all the current constraints public : - CollisionWorld(const Vector3D& gravity); // Constructor - ~CollisionWorld(); // Destructor + PhysicsWorld(const Vector3D& gravity); // Constructor + virtual ~PhysicsWorld(); // Destructor void addConstraint(Constraint* constraint) throw(std::invalid_argument); // Add a constraint void removeConstraint(Constraint* constraint) throw(std::invalid_argument); // Remove a constraint @@ -53,12 +52,12 @@ class CollisionWorld : public DynamicWorld { }; // Return a start iterator on the constraint list -inline std::vector::const_iterator CollisionWorld::getConstraintListStartIterator() const { +inline std::vector::const_iterator PhysicsWorld::getConstraintListStartIterator() const { return constraintList.begin(); } // Return a end iterator on the constraint list -inline std::vector::const_iterator CollisionWorld::getConstraintListEndIterator() const { +inline std::vector::const_iterator PhysicsWorld::getConstraintListEndIterator() const { return constraintList.end(); }