From 38a8969c63c941c0009051f8f6cf570573d71382 Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Tue, 18 Oct 2011 22:51:29 +0000 Subject: [PATCH] Change of the directory structure git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@446 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- src/collision/CollisionDetection.cpp | 5 ++--- src/collision/CollisionDetection.h | 1 - src/collision/{ => broadphase}/BroadPhaseAlgorithm.cpp | 0 src/collision/{ => broadphase}/BroadPhaseAlgorithm.h | 2 +- src/collision/{ => broadphase}/NoBroadPhaseAlgorithm.cpp | 2 +- src/collision/{ => broadphase}/NoBroadPhaseAlgorithm.h | 0 src/collision/{ => broadphase}/SAPAlgorithm.cpp | 2 +- src/collision/{ => broadphase}/SAPAlgorithm.h | 2 +- src/collision/narrowphase/EPA/EPAAlgorithm.cpp | 2 +- src/collision/narrowphase/EPA/EPAAlgorithm.h | 2 +- src/collision/{ => narrowphase}/GJK/GJKAlgorithm.cpp | 4 ++-- src/collision/{ => narrowphase}/GJK/GJKAlgorithm.h | 6 +++--- src/collision/{ => narrowphase}/GJK/Simplex.cpp | 0 src/collision/{ => narrowphase}/GJK/Simplex.h | 2 +- src/collision/{ => narrowphase}/NarrowPhaseAlgorithm.cpp | 0 src/collision/{ => narrowphase}/NarrowPhaseAlgorithm.h | 6 +++--- src/collision/{ => narrowphase}/SATAlgorithm.cpp | 8 ++++---- src/collision/{ => narrowphase}/SATAlgorithm.h | 6 +++--- src/engine/PhysicsEngine.h | 8 +------- src/shapes/BoxShape.h | 2 -- 20 files changed, 25 insertions(+), 35 deletions(-) rename src/collision/{ => broadphase}/BroadPhaseAlgorithm.cpp (100%) rename src/collision/{ => broadphase}/BroadPhaseAlgorithm.h (99%) rename src/collision/{ => broadphase}/NoBroadPhaseAlgorithm.cpp (98%) rename src/collision/{ => broadphase}/NoBroadPhaseAlgorithm.h (100%) rename src/collision/{ => broadphase}/SAPAlgorithm.cpp (99%) rename src/collision/{ => broadphase}/SAPAlgorithm.h (99%) rename src/collision/{ => narrowphase}/GJK/GJKAlgorithm.cpp (99%) rename src/collision/{ => narrowphase}/GJK/GJKAlgorithm.h (97%) rename src/collision/{ => narrowphase}/GJK/Simplex.cpp (100%) rename src/collision/{ => narrowphase}/GJK/Simplex.h (99%) rename src/collision/{ => narrowphase}/NarrowPhaseAlgorithm.cpp (100%) rename src/collision/{ => narrowphase}/NarrowPhaseAlgorithm.h (97%) rename src/collision/{ => narrowphase}/SATAlgorithm.cpp (99%) rename src/collision/{ => narrowphase}/SATAlgorithm.h (97%) diff --git a/src/collision/CollisionDetection.cpp b/src/collision/CollisionDetection.cpp index c9164421..130467fa 100644 --- a/src/collision/CollisionDetection.cpp +++ b/src/collision/CollisionDetection.cpp @@ -24,9 +24,8 @@ // Libraries #include "CollisionDetection.h" -#include "SAPAlgorithm.h" -#include "GJK/GJKAlgorithm.h" -#include "SATAlgorithm.h" +#include "broadphase/SAPAlgorithm.h" +#include "narrowphase/GJK/GJKAlgorithm.h" #include "../body/Body.h" #include "../shapes/BoxShape.h" #include "../body/RigidBody.h" diff --git a/src/collision/CollisionDetection.h b/src/collision/CollisionDetection.h index 1fa103fe..7c4f0f6e 100644 --- a/src/collision/CollisionDetection.h +++ b/src/collision/CollisionDetection.h @@ -36,7 +36,6 @@ #include #include -// TODO : Add a broadphase and a narrowphase folder in the src/collision/ folder // ReactPhysics3D namespace namespace reactphysics3d { diff --git a/src/collision/BroadPhaseAlgorithm.cpp b/src/collision/broadphase/BroadPhaseAlgorithm.cpp similarity index 100% rename from src/collision/BroadPhaseAlgorithm.cpp rename to src/collision/broadphase/BroadPhaseAlgorithm.cpp diff --git a/src/collision/BroadPhaseAlgorithm.h b/src/collision/broadphase/BroadPhaseAlgorithm.h similarity index 99% rename from src/collision/BroadPhaseAlgorithm.h rename to src/collision/broadphase/BroadPhaseAlgorithm.h index 531b5a85..aa81eaf1 100644 --- a/src/collision/BroadPhaseAlgorithm.h +++ b/src/collision/broadphase/BroadPhaseAlgorithm.h @@ -27,7 +27,7 @@ // Libraries #include -#include "../body/Body.h" +#include "../../body/Body.h" // Namespace ReactPhysics3D namespace reactphysics3d { diff --git a/src/collision/NoBroadPhaseAlgorithm.cpp b/src/collision/broadphase/NoBroadPhaseAlgorithm.cpp similarity index 98% rename from src/collision/NoBroadPhaseAlgorithm.cpp rename to src/collision/broadphase/NoBroadPhaseAlgorithm.cpp index 391e4ae4..3dc09004 100644 --- a/src/collision/NoBroadPhaseAlgorithm.cpp +++ b/src/collision/broadphase/NoBroadPhaseAlgorithm.cpp @@ -24,7 +24,7 @@ // Libraries #include "NoBroadPhaseAlgorithm.h" -#include "CollisionDetection.h" +#include "../CollisionDetection.h" // We want to use the ReactPhysics3D namespace using namespace reactphysics3d; diff --git a/src/collision/NoBroadPhaseAlgorithm.h b/src/collision/broadphase/NoBroadPhaseAlgorithm.h similarity index 100% rename from src/collision/NoBroadPhaseAlgorithm.h rename to src/collision/broadphase/NoBroadPhaseAlgorithm.h diff --git a/src/collision/SAPAlgorithm.cpp b/src/collision/broadphase/SAPAlgorithm.cpp similarity index 99% rename from src/collision/SAPAlgorithm.cpp rename to src/collision/broadphase/SAPAlgorithm.cpp index f531f9c0..78eb50ea 100644 --- a/src/collision/SAPAlgorithm.cpp +++ b/src/collision/broadphase/SAPAlgorithm.cpp @@ -24,7 +24,7 @@ // Libraries #include "SAPAlgorithm.h" -#include "CollisionDetection.h" +#include "../CollisionDetection.h" #include // Namespaces diff --git a/src/collision/SAPAlgorithm.h b/src/collision/broadphase/SAPAlgorithm.h similarity index 99% rename from src/collision/SAPAlgorithm.h rename to src/collision/broadphase/SAPAlgorithm.h index 83d0ae8d..e18fc940 100644 --- a/src/collision/SAPAlgorithm.h +++ b/src/collision/broadphase/SAPAlgorithm.h @@ -27,7 +27,7 @@ // Libraries #include "BroadPhaseAlgorithm.h" -#include "../shapes/AABB.h" +#include "../../shapes/AABB.h" // TODO : Rename this class SweepAndPruneAlgorithm diff --git a/src/collision/narrowphase/EPA/EPAAlgorithm.cpp b/src/collision/narrowphase/EPA/EPAAlgorithm.cpp index d0282592..9f0de3af 100644 --- a/src/collision/narrowphase/EPA/EPAAlgorithm.cpp +++ b/src/collision/narrowphase/EPA/EPAAlgorithm.cpp @@ -24,7 +24,7 @@ // Libraries #include "EPAAlgorithm.h" -#include "../../GJK/GJKAlgorithm.h" +#include "../GJK/GJKAlgorithm.h" #include "TrianglesStore.h" // We want to use the ReactPhysics3D namespace diff --git a/src/collision/narrowphase/EPA/EPAAlgorithm.h b/src/collision/narrowphase/EPA/EPAAlgorithm.h index 68a0381a..df605c70 100644 --- a/src/collision/narrowphase/EPA/EPAAlgorithm.h +++ b/src/collision/narrowphase/EPA/EPAAlgorithm.h @@ -26,7 +26,7 @@ #define EPA_ALGORITHM_H // Libraries -#include "../../GJK/Simplex.h" +#include "../GJK/Simplex.h" #include "../../../shapes/Shape.h" #include "../../ContactInfo.h" #include "../../../mathematics/mathematics.h" diff --git a/src/collision/GJK/GJKAlgorithm.cpp b/src/collision/narrowphase/GJK/GJKAlgorithm.cpp similarity index 99% rename from src/collision/GJK/GJKAlgorithm.cpp rename to src/collision/narrowphase/GJK/GJKAlgorithm.cpp index 9b3c9a15..7f01e0bd 100644 --- a/src/collision/GJK/GJKAlgorithm.cpp +++ b/src/collision/narrowphase/GJK/GJKAlgorithm.cpp @@ -26,8 +26,8 @@ // Libraries #include "GJKAlgorithm.h" #include "Simplex.h" -#include "../../constraint/Contact.h" -#include "../../constants.h" +#include "../../../constraint/Contact.h" +#include "../../../constants.h" #include #include #include diff --git a/src/collision/GJK/GJKAlgorithm.h b/src/collision/narrowphase/GJK/GJKAlgorithm.h similarity index 97% rename from src/collision/GJK/GJKAlgorithm.h rename to src/collision/narrowphase/GJK/GJKAlgorithm.h index 9e9888e6..2185305c 100644 --- a/src/collision/GJK/GJKAlgorithm.h +++ b/src/collision/narrowphase/GJK/GJKAlgorithm.h @@ -27,9 +27,9 @@ // Libraries #include "../NarrowPhaseAlgorithm.h" -#include "../ContactInfo.h" -#include "../../shapes/Shape.h" -#include "../narrowphase/EPA/EPAAlgorithm.h" +#include "../../ContactInfo.h" +#include "../../../shapes/Shape.h" +#include "../EPA/EPAAlgorithm.h" // ReactPhysics3D namespace diff --git a/src/collision/GJK/Simplex.cpp b/src/collision/narrowphase/GJK/Simplex.cpp similarity index 100% rename from src/collision/GJK/Simplex.cpp rename to src/collision/narrowphase/GJK/Simplex.cpp diff --git a/src/collision/GJK/Simplex.h b/src/collision/narrowphase/GJK/Simplex.h similarity index 99% rename from src/collision/GJK/Simplex.h rename to src/collision/narrowphase/GJK/Simplex.h index 1b668c0f..791270c0 100644 --- a/src/collision/GJK/Simplex.h +++ b/src/collision/narrowphase/GJK/Simplex.h @@ -26,7 +26,7 @@ #define SIMPLEX_H // Libraries -#include "../../mathematics/mathematics.h" +#include "../../../mathematics/mathematics.h" #include // ReactPhysics3D namespace diff --git a/src/collision/NarrowPhaseAlgorithm.cpp b/src/collision/narrowphase/NarrowPhaseAlgorithm.cpp similarity index 100% rename from src/collision/NarrowPhaseAlgorithm.cpp rename to src/collision/narrowphase/NarrowPhaseAlgorithm.cpp diff --git a/src/collision/NarrowPhaseAlgorithm.h b/src/collision/narrowphase/NarrowPhaseAlgorithm.h similarity index 97% rename from src/collision/NarrowPhaseAlgorithm.h rename to src/collision/narrowphase/NarrowPhaseAlgorithm.h index 0341e7fd..f2579926 100644 --- a/src/collision/NarrowPhaseAlgorithm.h +++ b/src/collision/narrowphase/NarrowPhaseAlgorithm.h @@ -26,9 +26,9 @@ #define NARROW_PHASE_ALGORITHM_H // Libraries -#include "../body/Body.h" -#include "ContactInfo.h" -#include "CollisionDetection.h" +#include "../../body/Body.h" +#include "../ContactInfo.h" +#include "../CollisionDetection.h" // Namespace ReactPhysics3D namespace reactphysics3d { diff --git a/src/collision/SATAlgorithm.cpp b/src/collision/narrowphase/SATAlgorithm.cpp similarity index 99% rename from src/collision/SATAlgorithm.cpp rename to src/collision/narrowphase/SATAlgorithm.cpp index 816743ad..8c7d9ce5 100644 --- a/src/collision/SATAlgorithm.cpp +++ b/src/collision/narrowphase/SATAlgorithm.cpp @@ -24,10 +24,10 @@ // Libraries #include "SATAlgorithm.h" -#include "../shapes/BoxShape.h" -#include "../body/RigidBody.h" -#include "../constraint/Contact.h" -#include "../mathematics/Transform.h" +#include "../../shapes/BoxShape.h" +#include "../../body/RigidBody.h" +#include "../../constraint/Contact.h" +#include "../../mathematics/Transform.h" #include #include #include diff --git a/src/collision/SATAlgorithm.h b/src/collision/narrowphase/SATAlgorithm.h similarity index 97% rename from src/collision/SATAlgorithm.h rename to src/collision/narrowphase/SATAlgorithm.h index ef8a6532..ef626ff8 100644 --- a/src/collision/SATAlgorithm.h +++ b/src/collision/narrowphase/SATAlgorithm.h @@ -27,9 +27,9 @@ // Libraries #include "NarrowPhaseAlgorithm.h" -#include "../constraint/Contact.h" -#include "../shapes/BoxShape.h" -#include "../mathematics/Transform.h" +#include "../../constraint/Contact.h" +#include "../../shapes/BoxShape.h" +#include "../../mathematics/Transform.h" // ReactPhysics3D namespace namespace reactphysics3d { diff --git a/src/engine/PhysicsEngine.h b/src/engine/PhysicsEngine.h index d461f07b..d48eea84 100644 --- a/src/engine/PhysicsEngine.h +++ b/src/engine/PhysicsEngine.h @@ -61,7 +61,6 @@ public : void start(); // Start the physics simulation void stop(); // Stop the physics simulation void update(); // Update the physics simulation - CollisionDetection& getCollisionDetection(); // TODO : DELETE THIS METHOD }; // --- Inline functions --- // @@ -73,12 +72,7 @@ inline void PhysicsEngine::start() { inline void PhysicsEngine::stop() { timer.stop(); -} - -// TODO : DELETE THIS METHOD -inline CollisionDetection& PhysicsEngine::getCollisionDetection() { - return collisionDetection; -} +} } diff --git a/src/shapes/BoxShape.h b/src/shapes/BoxShape.h index e67eac28..130e0e87 100644 --- a/src/shapes/BoxShape.h +++ b/src/shapes/BoxShape.h @@ -30,8 +30,6 @@ #include "Shape.h" #include "../mathematics/mathematics.h" -// TODO : CHECK THAT THE AABB IS CORRECT -// TODO : TEST THIS SHAPE WITH GJK AND EPA ALGORITHMS // ReactPhysics3D namespace namespace reactphysics3d {