diff --git a/sources/reactphysics3d/engine/CollisionWorld.cpp b/sources/reactphysics3d/engine/CollisionWorld.cpp deleted file mode 100644 index 58e2a05a..00000000 --- a/sources/reactphysics3d/engine/CollisionWorld.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2009 Daniel Chappuis * -**************************************************************************** -* This file is part of ReactPhysics3D. * -* * -* ReactPhysics3D is free software: you can redistribute it and/or modify * -* it under the terms of the GNU Lesser General Public License as published * -* by the Free Software Foundation, either version 3 of the License, or * -* (at your option) any later version. * -* * -* ReactPhysics3D is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU Lesser General Public License for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with ReactPhysics3D. If not, see . * -***************************************************************************/ - -// Libraries -#include "PhysicsWorld.h" -#include "../constraint/Contact.h" - -// We want to use the ReactPhysics3D namespace -using namespace reactphysics3d; - -// Constructor -PhysicsWorld::PhysicsWorld(const Vector3D& gravity) : gravity(gravity) { - -} - -// Destructor -PhysicsWorld::~PhysicsWorld() { - // Delete all the constraint - for (std::vector::iterator it = constraintList.begin(); it != constraintList.end(); ) { - delete (*it); - } -} - -// 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 PhysicsWorld::removeConstraint(Constraint* constraint) throw(std::invalid_argument) { - // TODO : Implement this method -} - - // Remove all collision contacts constraints -void PhysicsWorld::removeAllContactConstraints() { - // For all constraints - for (std::vector::iterator it = constraintList.begin(); it != constraintList.end(); ) { - - // Try a downcasting - Contact* contact = dynamic_cast(*it); - - // If the constraint is a contact - if (contact != 0) { - // Delete the contact - delete (*it); - it = constraintList.erase(it); - } - else { - ++it; - } - } -} diff --git a/sources/reactphysics3d/engine/CollisionWorld.h b/sources/reactphysics3d/engine/CollisionWorld.h deleted file mode 100644 index f97579d9..00000000 --- a/sources/reactphysics3d/engine/CollisionWorld.h +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2009 Daniel Chappuis * -**************************************************************************** -* This file is part of ReactPhysics3D. * -* * -* ReactPhysics3D is free software: you can redistribute it and/or modify * -* it under the terms of the GNU Lesser General Public License as published * -* by the Free Software Foundation, either version 3 of the License, or * -* (at your option) any later version. * -* * -* ReactPhysics3D is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU Lesser General Public License for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with ReactPhysics3D. If not, see . * -***************************************************************************/ - -#ifndef PHYSICSWORLD_H -#define PHYSICSWORLD_H - -// Libraries -#include -#include -#include "../constraint/Constraint.h" -#include "../mathematics/mathematics.h" - -// ReactPhysics3D namespace -namespace reactphysics3d { - -/* ------------------------------------------------------------------- - Class PhysicsWorld : - This class represent a physics world. The physics world contains - some bodies. - ------------------------------------------------------------------- -*/ -class PhysicsWorld { - private : - Vector3D gravity; // Gravity vector of the physics world - std::vector constraintList; // List that contains all the current constraints - - public : - 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 - 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 -}; - -// Return a start iterator on the constraint list -inline std::vector::const_iterator PhysicsWorld::getConstraintListStartIterator() const { - return constraintList.begin(); -} - -// Return a end iterator on the constraint list -inline std::vector::const_iterator PhysicsWorld::getConstraintListEndIterator() const { - return constraintList.end(); -} - - -} // End of the ReactPhysics3D namespace - -#endif diff --git a/sources/reactphysics3d/engine/DynamicWorld.cpp b/sources/reactphysics3d/engine/DynamicWorld.cpp deleted file mode 100644 index 0ddd81eb..00000000 --- a/sources/reactphysics3d/engine/DynamicWorld.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009 Daniel Chappuis * - **************************************************************************** - * This file is part of ReactPhysics3D. * - * * - * ReactPhysics3D is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published * - * by the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * ReactPhysics3D is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with ReactPhysics3D. If not, see . * - ***************************************************************************/ - -// Libraries -#include "DynamicWorld.h" - -// We want to use the ReactPhysics3D namespace -using namespace reactphysics3d; - -// Constructor -DynamicWorld::DynamicWorld(const Vector3D& gravity) - :PhysicsWorld(gravity) { - -} - -// Copy-constructor -DynamicWorld::DynamicWorld(const DynamicWorld& world) - :PhysicsWorld(world) { - -} - -// Destructor -DynamicWorld::~DynamicWorld() { - -} diff --git a/sources/reactphysics3d/engine/DynamicWorld.h b/sources/reactphysics3d/engine/DynamicWorld.h deleted file mode 100644 index 2e2967ca..00000000 --- a/sources/reactphysics3d/engine/DynamicWorld.h +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009 Daniel Chappuis * - **************************************************************************** - * This file is part of ReactPhysics3D. * - * * - * ReactPhysics3D is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published * - * by the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * ReactPhysics3D is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with ReactPhysics3D. If not, see . * - ***************************************************************************/ - -#ifndef DYNAMICWORLD_H -#define DYNAMICWORLD_H - -// Libraries -#include "PhysicsWorld.h" - -// Namespace ReactPhysics3D -namespace reactphysics3d { - -/* ------------------------------------------------------------------- - Class DynamicWorld : - This class represents the world of the physics engine where - bodies can moves. This class inherits from the class - PhysicsWorld. - ------------------------------------------------------------------- -*/ -class DynamicWorld : public PhysicsWorld { - - public : - DynamicWorld(const Vector3D& gravity); // Constructor - DynamicWorld(const DynamicWorld& world); // Copy-constructor - virtual ~DynamicWorld(); // Destructor -}; - -} - -#endif