From d97fc1b25fb704ccfdb4336c0f24758bb8759167 Mon Sep 17 00:00:00 2001 From: James Gangur Date: Sun, 21 Jun 2015 17:31:18 +0930 Subject: [PATCH 1/4] Fixed the TestbedApplication on case-sensitive systems --- testbed/src/TestbedApplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testbed/src/TestbedApplication.h b/testbed/src/TestbedApplication.h index 9843653c8..9173cb62c 100644 --- a/testbed/src/TestbedApplication.h +++ b/testbed/src/TestbedApplication.h @@ -28,7 +28,7 @@ // Libraries #include "openglframework.h" -#include "GUI.h" +#include "Gui.h" #include "Scene.h" #include "Timer.h" #include From 052e5aa107863ae8eedabf23c8af472f17e76265 Mon Sep 17 00:00:00 2001 From: James Gangur Date: Sun, 21 Jun 2015 17:54:17 +0930 Subject: [PATCH 2/4] Enable some warnings with CMake when building with g++ --- CMakeLists.txt | 6 ++++++ test/CMakeLists.txt | 6 ++++++ testbed/CMakeLists.txt | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 382168090..006602b9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,12 @@ IF (NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "Release") ENDIF (NOT CMAKE_BUILD_TYPE) +IF (CMAKE_BUILD_TYPE MATCHES "Debug") + IF (CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter") + ENDIF (CMAKE_COMPILER_IS_GNUCXX) +ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug") + # Where to build the library SET(LIBRARY_OUTPUT_PATH "lib") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ff69eb315..10db6fd15 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,6 +4,12 @@ cmake_minimum_required(VERSION 2.6) # Project configuration PROJECT(TESTS) +IF (CMAKE_BUILD_TYPE MATCHES "Debug") + IF (CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter") + ENDIF (CMAKE_COMPILER_IS_GNUCXX) +ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug") + # Headers INCLUDE_DIRECTORIES(${REACTPHYSICS3D_SOURCE_DIR}/test) diff --git a/testbed/CMakeLists.txt b/testbed/CMakeLists.txt index dd6faefc3..12bbea840 100644 --- a/testbed/CMakeLists.txt +++ b/testbed/CMakeLists.txt @@ -4,6 +4,12 @@ cmake_minimum_required(VERSION 2.6) # Project configuration PROJECT(Testbed) +IF (CMAKE_BUILD_TYPE MATCHES "Debug") + IF (CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter") + ENDIF (CMAKE_COMPILER_IS_GNUCXX) +ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug") + # Where to build the executables SET(EXECUTABLE_OUTPUT_PATH "${OUR_EXECUTABLE_OUTPUT_PATH}/testbed") SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) From 9e566db6af535bf87a0b97b90080d87abc46819b Mon Sep 17 00:00:00 2001 From: James Gangur Date: Sun, 21 Jun 2015 18:43:44 +0930 Subject: [PATCH 3/4] - Fixed all GCC warnings that don't have any actual effect on the program (sign compare, those asserts, reorder constructors, etc.) - Removed the casting to (char*) for (void*) arguments to GL. Not sure why you were doing that? --- src/body/CollisionBody.cpp | 3 -- .../narrowphase/EPA/EPAAlgorithm.cpp | 4 +-- .../narrowphase/EPA/TrianglesStore.h | 2 +- src/collision/narrowphase/GJK/Simplex.cpp | 8 ++--- src/collision/narrowphase/GJK/Simplex.h | 4 +-- src/collision/shapes/ConvexMeshShape.h | 7 ++--- src/constraint/ContactPoint.h | 8 ++--- src/constraint/Joint.h | 8 ++--- src/engine/ContactManifold.h | 2 +- src/engine/OverlappingPair.h | 8 ++--- test/Test.cpp | 2 +- testbed/common/Box.cpp | 2 +- testbed/common/Capsule.cpp | 10 +++---- testbed/common/Cone.cpp | 8 ++--- testbed/common/ConvexMesh.cpp | 30 +++++++++---------- testbed/common/Cylinder.cpp | 10 +++---- testbed/common/Dumbbell.cpp | 10 +++---- testbed/common/Sphere.cpp | 10 +++---- testbed/common/VisualContactPoint.cpp | 4 +-- testbed/common/VisualContactPoint.h | 1 + testbed/scenes/raycast/RaycastScene.cpp | 4 +-- testbed/src/Gui.cpp | 2 +- testbed/src/TestbedApplication.cpp | 2 +- 23 files changed, 72 insertions(+), 77 deletions(-) diff --git a/src/body/CollisionBody.cpp b/src/body/CollisionBody.cpp index 779cc747c..86b1f1dea 100644 --- a/src/body/CollisionBody.cpp +++ b/src/body/CollisionBody.cpp @@ -122,7 +122,6 @@ void CollisionBody::removeCollisionShape(const ProxyShape* proxyShape) { current->~ProxyShape(); mWorld.mMemoryAllocator.release(current, sizeof(ProxyShape)); mNbCollisionShapes--; - assert(mNbCollisionShapes >= 0); return; } @@ -150,8 +149,6 @@ void CollisionBody::removeCollisionShape(const ProxyShape* proxyShape) { // Get the next element in the list current = current->mNext; } - - assert(mNbCollisionShapes >= 0); } // Remove all the collision shapes diff --git a/src/collision/narrowphase/EPA/EPAAlgorithm.cpp b/src/collision/narrowphase/EPA/EPAAlgorithm.cpp index c41b51b6f..0312a1889 100644 --- a/src/collision/narrowphase/EPA/EPAAlgorithm.cpp +++ b/src/collision/narrowphase/EPA/EPAAlgorithm.cpp @@ -106,13 +106,13 @@ bool EPAAlgorithm::computePenetrationDepthAndContactPoints(const Simplex& simple transform1.getOrientation(); // Get the simplex computed previously by the GJK algorithm - unsigned int nbVertices = simplex.getSimplex(suppPointsA, suppPointsB, points); + uint nbVertices = simplex.getSimplex(suppPointsA, suppPointsB, points); // Compute the tolerance decimal tolerance = MACHINE_EPSILON * simplex.getMaxLengthSquareOfAPoint(); // Number of triangles in the polytope - unsigned int nbTriangles = 0; + uint nbTriangles = 0u; // Clear the storing of triangles triangleStore.clear(); diff --git a/src/collision/narrowphase/EPA/TrianglesStore.h b/src/collision/narrowphase/EPA/TrianglesStore.h index c066bb940..6f90b52c0 100644 --- a/src/collision/narrowphase/EPA/TrianglesStore.h +++ b/src/collision/narrowphase/EPA/TrianglesStore.h @@ -36,7 +36,7 @@ namespace reactphysics3d { // Constants -const unsigned int MAX_TRIANGLES = 200; // Maximum number of triangles +const unsigned int MAX_TRIANGLES = 200u; // Maximum number of triangles // Class TriangleStore /** diff --git a/src/collision/narrowphase/GJK/Simplex.cpp b/src/collision/narrowphase/GJK/Simplex.cpp index 2c4694296..1fb796ac1 100644 --- a/src/collision/narrowphase/GJK/Simplex.cpp +++ b/src/collision/narrowphase/GJK/Simplex.cpp @@ -57,7 +57,7 @@ void Simplex::addPoint(const Vector3& point, const Vector3& suppPointA, const Ve mLastFoundBit <<= 1; } - assert(mLastFound >= 0 && mLastFound < 4); + assert(mLastFound < 4u); // Add the point into the simplex mPoints[mLastFound] = point; @@ -112,9 +112,9 @@ void Simplex::updateCache() { } // Return the points of the simplex -unsigned int Simplex::getSimplex(Vector3* suppPointsA, Vector3* suppPointsB, - Vector3* points) const { - unsigned int nbVertices = 0; +uint Simplex::getSimplex(Vector3* suppPointsA, Vector3* suppPointsB, + Vector3* points) const { + uint nbVertices = 0u; int i; Bits bit; diff --git a/src/collision/narrowphase/GJK/Simplex.h b/src/collision/narrowphase/GJK/Simplex.h index 37db1b94a..23c2d469e 100644 --- a/src/collision/narrowphase/GJK/Simplex.h +++ b/src/collision/narrowphase/GJK/Simplex.h @@ -134,8 +134,8 @@ class Simplex { bool isEmpty() const; /// Return the points of the simplex - unsigned int getSimplex(Vector3* mSuppPointsA, Vector3* mSuppPointsB, - Vector3* mPoints) const; + uint getSimplex(Vector3* mSuppPointsA, Vector3* mSuppPointsB, + Vector3* mPoints) const; /// Return the maximum squared length of a point decimal getMaxLengthSquareOfAPoint() const; diff --git a/src/collision/shapes/ConvexMeshShape.h b/src/collision/shapes/ConvexMeshShape.h index 3f0b366ea..d3dbd1638 100644 --- a/src/collision/shapes/ConvexMeshShape.h +++ b/src/collision/shapes/ConvexMeshShape.h @@ -219,16 +219,13 @@ inline void ConvexMeshShape::addVertex(const Vector3& vertex) { */ inline void ConvexMeshShape::addEdge(uint v1, uint v2) { - assert(v1 >= 0); - assert(v2 >= 0); - // If the entry for vertex v1 does not exist in the adjacency list - if (mEdgesAdjacencyList.count(v1) == 0) { + if (mEdgesAdjacencyList.count(v1) == 0u) { mEdgesAdjacencyList.insert(std::make_pair(v1, std::set())); } // If the entry for vertex v2 does not exist in the adjacency list - if (mEdgesAdjacencyList.count(v2) == 0) { + if (mEdgesAdjacencyList.count(v2) == 0u) { mEdgesAdjacencyList.insert(std::make_pair(v2, std::set())); } diff --git a/src/constraint/ContactPoint.h b/src/constraint/ContactPoint.h index 9a1e18702..5f0d3aab6 100644 --- a/src/constraint/ContactPoint.h +++ b/src/constraint/ContactPoint.h @@ -158,10 +158,10 @@ class ContactPoint { ~ContactPoint(); /// Return the reference to the body 1 - CollisionBody* const getBody1() const; + CollisionBody* getBody1() const; /// Return the reference to the body 2 - CollisionBody* const getBody2() const; + CollisionBody* getBody2() const; /// Return the normal vector of the contact Vector3 getNormal() const; @@ -231,12 +231,12 @@ class ContactPoint { }; // Return the reference to the body 1 -inline CollisionBody* const ContactPoint::getBody1() const { +inline CollisionBody* ContactPoint::getBody1() const { return mBody1; } // Return the reference to the body 2 -inline CollisionBody* const ContactPoint::getBody2() const { +inline CollisionBody* ContactPoint::getBody2() const { return mBody2; } diff --git a/src/constraint/Joint.h b/src/constraint/Joint.h index bbca01683..c6600a821 100644 --- a/src/constraint/Joint.h +++ b/src/constraint/Joint.h @@ -181,10 +181,10 @@ class Joint { virtual ~Joint(); /// Return the reference to the body 1 - RigidBody* const getBody1() const; + RigidBody* getBody1() const; /// Return the reference to the body 2 - RigidBody* const getBody2() const; + RigidBody* getBody2() const; /// Return true if the constraint is active bool isActive() const; @@ -206,7 +206,7 @@ class Joint { /** * @return The first body involved in the joint */ -inline RigidBody* const Joint::getBody1() const { +inline RigidBody* Joint::getBody1() const { return mBody1; } @@ -214,7 +214,7 @@ inline RigidBody* const Joint::getBody1() const { /** * @return The second body involved in the joint */ -inline RigidBody* const Joint::getBody2() const { +inline RigidBody* Joint::getBody2() const { return mBody2; } diff --git a/src/engine/ContactManifold.h b/src/engine/ContactManifold.h index ac661525a..2468d9ce1 100644 --- a/src/engine/ContactManifold.h +++ b/src/engine/ContactManifold.h @@ -297,7 +297,7 @@ inline void ContactManifold::setFrictionTwistImpulse(decimal frictionTwistImpuls // Return a contact point of the manifold inline ContactPoint* ContactManifold::getContactPoint(uint index) const { - assert(index >= 0 && index < mNbContactPoints); + assert(index < mNbContactPoints); return mContactPoints[index]; } diff --git a/src/engine/OverlappingPair.h b/src/engine/OverlappingPair.h index c701bd5fb..da16d6e4d 100644 --- a/src/engine/OverlappingPair.h +++ b/src/engine/OverlappingPair.h @@ -82,10 +82,10 @@ class OverlappingPair { ~OverlappingPair(); /// Return the pointer to first proxy collision shape - ProxyShape* const getShape1() const; + ProxyShape* getShape1() const; /// Return the pointer to second body - ProxyShape* const getShape2() const; + ProxyShape* getShape2() const; /// Add a contact to the contact cache void addContact(ContactPoint* contact); @@ -120,12 +120,12 @@ class OverlappingPair { }; // Return the pointer to first body -inline ProxyShape* const OverlappingPair::getShape1() const { +inline ProxyShape* OverlappingPair::getShape1() const { return mShape1; } // Return the pointer to second body -inline ProxyShape* const OverlappingPair::getShape2() const { +inline ProxyShape* OverlappingPair::getShape2() const { return mShape2; } diff --git a/test/Test.cpp b/test/Test.cpp index 45adea73b..ef7a404d9 100644 --- a/test/Test.cpp +++ b/test/Test.cpp @@ -32,7 +32,7 @@ using namespace reactphysics3d; /// Constructor Test::Test(const std::string& name, std::ostream* stream) - : mName(name), mOutputStream(stream), mNbPassedTests(0), mNbFailedTests(0) { + : mName(name), mNbPassedTests(0), mNbFailedTests(0), mOutputStream(stream) { } diff --git a/testbed/common/Box.cpp b/testbed/common/Box.cpp index 4eefdf9e1..e9ad2145c 100644 --- a/testbed/common/Box.cpp +++ b/testbed/common/Box.cpp @@ -189,7 +189,7 @@ void Box::render(openglframework::Shader& shader, mVAO.bind(); // Draw the geometry of the box - glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_INT, (char*)NULL); + glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_INT, NULL); // Unbind the VAO mVAO.unbind(); diff --git a/testbed/common/Capsule.cpp b/testbed/common/Capsule.cpp index 186970fff..1925e9d57 100644 --- a/testbed/common/Capsule.cpp +++ b/testbed/common/Capsule.cpp @@ -160,8 +160,8 @@ void Capsule::render(openglframework::Shader& shader, mVAO.bind(); // For each part of the mesh - for (unsigned int i=0; i(mVertices[i].x); vertices[3 * i + 1] = static_cast(mVertices[i].y); vertices[3 * i + 2] = static_cast(mVertices[i].z); @@ -63,12 +63,12 @@ ConvexMesh::ConvexMesh(const openglframework::Vector3 &position, // Add the edges information of the mesh into the convex mesh collision shape. // This is optional but it really speed up the convex mesh collision detection at the // cost of some additional memory to store the edges inside the collision shape. - for (unsigned int i=0; i(mVertices[i].x); vertices[3 * i + 1] = static_cast(mVertices[i].y); vertices[3 * i + 2] = static_cast(mVertices[i].z); @@ -129,12 +129,12 @@ ConvexMesh::ConvexMesh(const openglframework::Vector3 &position, float mass, // Add the edges information of the mesh into the convex mesh collision shape. // This is optional but it really speed up the convex mesh collision detection at the // cost of some additional memory to store the edges inside the collision shape. - for (unsigned int i=0; i scenes = app.getScenes(); // For each scene - for (int i=0; igetName().c_str(), &choice, i); diff --git a/testbed/src/TestbedApplication.cpp b/testbed/src/TestbedApplication.cpp index d58150d0f..29d3c827b 100644 --- a/testbed/src/TestbedApplication.cpp +++ b/testbed/src/TestbedApplication.cpp @@ -168,7 +168,7 @@ void TestbedApplication::createScenes() { // Remove all the scenes void TestbedApplication::destroyScenes() { - for (int i=0; i Date: Sun, 21 Jun 2015 23:23:40 +0930 Subject: [PATCH 4/4] Rearranged the entire source tree. There is now a seperate include directory, containing a reactphysics3d subdirectory, where the headers live. This greatly eases intergration of the library into other projects, as well as prevent naming confilcts. All reactphysics3d source and headers have been modified to use the new paths. The testbed application has not been changed, as this will not break existing client code. Fixed a couple of comments, formatting issues, etc that I happened to come across. --- CMakeLists.txt | 208 +++++++++--------- {src => include/reactphysics3d}/body/Body.h | 6 +- .../reactphysics3d}/body/CollisionBody.h | 20 +- .../reactphysics3d}/body/RigidBody.h | 10 +- .../collision/CollisionDetection.h | 20 +- .../reactphysics3d}/collision/ProxyShape.h | 7 +- .../reactphysics3d}/collision/RaycastInfo.h | 6 +- .../broadphase/BroadPhaseAlgorithm.h | 8 +- .../collision/broadphase/DynamicAABBTree.h | 8 +- .../collision/narrowphase/EPA/EPAAlgorithm.h | 16 +- .../collision/narrowphase/EPA/EdgeEPA.h | 5 +- .../collision/narrowphase/EPA/TriangleEPA.h | 8 +- .../narrowphase/EPA/TrianglesStore.h | 6 +- .../collision/narrowphase/GJK/GJKAlgorithm.h | 11 +- .../collision/narrowphase/GJK/Simplex.h | 4 +- .../narrowphase/NarrowPhaseAlgorithm.h | 10 +- .../narrowphase/SphereVsSphereAlgorithm.h | 9 +- .../reactphysics3d}/collision/shapes/AABB.h | 4 +- .../collision/shapes/BoxShape.h | 9 +- .../collision/shapes/CapsuleShape.h | 8 +- .../collision/shapes/CollisionShape.h | 16 +- .../collision/shapes/ConeShape.h | 8 +- .../collision/shapes/ConvexMeshShape.h | 14 +- .../collision/shapes/CylinderShape.h | 9 +- .../collision/shapes/SphereShape.h | 8 +- .../reactphysics3d}/configuration.h | 6 +- .../constraint/BallAndSocketJoint.h | 5 +- .../reactphysics3d}/constraint/ContactPoint.h | 9 +- .../reactphysics3d}/constraint/FixedJoint.h | 5 +- .../reactphysics3d}/constraint/HingeJoint.h | 5 +- .../reactphysics3d}/constraint/Joint.h | 8 +- .../reactphysics3d}/constraint/SliderJoint.h | 5 +- {src => include/reactphysics3d}/decimal.h | 2 +- .../reactphysics3d}/engine/CollisionWorld.h | 30 +-- .../reactphysics3d}/engine/ConstraintSolver.h | 9 +- .../reactphysics3d}/engine/ContactManifold.h | 10 +- .../reactphysics3d}/engine/ContactSolver.h | 19 +- .../reactphysics3d}/engine/DynamicsWorld.h | 18 +- .../reactphysics3d}/engine/EventListener.h | 3 +- .../reactphysics3d}/engine/Impulse.h | 3 +- .../reactphysics3d}/engine/Island.h | 9 +- .../reactphysics3d}/engine/Material.h | 3 +- .../reactphysics3d}/engine/OverlappingPair.h | 8 +- .../reactphysics3d}/engine/Profiler.h | 4 +- .../reactphysics3d}/mathematics/Matrix2x2.h | 4 +- .../reactphysics3d}/mathematics/Matrix3x3.h | 5 +- .../reactphysics3d}/mathematics/Quaternion.h | 8 +- .../reactphysics3d}/mathematics/Ray.h | 4 +- .../reactphysics3d}/mathematics/Transform.h | 8 +- .../reactphysics3d}/mathematics/Vector2.h | 7 +- .../reactphysics3d}/mathematics/Vector3.h | 7 +- .../reactphysics3d}/mathematics/mathematics.h | 22 +- .../mathematics/mathematics_functions.h | 6 +- .../reactphysics3d}/memory/MemoryAllocator.h | 4 +- .../reactphysics3d}/memory/Stack.h | 3 +- .../reactphysics3d}/reactphysics3d.h | 44 ++-- src/{ => reactphysics3d}/body/Body.cpp | 5 +- .../body/CollisionBody.cpp | 9 +- src/{ => reactphysics3d}/body/RigidBody.cpp | 9 +- .../collision/CollisionDetection.cpp | 25 +-- .../collision/ProxyShape.cpp | 2 +- .../collision/RaycastInfo.cpp | 6 +- .../broadphase/BroadPhaseAlgorithm.cpp | 7 +- .../collision/broadphase/DynamicAABBTree.cpp | 8 +- .../narrowphase/EPA/EPAAlgorithm.cpp | 7 +- .../collision/narrowphase/EPA/EdgeEPA.cpp | 8 +- .../collision/narrowphase/EPA/TriangleEPA.cpp | 8 +- .../narrowphase/EPA/TrianglesStore.cpp | 3 +- .../narrowphase/GJK/GJKAlgorithm.cpp | 11 +- .../collision/narrowphase/GJK/Simplex.cpp | 3 +- .../narrowphase/NarrowPhaseAlgorithm.cpp | 3 +- .../narrowphase/SphereVsSphereAlgorithm.cpp | 5 +- .../collision/shapes/AABB.cpp | 5 +- .../collision/shapes/BoxShape.cpp | 8 +- .../collision/shapes/CapsuleShape.cpp | 6 +- .../collision/shapes/CollisionShape.cpp | 7 +- .../collision/shapes/ConeShape.cpp | 6 +- .../collision/shapes/ConvexMeshShape.cpp | 4 +- .../collision/shapes/CylinderShape.cpp | 6 +- .../collision/shapes/SphereShape.cpp | 6 +- .../constraint/BallAndSocketJoint.cpp | 4 +- .../constraint/ContactPoint.cpp | 5 +- .../constraint/FixedJoint.cpp | 4 +- .../constraint/HingeJoint.cpp | 4 +- src/{ => reactphysics3d}/constraint/Joint.cpp | 2 +- .../constraint/SliderJoint.cpp | 2 +- .../engine/CollisionWorld.cpp | 3 +- .../engine/ConstraintSolver.cpp | 4 +- .../engine/ContactManifold.cpp | 3 +- .../engine/ContactSolver.cpp | 11 +- .../engine/DynamicsWorld.cpp | 11 +- src/{ => reactphysics3d}/engine/Island.cpp | 2 +- src/{ => reactphysics3d}/engine/Material.cpp | 2 +- .../engine/OverlappingPair.cpp | 3 +- src/{ => reactphysics3d}/engine/Profiler.cpp | 0 .../mathematics/Matrix2x2.cpp | 3 +- .../mathematics/Matrix3x3.cpp | 4 +- .../mathematics/Quaternion.cpp | 5 +- .../mathematics/Transform.cpp | 3 +- .../mathematics/Vector2.cpp | 4 +- .../mathematics/Vector3.cpp | 7 +- .../memory/MemoryAllocator.cpp | 4 +- testbed/CMakeLists.txt | 3 +- 103 files changed, 475 insertions(+), 506 deletions(-) rename {src => include/reactphysics3d}/body/Body.h (99%) rename {src => include/reactphysics3d}/body/CollisionBody.h (96%) rename {src => include/reactphysics3d}/body/RigidBody.h (98%) rename {src => include/reactphysics3d}/collision/CollisionDetection.h (96%) rename {src => include/reactphysics3d}/collision/ProxyShape.h (98%) rename {src => include/reactphysics3d}/collision/RaycastInfo.h (97%) rename {src => include/reactphysics3d}/collision/broadphase/BroadPhaseAlgorithm.h (97%) rename {src => include/reactphysics3d}/collision/broadphase/DynamicAABBTree.h (97%) rename {src => include/reactphysics3d}/collision/narrowphase/EPA/EPAAlgorithm.h (94%) rename {src => include/reactphysics3d}/collision/narrowphase/EPA/EdgeEPA.h (98%) rename {src => include/reactphysics3d}/collision/narrowphase/EPA/TriangleEPA.h (97%) rename {src => include/reactphysics3d}/collision/narrowphase/EPA/TrianglesStore.h (97%) rename {src => include/reactphysics3d}/collision/narrowphase/GJK/GJKAlgorithm.h (94%) rename {src => include/reactphysics3d}/collision/narrowphase/GJK/Simplex.h (98%) rename {src => include/reactphysics3d}/collision/narrowphase/NarrowPhaseAlgorithm.h (94%) rename {src => include/reactphysics3d}/collision/narrowphase/SphereVsSphereAlgorithm.h (94%) rename {src => include/reactphysics3d}/collision/shapes/AABB.h (98%) rename {src => include/reactphysics3d}/collision/shapes/BoxShape.h (97%) rename {src => include/reactphysics3d}/collision/shapes/CapsuleShape.h (97%) rename {src => include/reactphysics3d}/collision/shapes/CollisionShape.h (95%) rename {src => include/reactphysics3d}/collision/shapes/ConeShape.h (97%) rename {src => include/reactphysics3d}/collision/shapes/ConvexMeshShape.h (97%) rename {src => include/reactphysics3d}/collision/shapes/CylinderShape.h (97%) rename {src => include/reactphysics3d}/collision/shapes/SphereShape.h (97%) rename {src => include/reactphysics3d}/configuration.h (98%) rename {src => include/reactphysics3d}/constraint/BallAndSocketJoint.h (97%) rename {src => include/reactphysics3d}/constraint/ContactPoint.h (98%) rename {src => include/reactphysics3d}/constraint/FixedJoint.h (98%) rename {src => include/reactphysics3d}/constraint/HingeJoint.h (99%) rename {src => include/reactphysics3d}/constraint/Joint.h (98%) rename {src => include/reactphysics3d}/constraint/SliderJoint.h (99%) rename {src => include/reactphysics3d}/decimal.h (98%) rename {src => include/reactphysics3d}/engine/CollisionWorld.h (94%) rename {src => include/reactphysics3d}/engine/ConstraintSolver.h (98%) rename {src => include/reactphysics3d}/engine/ContactManifold.h (98%) rename {src => include/reactphysics3d}/engine/ContactSolver.h (98%) rename {src => include/reactphysics3d}/engine/DynamicsWorld.h (98%) rename {src => include/reactphysics3d}/engine/EventListener.h (97%) rename {src => include/reactphysics3d}/engine/Impulse.h (97%) rename {src => include/reactphysics3d}/engine/Island.h (96%) rename {src => include/reactphysics3d}/engine/Material.h (98%) rename {src => include/reactphysics3d}/engine/OverlappingPair.h (97%) rename {src => include/reactphysics3d}/engine/Profiler.h (99%) rename {src => include/reactphysics3d}/mathematics/Matrix2x2.h (99%) rename {src => include/reactphysics3d}/mathematics/Matrix3x3.h (99%) rename {src => include/reactphysics3d}/mathematics/Quaternion.h (98%) rename {src => include/reactphysics3d}/mathematics/Ray.h (97%) rename {src => include/reactphysics3d}/mathematics/Transform.h (97%) rename {src => include/reactphysics3d}/mathematics/Vector2.h (98%) rename {src => include/reactphysics3d}/mathematics/Vector3.h (98%) rename {src => include/reactphysics3d}/mathematics/mathematics.h (82%) rename {src => include/reactphysics3d}/mathematics/mathematics_functions.h (96%) rename {src => include/reactphysics3d}/memory/MemoryAllocator.h (98%) rename {src => include/reactphysics3d}/memory/Stack.h (98%) rename {src => include/reactphysics3d}/reactphysics3d.h (69%) rename src/{ => reactphysics3d}/body/Body.cpp (95%) rename src/{ => reactphysics3d}/body/CollisionBody.cpp (98%) rename src/{ => reactphysics3d}/body/RigidBody.cpp (98%) rename src/{ => reactphysics3d}/collision/CollisionDetection.cpp (97%) rename src/{ => reactphysics3d}/collision/ProxyShape.cpp (98%) rename src/{ => reactphysics3d}/collision/RaycastInfo.cpp (94%) rename src/{ => reactphysics3d}/collision/broadphase/BroadPhaseAlgorithm.cpp (98%) rename src/{ => reactphysics3d}/collision/broadphase/DynamicAABBTree.cpp (99%) rename src/{ => reactphysics3d}/collision/narrowphase/EPA/EPAAlgorithm.cpp (99%) rename src/{ => reactphysics3d}/collision/narrowphase/EPA/EdgeEPA.cpp (96%) rename src/{ => reactphysics3d}/collision/narrowphase/EPA/TriangleEPA.cpp (97%) rename src/{ => reactphysics3d}/collision/narrowphase/EPA/TrianglesStore.cpp (96%) rename src/{ => reactphysics3d}/collision/narrowphase/GJK/GJKAlgorithm.cpp (98%) rename src/{ => reactphysics3d}/collision/narrowphase/GJK/Simplex.cpp (99%) rename src/{ => reactphysics3d}/collision/narrowphase/NarrowPhaseAlgorithm.cpp (96%) rename src/{ => reactphysics3d}/collision/narrowphase/SphereVsSphereAlgorithm.cpp (97%) rename src/{ => reactphysics3d}/collision/shapes/AABB.cpp (97%) rename src/{ => reactphysics3d}/collision/shapes/BoxShape.cpp (97%) rename src/{ => reactphysics3d}/collision/shapes/CapsuleShape.cpp (99%) rename src/{ => reactphysics3d}/collision/shapes/CollisionShape.cpp (96%) rename src/{ => reactphysics3d}/collision/shapes/ConeShape.cpp (98%) rename src/{ => reactphysics3d}/collision/shapes/ConvexMeshShape.cpp (99%) rename src/{ => reactphysics3d}/collision/shapes/CylinderShape.cpp (98%) rename src/{ => reactphysics3d}/collision/shapes/SphereShape.cpp (96%) rename src/{ => reactphysics3d}/constraint/BallAndSocketJoint.cpp (98%) rename src/{ => reactphysics3d}/constraint/ContactPoint.cpp (96%) rename src/{ => reactphysics3d}/constraint/FixedJoint.cpp (99%) rename src/{ => reactphysics3d}/constraint/HingeJoint.cpp (99%) rename src/{ => reactphysics3d}/constraint/Joint.cpp (98%) rename src/{ => reactphysics3d}/constraint/SliderJoint.cpp (99%) rename src/{ => reactphysics3d}/engine/CollisionWorld.cpp (99%) rename src/{ => reactphysics3d}/engine/ConstraintSolver.cpp (97%) rename src/{ => reactphysics3d}/engine/ContactManifold.cpp (99%) rename src/{ => reactphysics3d}/engine/ContactSolver.cpp (99%) rename src/{ => reactphysics3d}/engine/DynamicsWorld.cpp (99%) rename src/{ => reactphysics3d}/engine/Island.cpp (98%) rename src/{ => reactphysics3d}/engine/Material.cpp (98%) rename src/{ => reactphysics3d}/engine/OverlappingPair.cpp (97%) rename src/{ => reactphysics3d}/engine/Profiler.cpp (100%) rename src/{ => reactphysics3d}/mathematics/Matrix2x2.cpp (98%) rename src/{ => reactphysics3d}/mathematics/Matrix3x3.cpp (98%) rename src/{ => reactphysics3d}/mathematics/Quaternion.cpp (98%) rename src/{ => reactphysics3d}/mathematics/Transform.cpp (98%) rename src/{ => reactphysics3d}/mathematics/Vector2.cpp (98%) rename src/{ => reactphysics3d}/mathematics/Vector3.cpp (96%) rename src/{ => reactphysics3d}/memory/MemoryAllocator.cpp (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 006602b9b..b6a8cd23b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ OPTION(PROFILING_ENABLED "Select this if you want to compile with enabled profil OPTION(DOUBLE_PRECISION_ENABLED "Select this if you want to compile using double precision floating values" OFF) # Headers -INCLUDE_DIRECTORIES(src) +INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/include") IF(PROFILING_ENABLED) ADD_DEFINITIONS(-DIS_PROFILING_ACTIVE) @@ -38,109 +38,113 @@ IF(DOUBLE_PRECISION_ENABLED) ADD_DEFINITIONS(-DIS_DOUBLE_PRECISION_ENABLED) ENDIF(DOUBLE_PRECISION_ENABLED) +SET(SRCDIR "${PROJECT_SOURCE_DIR}/src/reactphysics3d") +set(INCDIR "${PROJECT_SOURCE_DIR}/include/reactphysics3d") + # Source files SET (REACTPHYSICS3D_SOURCES - "src/configuration.h" - "src/decimal.h" - "src/reactphysics3d.h" - "src/body/Body.h" - "src/body/Body.cpp" - "src/body/CollisionBody.h" - "src/body/CollisionBody.cpp" - "src/body/RigidBody.h" - "src/body/RigidBody.cpp" - "src/collision/broadphase/BroadPhaseAlgorithm.h" - "src/collision/broadphase/BroadPhaseAlgorithm.cpp" - "src/collision/broadphase/DynamicAABBTree.h" - "src/collision/broadphase/DynamicAABBTree.cpp" - "src/collision/narrowphase/EPA/EdgeEPA.h" - "src/collision/narrowphase/EPA/EdgeEPA.cpp" - "src/collision/narrowphase/EPA/EPAAlgorithm.h" - "src/collision/narrowphase/EPA/EPAAlgorithm.cpp" - "src/collision/narrowphase/EPA/TriangleEPA.h" - "src/collision/narrowphase/EPA/TriangleEPA.cpp" - "src/collision/narrowphase/EPA/TrianglesStore.h" - "src/collision/narrowphase/EPA/TrianglesStore.cpp" - "src/collision/narrowphase/GJK/Simplex.h" - "src/collision/narrowphase/GJK/Simplex.cpp" - "src/collision/narrowphase/GJK/GJKAlgorithm.h" - "src/collision/narrowphase/GJK/GJKAlgorithm.cpp" - "src/collision/narrowphase/NarrowPhaseAlgorithm.h" - "src/collision/narrowphase/NarrowPhaseAlgorithm.cpp" - "src/collision/narrowphase/SphereVsSphereAlgorithm.h" - "src/collision/narrowphase/SphereVsSphereAlgorithm.cpp" - "src/collision/shapes/AABB.h" - "src/collision/shapes/AABB.cpp" - "src/collision/shapes/BoxShape.h" - "src/collision/shapes/BoxShape.cpp" - "src/collision/shapes/CapsuleShape.h" - "src/collision/shapes/CapsuleShape.cpp" - "src/collision/shapes/CollisionShape.h" - "src/collision/shapes/CollisionShape.cpp" - "src/collision/shapes/ConeShape.h" - "src/collision/shapes/ConeShape.cpp" - "src/collision/shapes/ConvexMeshShape.h" - "src/collision/shapes/ConvexMeshShape.cpp" - "src/collision/shapes/CylinderShape.h" - "src/collision/shapes/CylinderShape.cpp" - "src/collision/shapes/SphereShape.h" - "src/collision/shapes/SphereShape.cpp" - "src/collision/RaycastInfo.h" - "src/collision/RaycastInfo.cpp" - "src/collision/ProxyShape.h" - "src/collision/ProxyShape.cpp" - "src/collision/CollisionDetection.h" - "src/collision/CollisionDetection.cpp" - "src/constraint/BallAndSocketJoint.h" - "src/constraint/BallAndSocketJoint.cpp" - "src/constraint/ContactPoint.h" - "src/constraint/ContactPoint.cpp" - "src/constraint/FixedJoint.h" - "src/constraint/FixedJoint.cpp" - "src/constraint/HingeJoint.h" - "src/constraint/HingeJoint.cpp" - "src/constraint/Joint.h" - "src/constraint/Joint.cpp" - "src/constraint/SliderJoint.h" - "src/constraint/SliderJoint.cpp" - "src/engine/CollisionWorld.h" - "src/engine/CollisionWorld.cpp" - "src/engine/ConstraintSolver.h" - "src/engine/ConstraintSolver.cpp" - "src/engine/ContactManifold.h" - "src/engine/ContactManifold.cpp" - "src/engine/ContactSolver.h" - "src/engine/ContactSolver.cpp" - "src/engine/DynamicsWorld.h" - "src/engine/DynamicsWorld.cpp" - "src/engine/EventListener.h" - "src/engine/Impulse.h" - "src/engine/Island.h" - "src/engine/Island.cpp" - "src/engine/Material.h" - "src/engine/Material.cpp" - "src/engine/OverlappingPair.h" - "src/engine/OverlappingPair.cpp" - "src/engine/Profiler.h" - "src/engine/Profiler.cpp" - "src/mathematics/mathematics.h" - "src/mathematics/mathematics_functions.h" - "src/mathematics/Matrix2x2.h" - "src/mathematics/Matrix2x2.cpp" - "src/mathematics/Matrix3x3.h" - "src/mathematics/Matrix3x3.cpp" - "src/mathematics/Quaternion.h" - "src/mathematics/Quaternion.cpp" - "src/mathematics/Transform.h" - "src/mathematics/Transform.cpp" - "src/mathematics/Vector2.h" - "src/mathematics/Vector2.cpp" - "src/mathematics/Vector3.h" - "src/mathematics/Ray.h" - "src/mathematics/Vector3.cpp" - "src/memory/MemoryAllocator.h" - "src/memory/MemoryAllocator.cpp" - "src/memory/Stack.h" + "${INCDIR}/configuration.h" + "${INCDIR}/decimal.h" + "${INCDIR}/reactphysics3d.h" + "${INCDIR}/body/Body.h" + "${INCDIR}/body/CollisionBody.h" + "${INCDIR}/body/RigidBody.h" + "${INCDIR}/collision/broadphase/BroadPhaseAlgorithm.h" + "${INCDIR}/collision/broadphase/DynamicAABBTree.h" + "${INCDIR}/collision/narrowphase/EPA/EdgeEPA.h" + "${INCDIR}/collision/narrowphase/EPA/EPAAlgorithm.h" + "${INCDIR}/collision/narrowphase/EPA/TriangleEPA.h" + "${INCDIR}/collision/narrowphase/EPA/TrianglesStore.h" + "${INCDIR}/collision/narrowphase/GJK/Simplex.h" + "${INCDIR}/collision/narrowphase/GJK/GJKAlgorithm.h" + "${INCDIR}/collision/narrowphase/NarrowPhaseAlgorithm.h" + "${INCDIR}/collision/narrowphase/SphereVsSphereAlgorithm.h" + "${INCDIR}/collision/shapes/AABB.h" + "${INCDIR}/collision/shapes/BoxShape.h" + "${INCDIR}/collision/shapes/CapsuleShape.h" + "${INCDIR}/collision/shapes/CollisionShape.h" + "${INCDIR}/collision/shapes/ConeShape.h" + "${INCDIR}/collision/shapes/ConvexMeshShape.h" + "${INCDIR}/collision/shapes/CylinderShape.h" + "${INCDIR}/collision/shapes/SphereShape.h" + "${INCDIR}/collision/RaycastInfo.h" + "${INCDIR}/collision/ProxyShape.h" + "${INCDIR}/collision/CollisionDetection.h" + "${INCDIR}/constraint/BallAndSocketJoint.h" + "${INCDIR}/constraint/ContactPoint.h" + "${INCDIR}/constraint/FixedJoint.h" + "${INCDIR}/constraint/HingeJoint.h" + "${INCDIR}/constraint/Joint.h" + "${INCDIR}/constraint/SliderJoint.h" + "${INCDIR}/engine/CollisionWorld.h" + "${INCDIR}/engine/ConstraintSolver.h" + "${INCDIR}/engine/ContactManifold.h" + "${INCDIR}/engine/ContactSolver.h" + "${INCDIR}/engine/DynamicsWorld.h" + "${INCDIR}/engine/EventListener.h" + "${INCDIR}/engine/Impulse.h" + "${INCDIR}/engine/Island.h" + "${INCDIR}/engine/Material.h" + "${INCDIR}/engine/OverlappingPair.h" + "${INCDIR}/engine/Profiler.h" + "${INCDIR}/mathematics/mathematics.h" + "${INCDIR}/mathematics/mathematics_functions.h" + "${INCDIR}/mathematics/Matrix2x2.h" + "${INCDIR}/mathematics/Matrix3x3.h" + "${INCDIR}/mathematics/Quaternion.h" + "${INCDIR}/mathematics/Transform.h" + "${INCDIR}/mathematics/Vector2.h" + "${INCDIR}/mathematics/Vector3.h" + "${INCDIR}/mathematics/Ray.h" + "${INCDIR}/memory/MemoryAllocator.h" + "${INCDIR}/memory/Stack.h" + + "${SRCDIR}/body/Body.cpp" + "${SRCDIR}/body/CollisionBody.cpp" + "${SRCDIR}/body/RigidBody.cpp" + "${SRCDIR}/collision/broadphase/BroadPhaseAlgorithm.cpp" + "${SRCDIR}/collision/broadphase/DynamicAABBTree.cpp" + "${SRCDIR}/collision/narrowphase/EPA/EdgeEPA.cpp" + "${SRCDIR}/collision/narrowphase/EPA/EPAAlgorithm.cpp" + "${SRCDIR}/collision/narrowphase/EPA/TriangleEPA.cpp" + "${SRCDIR}/collision/narrowphase/EPA/TrianglesStore.cpp" + "${SRCDIR}/collision/narrowphase/GJK/Simplex.cpp" + "${SRCDIR}/collision/narrowphase/GJK/GJKAlgorithm.cpp" + "${SRCDIR}/collision/narrowphase/NarrowPhaseAlgorithm.cpp" + "${SRCDIR}/collision/narrowphase/SphereVsSphereAlgorithm.cpp" + "${SRCDIR}/collision/shapes/AABB.cpp" + "${SRCDIR}/collision/shapes/BoxShape.cpp" + "${SRCDIR}/collision/shapes/CapsuleShape.cpp" + "${SRCDIR}/collision/shapes/CollisionShape.cpp" + "${SRCDIR}/collision/shapes/ConeShape.cpp" + "${SRCDIR}/collision/shapes/ConvexMeshShape.cpp" + "${SRCDIR}/collision/shapes/CylinderShape.cpp" + "${SRCDIR}/collision/shapes/SphereShape.cpp" + "${SRCDIR}/collision/RaycastInfo.cpp" + "${SRCDIR}/collision/ProxyShape.cpp" + "${SRCDIR}/collision/CollisionDetection.cpp" + "${SRCDIR}/constraint/BallAndSocketJoint.cpp" + "${SRCDIR}/constraint/ContactPoint.cpp" + "${SRCDIR}/constraint/FixedJoint.cpp" + "${SRCDIR}/constraint/HingeJoint.cpp" + "${SRCDIR}/constraint/Joint.cpp" + "${SRCDIR}/constraint/SliderJoint.cpp" + "${SRCDIR}/engine/CollisionWorld.cpp" + "${SRCDIR}/engine/ConstraintSolver.cpp" + "${SRCDIR}/engine/ContactManifold.cpp" + "${SRCDIR}/engine/ContactSolver.cpp" + "${SRCDIR}/engine/DynamicsWorld.cpp" + "${SRCDIR}/engine/Island.cpp" + "${SRCDIR}/engine/Material.cpp" + "${SRCDIR}/engine/OverlappingPair.cpp" + "${SRCDIR}/engine/Profiler.cpp" + "${SRCDIR}/mathematics/Matrix2x2.cpp" + "${SRCDIR}/mathematics/Matrix3x3.cpp" + "${SRCDIR}/mathematics/Quaternion.cpp" + "${SRCDIR}/mathematics/Transform.cpp" + "${SRCDIR}/mathematics/Vector2.cpp" + "${SRCDIR}/mathematics/Vector3.cpp" + "${SRCDIR}/memory/MemoryAllocator.cpp" ) # Create the library diff --git a/src/body/Body.h b/include/reactphysics3d/body/Body.h similarity index 99% rename from src/body/Body.h rename to include/reactphysics3d/body/Body.h index 946aa61fd..27850d91a 100644 --- a/src/body/Body.h +++ b/include/reactphysics3d/body/Body.h @@ -27,11 +27,11 @@ #define REACTPHYSICS3D_BODY_H // Libraries -#include #include -#include "configuration.h" +#include +#include "reactphysics3d/configuration.h" -/// Namespace reactphysics3d +/// ReactPhysics3D Namespace namespace reactphysics3d { // TODO : Make this class abstract diff --git a/src/body/CollisionBody.h b/include/reactphysics3d/body/CollisionBody.h similarity index 96% rename from src/body/CollisionBody.h rename to include/reactphysics3d/body/CollisionBody.h index 819584b52..9a170dbd1 100644 --- a/src/body/CollisionBody.h +++ b/include/reactphysics3d/body/CollisionBody.h @@ -27,17 +27,17 @@ #define REACTPHYSICS3D_COLLISION_BODY_H // Libraries -#include #include -#include "Body.h" -#include "mathematics/Transform.h" -#include "collision/shapes/AABB.h" -#include "collision/shapes/CollisionShape.h" -#include "collision/RaycastInfo.h" -#include "memory/MemoryAllocator.h" -#include "configuration.h" - -/// Namespace reactphysics3d +#include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/body/Body.h" +#include "reactphysics3d/collision/shapes/AABB.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/collision/RaycastInfo.h" +#include "reactphysics3d/mathematics/Transform.h" +#include "reactphysics3d/memory/MemoryAllocator.h" + +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class declarations diff --git a/src/body/RigidBody.h b/include/reactphysics3d/body/RigidBody.h similarity index 98% rename from src/body/RigidBody.h rename to include/reactphysics3d/body/RigidBody.h index 964fa2867..f3caef764 100644 --- a/src/body/RigidBody.h +++ b/include/reactphysics3d/body/RigidBody.h @@ -28,12 +28,12 @@ // Libraries #include -#include "CollisionBody.h" -#include "engine/Material.h" -#include "mathematics/mathematics.h" -#include "memory/MemoryAllocator.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/engine/Material.h" +#include "reactphysics3d/mathematics/mathematics.h" +#include "reactphysics3d/memory/MemoryAllocator.h" -/// Namespace reactphysics3d +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class declarations diff --git a/src/collision/CollisionDetection.h b/include/reactphysics3d/collision/CollisionDetection.h similarity index 96% rename from src/collision/CollisionDetection.h rename to include/reactphysics3d/collision/CollisionDetection.h index 53ca5873b..7d136b08a 100644 --- a/src/collision/CollisionDetection.h +++ b/include/reactphysics3d/collision/CollisionDetection.h @@ -27,19 +27,19 @@ #define REACTPHYSICS3D_COLLISION_DETECTION_H // Libraries -#include "body/CollisionBody.h" -#include "broadphase/BroadPhaseAlgorithm.h" -#include "engine/OverlappingPair.h" -#include "narrowphase/GJK/GJKAlgorithm.h" -#include "narrowphase/SphereVsSphereAlgorithm.h" -#include "memory/MemoryAllocator.h" -#include "constraint/ContactPoint.h" -#include #include #include #include - -/// ReactPhysics3D namespace +#include +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/broadphase/BroadPhaseAlgorithm.h" +#include "reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.h" +#include "reactphysics3d/collision/narrowphase/SphereVsSphereAlgorithm.h" +#include "reactphysics3d/constraint/ContactPoint.h" +#include "reactphysics3d/engine/OverlappingPair.h" +#include "reactphysics3d/memory/MemoryAllocator.h" + +/// ReactPhysics3D Namespace namespace reactphysics3d { // Declarations diff --git a/src/collision/ProxyShape.h b/include/reactphysics3d/collision/ProxyShape.h similarity index 98% rename from src/collision/ProxyShape.h rename to include/reactphysics3d/collision/ProxyShape.h index 0e9e4224e..eff5051cf 100644 --- a/src/collision/ProxyShape.h +++ b/include/reactphysics3d/collision/ProxyShape.h @@ -27,10 +27,11 @@ #define REACTPHYSICS3D_PROXY_SHAPE_H // Libraries -#include "body/CollisionBody.h" -#include "shapes/CollisionShape.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" -namespace reactphysics3d { +/// ReactPhysics3D Namespace +namespace reactphysics3d { // Class ProxyShape /** diff --git a/src/collision/RaycastInfo.h b/include/reactphysics3d/collision/RaycastInfo.h similarity index 97% rename from src/collision/RaycastInfo.h rename to include/reactphysics3d/collision/RaycastInfo.h index af6f33a1a..4a430fa79 100644 --- a/src/collision/RaycastInfo.h +++ b/include/reactphysics3d/collision/RaycastInfo.h @@ -27,10 +27,10 @@ #define REACTPHYSICS3D_RAYCAST_INFO_H // Libraries -#include "mathematics/Vector3.h" -#include "mathematics/Ray.h" +#include "reactphysics3d/mathematics/Ray.h" +#include "reactphysics3d/mathematics/Vector3.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Declarations diff --git a/src/collision/broadphase/BroadPhaseAlgorithm.h b/include/reactphysics3d/collision/broadphase/BroadPhaseAlgorithm.h similarity index 97% rename from src/collision/broadphase/BroadPhaseAlgorithm.h rename to include/reactphysics3d/collision/broadphase/BroadPhaseAlgorithm.h index 06b5579aa..e3620a6d4 100644 --- a/src/collision/broadphase/BroadPhaseAlgorithm.h +++ b/include/reactphysics3d/collision/broadphase/BroadPhaseAlgorithm.h @@ -28,11 +28,11 @@ // Libraries #include -#include "body/CollisionBody.h" -#include "collision/ProxyShape.h" -#include "DynamicAABBTree.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/broadphase/DynamicAABBTree.h" +#include "reactphysics3d/collision/ProxyShape.h" -/// Namespace ReactPhysics3D +/// ReactPhysics3D Namespace namespace reactphysics3d { // Declarations diff --git a/src/collision/broadphase/DynamicAABBTree.h b/include/reactphysics3d/collision/broadphase/DynamicAABBTree.h similarity index 97% rename from src/collision/broadphase/DynamicAABBTree.h rename to include/reactphysics3d/collision/broadphase/DynamicAABBTree.h index a6f782e49..5819e9071 100644 --- a/src/collision/broadphase/DynamicAABBTree.h +++ b/include/reactphysics3d/collision/broadphase/DynamicAABBTree.h @@ -27,11 +27,11 @@ #define REACTPHYSICS3D_DYNAMIC_AABB_TREE_H // Libraries -#include "configuration.h" -#include "collision/shapes/AABB.h" -#include "body/CollisionBody.h" +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/shapes/AABB.h" -/// Namespace ReactPhysics3D +/// ReactPhysics3D Namespace namespace reactphysics3d { // Declarations diff --git a/src/collision/narrowphase/EPA/EPAAlgorithm.h b/include/reactphysics3d/collision/narrowphase/EPA/EPAAlgorithm.h similarity index 94% rename from src/collision/narrowphase/EPA/EPAAlgorithm.h rename to include/reactphysics3d/collision/narrowphase/EPA/EPAAlgorithm.h index cac960a9f..256e5d7f4 100644 --- a/src/collision/narrowphase/EPA/EPAAlgorithm.h +++ b/include/reactphysics3d/collision/narrowphase/EPA/EPAAlgorithm.h @@ -27,15 +27,15 @@ #define REACTPHYSICS3D_EPA_ALGORITHM_H // Libraries -#include "collision/narrowphase/GJK/Simplex.h" -#include "collision/shapes/CollisionShape.h" -#include "constraint/ContactPoint.h" -#include "mathematics/mathematics.h" -#include "TriangleEPA.h" -#include "memory/MemoryAllocator.h" #include - -/// ReactPhysics3D namespace +#include "reactphysics3d/collision/narrowphase/GJK/Simplex.h" +#include "reactphysics3d/collision/narrowphase/EPA/TriangleEPA.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/constraint/ContactPoint.h" +#include "reactphysics3d/mathematics/mathematics.h" +#include "reactphysics3d/memory/MemoryAllocator.h" + +/// ReactPhysics3D Namespace namespace reactphysics3d { // ---------- Constants ---------- // diff --git a/src/collision/narrowphase/EPA/EdgeEPA.h b/include/reactphysics3d/collision/narrowphase/EPA/EdgeEPA.h similarity index 98% rename from src/collision/narrowphase/EPA/EdgeEPA.h rename to include/reactphysics3d/collision/narrowphase/EPA/EdgeEPA.h index 6f26b42a0..82bebbe01 100644 --- a/src/collision/narrowphase/EPA/EdgeEPA.h +++ b/include/reactphysics3d/collision/narrowphase/EPA/EdgeEPA.h @@ -26,11 +26,10 @@ #ifndef REACTPHYSICS3D_EDGE_EPA_H #define REACTPHYSICS3D_EDGE_EPA_H - // Libraries -#include "mathematics/mathematics.h" +#include "reactphysics3d/mathematics/mathematics.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class declarations diff --git a/src/collision/narrowphase/EPA/TriangleEPA.h b/include/reactphysics3d/collision/narrowphase/EPA/TriangleEPA.h similarity index 97% rename from src/collision/narrowphase/EPA/TriangleEPA.h rename to include/reactphysics3d/collision/narrowphase/EPA/TriangleEPA.h index 193d2ac5f..d708664a7 100644 --- a/src/collision/narrowphase/EPA/TriangleEPA.h +++ b/include/reactphysics3d/collision/narrowphase/EPA/TriangleEPA.h @@ -27,12 +27,12 @@ #define REACTPHYSICS3D_TRIANGLE_EPA_H // Libraries -#include "mathematics/mathematics.h" -#include "configuration.h" -#include "EdgeEPA.h" #include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/collision/narrowphase/EPA/EdgeEPA.h" +#include "reactphysics3d/mathematics/mathematics.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Prototypes diff --git a/src/collision/narrowphase/EPA/TrianglesStore.h b/include/reactphysics3d/collision/narrowphase/EPA/TrianglesStore.h similarity index 97% rename from src/collision/narrowphase/EPA/TrianglesStore.h rename to include/reactphysics3d/collision/narrowphase/EPA/TrianglesStore.h index 6f90b52c0..db7e43a22 100644 --- a/src/collision/narrowphase/EPA/TrianglesStore.h +++ b/include/reactphysics3d/collision/narrowphase/EPA/TrianglesStore.h @@ -26,13 +26,11 @@ #ifndef REACTPHYSICS3D_TRIANGLES_STORE_H #define REACTPHYSICS3D_TRIANGLES_STORE_H -#include "TriangleEPA.h" - - // Libraries #include +#include "reactphysics3d/collision/narrowphase/EPA/TriangleEPA.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Constants diff --git a/src/collision/narrowphase/GJK/GJKAlgorithm.h b/include/reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.h similarity index 94% rename from src/collision/narrowphase/GJK/GJKAlgorithm.h rename to include/reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.h index c685d0689..630ba64dd 100644 --- a/src/collision/narrowphase/GJK/GJKAlgorithm.h +++ b/include/reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.h @@ -27,13 +27,12 @@ #define REACTPHYSICS3D_GJK_ALGORITHM_H // Libraries -#include "collision/narrowphase/NarrowPhaseAlgorithm.h" -#include "constraint/ContactPoint.h" -#include "collision/shapes/CollisionShape.h" -#include "collision/narrowphase/EPA/EPAAlgorithm.h" +#include "reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.h" +#include "reactphysics3d/collision/narrowphase/EPA/EPAAlgorithm.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/constraint/ContactPoint.h" - -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Constants diff --git a/src/collision/narrowphase/GJK/Simplex.h b/include/reactphysics3d/collision/narrowphase/GJK/Simplex.h similarity index 98% rename from src/collision/narrowphase/GJK/Simplex.h rename to include/reactphysics3d/collision/narrowphase/GJK/Simplex.h index 23c2d469e..d3558522e 100644 --- a/src/collision/narrowphase/GJK/Simplex.h +++ b/include/reactphysics3d/collision/narrowphase/GJK/Simplex.h @@ -27,10 +27,10 @@ #define REACTPHYSICS3D_SIMPLEX_H // Libraries -#include "mathematics/mathematics.h" #include +#include "reactphysics3d/mathematics/mathematics.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Type definitions diff --git a/src/collision/narrowphase/NarrowPhaseAlgorithm.h b/include/reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.h similarity index 94% rename from src/collision/narrowphase/NarrowPhaseAlgorithm.h rename to include/reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.h index 5e2e7fcee..86460fe3b 100644 --- a/src/collision/narrowphase/NarrowPhaseAlgorithm.h +++ b/include/reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.h @@ -27,13 +27,13 @@ #define REACTPHYSICS3D_NARROW_PHASE_ALGORITHM_H // Libraries -#include "body/Body.h" -#include "constraint/ContactPoint.h" -#include "memory/MemoryAllocator.h" -#include "engine/OverlappingPair.h" +#include "reactphysics3d/body/Body.h" +#include "reactphysics3d/constraint/ContactPoint.h" +#include "reactphysics3d/engine/OverlappingPair.h" +#include "reactphysics3d/memory/MemoryAllocator.h" -/// Namespace ReactPhysics3D +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class NarrowPhaseAlgorithm diff --git a/src/collision/narrowphase/SphereVsSphereAlgorithm.h b/include/reactphysics3d/collision/narrowphase/SphereVsSphereAlgorithm.h similarity index 94% rename from src/collision/narrowphase/SphereVsSphereAlgorithm.h rename to include/reactphysics3d/collision/narrowphase/SphereVsSphereAlgorithm.h index d87cff18f..771748f17 100644 --- a/src/collision/narrowphase/SphereVsSphereAlgorithm.h +++ b/include/reactphysics3d/collision/narrowphase/SphereVsSphereAlgorithm.h @@ -27,12 +27,11 @@ #define REACTPHYSICS3D_SPHERE_VS_SPHERE_ALGORITHM_H // Libraries -#include "body/Body.h" -#include "constraint/ContactPoint.h" -#include "NarrowPhaseAlgorithm.h" +#include "reactphysics3d/body/Body.h" +#include "reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.h" +#include "reactphysics3d/constraint/ContactPoint.h" - -/// Namespace ReactPhysics3D +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class SphereVsSphereAlgorithm diff --git a/src/collision/shapes/AABB.h b/include/reactphysics3d/collision/shapes/AABB.h similarity index 98% rename from src/collision/shapes/AABB.h rename to include/reactphysics3d/collision/shapes/AABB.h index 7e2849731..841f9f74e 100644 --- a/src/collision/shapes/AABB.h +++ b/include/reactphysics3d/collision/shapes/AABB.h @@ -27,9 +27,9 @@ #define REACTPHYSICS3D_AABB_H // Libraries -#include "mathematics/mathematics.h" +#include "reactphysics3d/mathematics/mathematics.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class AABB diff --git a/src/collision/shapes/BoxShape.h b/include/reactphysics3d/collision/shapes/BoxShape.h similarity index 97% rename from src/collision/shapes/BoxShape.h rename to include/reactphysics3d/collision/shapes/BoxShape.h index 9f7e49ec8..6e998550d 100644 --- a/src/collision/shapes/BoxShape.h +++ b/include/reactphysics3d/collision/shapes/BoxShape.h @@ -28,12 +28,11 @@ // Libraries #include -#include "CollisionShape.h" -#include "body/CollisionBody.h" -#include "mathematics/mathematics.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/mathematics/mathematics.h" - -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class BoxShape diff --git a/src/collision/shapes/CapsuleShape.h b/include/reactphysics3d/collision/shapes/CapsuleShape.h similarity index 97% rename from src/collision/shapes/CapsuleShape.h rename to include/reactphysics3d/collision/shapes/CapsuleShape.h index 240f73cbe..167820dfe 100644 --- a/src/collision/shapes/CapsuleShape.h +++ b/include/reactphysics3d/collision/shapes/CapsuleShape.h @@ -27,11 +27,11 @@ #define REACTPHYSICS3D_CAPSULE_SHAPE_H // Libraries -#include "CollisionShape.h" -#include "body/CollisionBody.h" -#include "mathematics/mathematics.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/mathematics/mathematics.h" -// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class CapsuleShape diff --git a/src/collision/shapes/CollisionShape.h b/include/reactphysics3d/collision/shapes/CollisionShape.h similarity index 95% rename from src/collision/shapes/CollisionShape.h rename to include/reactphysics3d/collision/shapes/CollisionShape.h index c57ba2b3a..4c94dff74 100644 --- a/src/collision/shapes/CollisionShape.h +++ b/include/reactphysics3d/collision/shapes/CollisionShape.h @@ -29,14 +29,14 @@ // Libraries #include #include -#include "mathematics/Vector3.h" -#include "mathematics/Matrix3x3.h" -#include "mathematics/Ray.h" -#include "AABB.h" -#include "collision/RaycastInfo.h" -#include "memory/MemoryAllocator.h" - -/// ReactPhysics3D namespace +#include "reactphysics3d/collision/shapes/AABB.h" +#include "reactphysics3d/collision/RaycastInfo.h" +#include "reactphysics3d/mathematics/Ray.h" +#include "reactphysics3d/mathematics/Vector3.h" +#include "reactphysics3d/mathematics/Matrix3x3.h" +#include "reactphysics3d/memory/MemoryAllocator.h" + +/// ReactPhysics3D Namespace namespace reactphysics3d { /// Type of the collision shape diff --git a/src/collision/shapes/ConeShape.h b/include/reactphysics3d/collision/shapes/ConeShape.h similarity index 97% rename from src/collision/shapes/ConeShape.h rename to include/reactphysics3d/collision/shapes/ConeShape.h index f7aec26e8..754324fab 100644 --- a/src/collision/shapes/ConeShape.h +++ b/include/reactphysics3d/collision/shapes/ConeShape.h @@ -27,11 +27,11 @@ #define REACTPHYSICS3D_CONE_SHAPE_H // Libraries -#include "CollisionShape.h" -#include "body/CollisionBody.h" -#include "mathematics/mathematics.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/mathematics/mathematics.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class ConeShape diff --git a/src/collision/shapes/ConvexMeshShape.h b/include/reactphysics3d/collision/shapes/ConvexMeshShape.h similarity index 97% rename from src/collision/shapes/ConvexMeshShape.h rename to include/reactphysics3d/collision/shapes/ConvexMeshShape.h index d3dbd1638..f5a17a6c0 100644 --- a/src/collision/shapes/ConvexMeshShape.h +++ b/include/reactphysics3d/collision/shapes/ConvexMeshShape.h @@ -27,15 +27,15 @@ #define REACTPHYSICS3D_CONVEX_MESH_SHAPE_H // Libraries -#include "CollisionShape.h" -#include "engine/CollisionWorld.h" -#include "mathematics/mathematics.h" -#include "collision/narrowphase/GJK/GJKAlgorithm.h" -#include -#include #include +#include +#include +#include "reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/engine/CollisionWorld.h" +#include "reactphysics3d/mathematics/mathematics.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Declaration diff --git a/src/collision/shapes/CylinderShape.h b/include/reactphysics3d/collision/shapes/CylinderShape.h similarity index 97% rename from src/collision/shapes/CylinderShape.h rename to include/reactphysics3d/collision/shapes/CylinderShape.h index 5b3812967..29d0aa7bd 100644 --- a/src/collision/shapes/CylinderShape.h +++ b/include/reactphysics3d/collision/shapes/CylinderShape.h @@ -27,12 +27,11 @@ #define REACTPHYSICS3D_CYLINDER_SHAPE_H // Libraries -#include "CollisionShape.h" -#include "body/CollisionBody.h" -#include "mathematics/mathematics.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/mathematics/mathematics.h" - -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class CylinderShape diff --git a/src/collision/shapes/SphereShape.h b/include/reactphysics3d/collision/shapes/SphereShape.h similarity index 97% rename from src/collision/shapes/SphereShape.h rename to include/reactphysics3d/collision/shapes/SphereShape.h index d49db1ef0..1c9f8fa36 100644 --- a/src/collision/shapes/SphereShape.h +++ b/include/reactphysics3d/collision/shapes/SphereShape.h @@ -27,11 +27,11 @@ #define REACTPHYSICS3D_SPHERE_SHAPE_H // Libraries -#include "CollisionShape.h" -#include "body/CollisionBody.h" -#include "mathematics/mathematics.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/mathematics/mathematics.h" -// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class SphereShape diff --git a/src/configuration.h b/include/reactphysics3d/configuration.h similarity index 98% rename from src/configuration.h rename to include/reactphysics3d/configuration.h index 50d1872c9..3429debba 100644 --- a/src/configuration.h +++ b/include/reactphysics3d/configuration.h @@ -27,10 +27,10 @@ #define REACTPHYSICS3D_CONFIGURATION_H // Libraries -#include #include +#include #include -#include "decimal.h" +#include "reactphysics3d/decimal.h" // Windows platform #if defined(WIN32) ||defined(_WIN32) || defined(_WIN64) ||defined(__WIN32__) || defined(__WINDOWS__) @@ -41,7 +41,7 @@ #define LINUX_OS #endif -/// Namespace reactphysics3d +/// ReactPhysics3D Namespace namespace reactphysics3d { // ------------------- Type definitions ------------------- // diff --git a/src/constraint/BallAndSocketJoint.h b/include/reactphysics3d/constraint/BallAndSocketJoint.h similarity index 97% rename from src/constraint/BallAndSocketJoint.h rename to include/reactphysics3d/constraint/BallAndSocketJoint.h index 55be7ace7..d30ead09d 100644 --- a/src/constraint/BallAndSocketJoint.h +++ b/include/reactphysics3d/constraint/BallAndSocketJoint.h @@ -27,9 +27,10 @@ #define REACTPHYSICS3D_BALL_AND_SOCKET_JOINT_H // Libraries -#include "Joint.h" -#include "mathematics/mathematics.h" +#include "reactphysics3d/constraint/Joint.h" +#include "reactphysics3d/mathematics/mathematics.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Structure BallAndSocketJointInfo diff --git a/src/constraint/ContactPoint.h b/include/reactphysics3d/constraint/ContactPoint.h similarity index 98% rename from src/constraint/ContactPoint.h rename to include/reactphysics3d/constraint/ContactPoint.h index 5f0d3aab6..cbef88268 100644 --- a/src/constraint/ContactPoint.h +++ b/include/reactphysics3d/constraint/ContactPoint.h @@ -27,12 +27,11 @@ #define REACTPHYSICS3D_CONTACT_POINT_H // Libraries -#include "body/CollisionBody.h" -#include "configuration.h" -#include "mathematics/mathematics.h" -#include "configuration.h" +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/mathematics/mathematics.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Structure ContactPointInfo diff --git a/src/constraint/FixedJoint.h b/include/reactphysics3d/constraint/FixedJoint.h similarity index 98% rename from src/constraint/FixedJoint.h rename to include/reactphysics3d/constraint/FixedJoint.h index 0bf5f42fc..2dfd024ab 100644 --- a/src/constraint/FixedJoint.h +++ b/include/reactphysics3d/constraint/FixedJoint.h @@ -27,9 +27,10 @@ #define REACTPHYSICS3D_FIXED_JOINT_H // Libraries -#include "Joint.h" -#include "mathematics/mathematics.h" +#include "reactphysics3d/constraint/Joint.h" +#include "reactphysics3d/mathematics/mathematics.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Structure FixedJointInfo diff --git a/src/constraint/HingeJoint.h b/include/reactphysics3d/constraint/HingeJoint.h similarity index 99% rename from src/constraint/HingeJoint.h rename to include/reactphysics3d/constraint/HingeJoint.h index 1754cbaf7..239dca925 100644 --- a/src/constraint/HingeJoint.h +++ b/include/reactphysics3d/constraint/HingeJoint.h @@ -27,9 +27,10 @@ #define REACTPHYSICS3D_HINGE_JOINT_H // Libraries -#include "Joint.h" -#include "mathematics/mathematics.h" +#include "reactphysics3d/constraint/Joint.h" +#include "reactphysics3d/mathematics/mathematics.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Structure HingeJointInfo diff --git a/src/constraint/Joint.h b/include/reactphysics3d/constraint/Joint.h similarity index 98% rename from src/constraint/Joint.h rename to include/reactphysics3d/constraint/Joint.h index c6600a821..4c3d68d83 100644 --- a/src/constraint/Joint.h +++ b/include/reactphysics3d/constraint/Joint.h @@ -27,11 +27,11 @@ #define REACTPHYSICS3D_CONSTRAINT_H // Libraries -#include "configuration.h" -#include "body/RigidBody.h" -#include "mathematics/mathematics.h" +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/body/RigidBody.h" +#include "reactphysics3d/mathematics/mathematics.h" -// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { /// Enumeration for the type of a constraint diff --git a/src/constraint/SliderJoint.h b/include/reactphysics3d/constraint/SliderJoint.h similarity index 99% rename from src/constraint/SliderJoint.h rename to include/reactphysics3d/constraint/SliderJoint.h index b7842917c..abb4f91a7 100644 --- a/src/constraint/SliderJoint.h +++ b/include/reactphysics3d/constraint/SliderJoint.h @@ -27,9 +27,10 @@ #define REACTPHYSICS3D_SLIDER_JOINT_H // Libraries -#include "mathematics/mathematics.h" -#include "engine/ConstraintSolver.h" +#include "reactphysics3d/engine/ConstraintSolver.h" +#include "reactphysics3d/mathematics/mathematics.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Structure SliderJointInfo diff --git a/src/decimal.h b/include/reactphysics3d/decimal.h similarity index 98% rename from src/decimal.h rename to include/reactphysics3d/decimal.h index 9355a4803..9a329efd5 100644 --- a/src/decimal.h +++ b/include/reactphysics3d/decimal.h @@ -26,7 +26,7 @@ #ifndef REACTPHYSICS3D_DECIMAL_H #define REACTPHYSICS3D_DECIMAL_H -/// ReactPhysiscs3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { #if defined(IS_DOUBLE_PRECISION_ENABLED) // If we are compiling for double precision diff --git a/src/engine/CollisionWorld.h b/include/reactphysics3d/engine/CollisionWorld.h similarity index 94% rename from src/engine/CollisionWorld.h rename to include/reactphysics3d/engine/CollisionWorld.h index c2f529f72..8154f067a 100644 --- a/src/engine/CollisionWorld.h +++ b/include/reactphysics3d/engine/CollisionWorld.h @@ -27,22 +27,22 @@ #define REACTPHYSICS3D_COLLISION_WORLD_H // Libraries -#include -#include -#include #include -#include "mathematics/mathematics.h" -#include "Profiler.h" -#include "body/CollisionBody.h" -#include "collision/RaycastInfo.h" -#include "OverlappingPair.h" -#include "collision/CollisionDetection.h" -#include "constraint/Joint.h" -#include "constraint/ContactPoint.h" -#include "memory/MemoryAllocator.h" -#include "EventListener.h" - -/// Namespace reactphysics3d +#include +#include +#include +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/RaycastInfo.h" +#include "reactphysics3d/collision/CollisionDetection.h" +#include "reactphysics3d/constraint/Joint.h" +#include "reactphysics3d/constraint/ContactPoint.h" +#include "reactphysics3d/engine/Profiler.h" +#include "reactphysics3d/engine/OverlappingPair.h" +#include "reactphysics3d/engine/EventListener.h" +#include "reactphysics3d/mathematics/mathematics.h" +#include "reactphysics3d/memory/MemoryAllocator.h" + +/// ReactPhysics3D Namespace namespace reactphysics3d { // Declarations diff --git a/src/engine/ConstraintSolver.h b/include/reactphysics3d/engine/ConstraintSolver.h similarity index 98% rename from src/engine/ConstraintSolver.h rename to include/reactphysics3d/engine/ConstraintSolver.h index 72302bbd9..5722f89aa 100644 --- a/src/engine/ConstraintSolver.h +++ b/include/reactphysics3d/engine/ConstraintSolver.h @@ -27,13 +27,14 @@ #define REACTPHYSICS3D_CONSTRAINT_SOLVER_H // Libraries -#include "configuration.h" -#include "mathematics/mathematics.h" -#include "constraint/Joint.h" -#include "Island.h" #include #include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/constraint/Joint.h" +#include "reactphysics3d/engine/Island.h" +#include "reactphysics3d/mathematics/mathematics.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Structure ConstraintSolverData diff --git a/src/engine/ContactManifold.h b/include/reactphysics3d/engine/ContactManifold.h similarity index 98% rename from src/engine/ContactManifold.h rename to include/reactphysics3d/engine/ContactManifold.h index 2468d9ce1..172f202f0 100644 --- a/src/engine/ContactManifold.h +++ b/include/reactphysics3d/engine/ContactManifold.h @@ -28,12 +28,12 @@ // Libraries #include -#include "body/CollisionBody.h" -#include "collision/ProxyShape.h" -#include "constraint/ContactPoint.h" -#include "memory/MemoryAllocator.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/ProxyShape.h" +#include "reactphysics3d/constraint/ContactPoint.h" +#include "reactphysics3d/memory/MemoryAllocator.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Constants diff --git a/src/engine/ContactSolver.h b/include/reactphysics3d/engine/ContactSolver.h similarity index 98% rename from src/engine/ContactSolver.h rename to include/reactphysics3d/engine/ContactSolver.h index dc2e52eef..047c3db2e 100644 --- a/src/engine/ContactSolver.h +++ b/include/reactphysics3d/engine/ContactSolver.h @@ -27,19 +27,18 @@ #define REACTPHYSICS3D_CONTACT_SOLVER_H // Libraries -#include "constraint/ContactPoint.h" -#include "configuration.h" -#include "constraint/Joint.h" -#include "ContactManifold.h" -#include "Island.h" -#include "Impulse.h" #include #include - -/// ReactPhysics3D namespace +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/constraint/ContactPoint.h" +#include "reactphysics3d/constraint/Joint.h" +#include "reactphysics3d/engine/ContactManifold.h" +#include "reactphysics3d/engine/Impulse.h" +#include "reactphysics3d/engine/Island.h" + +/// ReactPhysics3D Namespace namespace reactphysics3d { - // Class Contact Solver /** * This class represents the contact solver that is used to solve rigid bodies contacts. @@ -209,7 +208,7 @@ class ContactSolver { /// Inverse of the mass of body 1 decimal massInverseBody1; - // Inverse of the mass of body 2 + /// Inverse of the mass of body 2 decimal massInverseBody2; /// Inverse inertia tensor of body 1 diff --git a/src/engine/DynamicsWorld.h b/include/reactphysics3d/engine/DynamicsWorld.h similarity index 98% rename from src/engine/DynamicsWorld.h rename to include/reactphysics3d/engine/DynamicsWorld.h index 482bc66ee..b5ca12246 100644 --- a/src/engine/DynamicsWorld.h +++ b/include/reactphysics3d/engine/DynamicsWorld.h @@ -27,15 +27,15 @@ #define REACTPHYSICS3D_DYNAMICS_WORLD_H // Libraries -#include "CollisionWorld.h" -#include "collision/CollisionDetection.h" -#include "ContactSolver.h" -#include "ConstraintSolver.h" -#include "body/RigidBody.h" -#include "Island.h" -#include "configuration.h" - -/// Namespace ReactPhysics3D +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/body/RigidBody.h" +#include "reactphysics3d/collision/CollisionDetection.h" +#include "reactphysics3d/engine/ContactSolver.h" +#include "reactphysics3d/engine/ConstraintSolver.h" +#include "reactphysics3d/engine/CollisionWorld.h" +#include "reactphysics3d/engine/Island.h" + +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class DynamicsWorld diff --git a/src/engine/EventListener.h b/include/reactphysics3d/engine/EventListener.h similarity index 97% rename from src/engine/EventListener.h rename to include/reactphysics3d/engine/EventListener.h index aba5c63d8..65bf48571 100644 --- a/src/engine/EventListener.h +++ b/include/reactphysics3d/engine/EventListener.h @@ -27,8 +27,9 @@ #define REACTPHYSICS3D_EVENT_LISTENER_H // Libraries -#include "constraint/ContactPoint.h" +#include "reactphysics3d/constraint/ContactPoint.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class EventListener diff --git a/src/engine/Impulse.h b/include/reactphysics3d/engine/Impulse.h similarity index 97% rename from src/engine/Impulse.h rename to include/reactphysics3d/engine/Impulse.h index f6925c9fe..c3f01ff0a 100644 --- a/src/engine/Impulse.h +++ b/include/reactphysics3d/engine/Impulse.h @@ -27,8 +27,9 @@ #define REACTPHYSICS3D_IMPULSE_H // Libraries -#include "mathematics/mathematics.h" +#include "reactphysics3d/mathematics/mathematics.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Structure Impulse diff --git a/src/engine/Island.h b/include/reactphysics3d/engine/Island.h similarity index 96% rename from src/engine/Island.h rename to include/reactphysics3d/engine/Island.h index d4aa01a6d..c2ac96feb 100644 --- a/src/engine/Island.h +++ b/include/reactphysics3d/engine/Island.h @@ -27,11 +27,12 @@ #define REACTPHYSICS3D_ISLAND_H // Libraries -#include "memory/MemoryAllocator.h" -#include "body/RigidBody.h" -#include "constraint/Joint.h" -#include "ContactManifold.h" +#include "reactphysics3d/body/RigidBody.h" +#include "reactphysics3d/constraint/Joint.h" +#include "reactphysics3d/engine/ContactManifold.h" +#include "reactphysics3d/memory/MemoryAllocator.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class Island diff --git a/src/engine/Material.h b/include/reactphysics3d/engine/Material.h similarity index 98% rename from src/engine/Material.h rename to include/reactphysics3d/engine/Material.h index 1db6729c0..6efb039a1 100644 --- a/src/engine/Material.h +++ b/include/reactphysics3d/engine/Material.h @@ -28,8 +28,9 @@ // Libraries #include -#include "configuration.h" +#include "reactphysics3d/configuration.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class Material diff --git a/src/engine/OverlappingPair.h b/include/reactphysics3d/engine/OverlappingPair.h similarity index 97% rename from src/engine/OverlappingPair.h rename to include/reactphysics3d/engine/OverlappingPair.h index da16d6e4d..bea89e66b 100644 --- a/src/engine/OverlappingPair.h +++ b/include/reactphysics3d/engine/OverlappingPair.h @@ -27,11 +27,11 @@ #define REACTPHYSICS3D_OVERLAPPING_PAIR_H // Libraries -#include "ContactManifold.h" -#include "collision/ProxyShape.h" -#include "collision/shapes/CollisionShape.h" +#include "reactphysics3d/collision/ProxyShape.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/engine/ContactManifold.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Type for the overlapping pair ID diff --git a/src/engine/Profiler.h b/include/reactphysics3d/engine/Profiler.h similarity index 99% rename from src/engine/Profiler.h rename to include/reactphysics3d/engine/Profiler.h index f73fa5792..e77cb470b 100644 --- a/src/engine/Profiler.h +++ b/include/reactphysics3d/engine/Profiler.h @@ -29,8 +29,8 @@ #ifdef IS_PROFILING_ACTIVE // Libraries -#include "configuration.h" -#include "Timer.h" +#include "reactphyiscs3d/configuration.h" +#include "Timer.h" // ??? /// ReactPhysics3D namespace namespace reactphysics3d { diff --git a/src/mathematics/Matrix2x2.h b/include/reactphysics3d/mathematics/Matrix2x2.h similarity index 99% rename from src/mathematics/Matrix2x2.h rename to include/reactphysics3d/mathematics/Matrix2x2.h index d28c08d83..06e2bcfd7 100644 --- a/src/mathematics/Matrix2x2.h +++ b/include/reactphysics3d/mathematics/Matrix2x2.h @@ -28,9 +28,9 @@ // Libraries #include -#include "Vector2.h" +#include "reactphysics3d/mathematics/Vector2.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class Matrix2x2 diff --git a/src/mathematics/Matrix3x3.h b/include/reactphysics3d/mathematics/Matrix3x3.h similarity index 99% rename from src/mathematics/Matrix3x3.h rename to include/reactphysics3d/mathematics/Matrix3x3.h index 87b8cd352..0a16491a5 100644 --- a/src/mathematics/Matrix3x3.h +++ b/include/reactphysics3d/mathematics/Matrix3x3.h @@ -29,12 +29,11 @@ // Libraries #include -#include "Vector3.h" +#include "reactphysics3d/mathematics/Vector3.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { - // Class Matrix3x3 /** * This class represents a 3x3 matrix. diff --git a/src/mathematics/Quaternion.h b/include/reactphysics3d/mathematics/Quaternion.h similarity index 98% rename from src/mathematics/Quaternion.h rename to include/reactphysics3d/mathematics/Quaternion.h index 2d5eacc35..a04df0818 100644 --- a/src/mathematics/Quaternion.h +++ b/include/reactphysics3d/mathematics/Quaternion.h @@ -28,11 +28,11 @@ // Libraries #include -#include "Vector3.h" -#include "Matrix3x3.h" -#include "decimal.h" +#include "reactphysics3d/decimal.h" +#include "reactphysics3d/mathematics/Vector3.h" +#include "reactphysics3d/mathematics/Matrix3x3.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class Quaternion diff --git a/src/mathematics/Ray.h b/include/reactphysics3d/mathematics/Ray.h similarity index 97% rename from src/mathematics/Ray.h rename to include/reactphysics3d/mathematics/Ray.h index e269af5a8..bc4f2a8d4 100644 --- a/src/mathematics/Ray.h +++ b/include/reactphysics3d/mathematics/Ray.h @@ -27,9 +27,9 @@ #define REACTPHYSICS3D_RAY_H // Libraries -#include "Vector3.h" +#include "reactphysics3d/mathematics/Vector3.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class Ray diff --git a/src/mathematics/Transform.h b/include/reactphysics3d/mathematics/Transform.h similarity index 97% rename from src/mathematics/Transform.h rename to include/reactphysics3d/mathematics/Transform.h index 825152253..896c5ed84 100644 --- a/src/mathematics/Transform.h +++ b/include/reactphysics3d/mathematics/Transform.h @@ -27,11 +27,11 @@ #define REACTPHYSICS3D_TRANSFORM_H // Libraries -#include "Matrix3x3.h" -#include "Vector3.h" -#include "Quaternion.h" +#include "reactphysics3d/mathematics/Vector3.h" +#include "reactphysics3d/mathematics/Matrix3x3.h" +#include "reactphysics3d/mathematics/Quaternion.h" -// ReactPhysiscs3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class Transform diff --git a/src/mathematics/Vector2.h b/include/reactphysics3d/mathematics/Vector2.h similarity index 98% rename from src/mathematics/Vector2.h rename to include/reactphysics3d/mathematics/Vector2.h index 666d60c76..8086a3df6 100644 --- a/src/mathematics/Vector2.h +++ b/include/reactphysics3d/mathematics/Vector2.h @@ -29,11 +29,10 @@ // Libraries #include #include -#include "mathematics_functions.h" -#include "decimal.h" +#include "reactphysics3d/decimal.h" +#include "reactphysics3d/mathematics/mathematics_functions.h" - -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class Vector2 diff --git a/src/mathematics/Vector3.h b/include/reactphysics3d/mathematics/Vector3.h similarity index 98% rename from src/mathematics/Vector3.h rename to include/reactphysics3d/mathematics/Vector3.h index f8710fe31..8a4659f7c 100644 --- a/src/mathematics/Vector3.h +++ b/include/reactphysics3d/mathematics/Vector3.h @@ -29,11 +29,10 @@ // Libraries #include #include -#include "mathematics_functions.h" -#include "decimal.h" +#include "reactphysics3d/decimal.h" +#include "reactphysics3d/mathematics/mathematics_functions.h" - -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class Vector3 diff --git a/src/mathematics/mathematics.h b/include/reactphysics3d/mathematics/mathematics.h similarity index 82% rename from src/mathematics/mathematics.h rename to include/reactphysics3d/mathematics/mathematics.h index 237eee8f3..1bdeb793d 100644 --- a/src/mathematics/mathematics.h +++ b/include/reactphysics3d/mathematics/mathematics.h @@ -27,18 +27,18 @@ #define REACTPHYSICS3D_MATHEMATICS_H // Libraries -#include "Matrix3x3.h" -#include "Matrix2x2.h" -#include "Quaternion.h" -#include "Vector3.h" -#include "Vector2.h" -#include "Transform.h" -#include "Ray.h" -#include "configuration.h" -#include "mathematics_functions.h" -#include +#include #include #include -#include +#include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/mathematics/Ray.h" +#include "reactphysics3d/mathematics/Vector2.h" +#include "reactphysics3d/mathematics/Vector3.h" +#include "reactphysics3d/mathematics/Matrix2x2.h" +#include "reactphysics3d/mathematics/Matrix3x3.h" +#include "reactphysics3d/mathematics/Transform.h" +#include "reactphysics3d/mathematics/Quaternion.h" +#include "reactphysics3d/mathematics/mathematics_functions.h" #endif diff --git a/src/mathematics/mathematics_functions.h b/include/reactphysics3d/mathematics/mathematics_functions.h similarity index 96% rename from src/mathematics/mathematics_functions.h rename to include/reactphysics3d/mathematics/mathematics_functions.h index 5b89e98fe..dfab3049e 100644 --- a/src/mathematics/mathematics_functions.h +++ b/include/reactphysics3d/mathematics/mathematics_functions.h @@ -27,11 +27,11 @@ #define REACTPHYSICS3D_MATHEMATICS_FUNCTIONS_H // Libraries -#include "configuration.h" -#include "decimal.h" #include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/decimal.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // ---------- Mathematics functions ---------- // diff --git a/src/memory/MemoryAllocator.h b/include/reactphysics3d/memory/MemoryAllocator.h similarity index 98% rename from src/memory/MemoryAllocator.h rename to include/reactphysics3d/memory/MemoryAllocator.h index 07edea83a..1573f681d 100644 --- a/src/memory/MemoryAllocator.h +++ b/include/reactphysics3d/memory/MemoryAllocator.h @@ -28,9 +28,9 @@ // Libraries #include -#include "configuration.h" +#include "reactphysics3d/configuration.h" -/// ReactPhysics3D namespace +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class MemoryAllocator diff --git a/src/memory/Stack.h b/include/reactphysics3d/memory/Stack.h similarity index 98% rename from src/memory/Stack.h rename to include/reactphysics3d/memory/Stack.h index aa1efeddc..7ca27166c 100644 --- a/src/memory/Stack.h +++ b/include/reactphysics3d/memory/Stack.h @@ -27,8 +27,9 @@ #define REACTPHYSICS3D_STACK_H // Libraries -#include "configuration.h" +#include "reactphysics3d/configuration.h" +/// ReactPhysics3D Namespace namespace reactphysics3d { // Class Stack diff --git a/src/reactphysics3d.h b/include/reactphysics3d/reactphysics3d.h similarity index 69% rename from src/reactphysics3d.h rename to include/reactphysics3d/reactphysics3d.h index 1ef76d5ec..9075ca60b 100644 --- a/src/reactphysics3d.h +++ b/include/reactphysics3d/reactphysics3d.h @@ -35,28 +35,28 @@ #define REACTPHYSICS3D_H // Libraries -#include "configuration.h" -#include "mathematics/mathematics.h" -#include "body/CollisionBody.h" -#include "body/RigidBody.h" -#include "engine/DynamicsWorld.h" -#include "engine/CollisionWorld.h" -#include "engine/Material.h" -#include "engine/EventListener.h" -#include "collision/shapes/CollisionShape.h" -#include "collision/shapes/BoxShape.h" -#include "collision/shapes/SphereShape.h" -#include "collision/shapes/ConeShape.h" -#include "collision/shapes/CylinderShape.h" -#include "collision/shapes/CapsuleShape.h" -#include "collision/shapes/ConvexMeshShape.h" -#include "collision/shapes/AABB.h" -#include "collision/ProxyShape.h" -#include "collision/RaycastInfo.h" -#include "constraint/BallAndSocketJoint.h" -#include "constraint/SliderJoint.h" -#include "constraint/HingeJoint.h" -#include "constraint/FixedJoint.h" +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/mathematics/mathematics.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/body/RigidBody.h" +#include "reactphysics3d/engine/DynamicsWorld.h" +#include "reactphysics3d/engine/CollisionWorld.h" +#include "reactphysics3d/engine/Material.h" +#include "reactphysics3d/engine/EventListener.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/collision/shapes/BoxShape.h" +#include "reactphysics3d/collision/shapes/SphereShape.h" +#include "reactphysics3d/collision/shapes/ConeShape.h" +#include "reactphysics3d/collision/shapes/CylinderShape.h" +#include "reactphysics3d/collision/shapes/CapsuleShape.h" +#include "reactphysics3d/collision/shapes/ConvexMeshShape.h" +#include "reactphysics3d/collision/shapes/AABB.h" +#include "reactphysics3d/collision/ProxyShape.h" +#include "reactphysics3d/collision/RaycastInfo.h" +#include "reactphysics3d/constraint/BallAndSocketJoint.h" +#include "reactphysics3d/constraint/SliderJoint.h" +#include "reactphysics3d/constraint/HingeJoint.h" +#include "reactphysics3d/constraint/FixedJoint.h" /// Alias to the ReactPhysics3D namespace namespace rp3d = reactphysics3d; diff --git a/src/body/Body.cpp b/src/reactphysics3d/body/Body.cpp similarity index 95% rename from src/body/Body.cpp rename to src/reactphysics3d/body/Body.cpp index 3d858b704..6456fce36 100644 --- a/src/body/Body.cpp +++ b/src/reactphysics3d/body/Body.cpp @@ -24,10 +24,9 @@ ********************************************************************************/ // Libraries -#include "Body.h" -#include "collision/shapes/CollisionShape.h" +#include "reactphysics3d/body/Body.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/body/CollisionBody.cpp b/src/reactphysics3d/body/CollisionBody.cpp similarity index 98% rename from src/body/CollisionBody.cpp rename to src/reactphysics3d/body/CollisionBody.cpp index 86b1f1dea..366a48711 100644 --- a/src/body/CollisionBody.cpp +++ b/src/reactphysics3d/body/CollisionBody.cpp @@ -23,12 +23,11 @@ * * ********************************************************************************/ - // Libraries -#include "CollisionBody.h" -#include "engine/CollisionWorld.h" -#include "engine/ContactManifold.h" +// Libraries +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/engine/CollisionWorld.h" +#include "reactphysics3d/engine/ContactManifold.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/body/RigidBody.cpp b/src/reactphysics3d/body/RigidBody.cpp similarity index 98% rename from src/body/RigidBody.cpp rename to src/reactphysics3d/body/RigidBody.cpp index ddf1ea838..7d7c87cfc 100644 --- a/src/body/RigidBody.cpp +++ b/src/reactphysics3d/body/RigidBody.cpp @@ -24,12 +24,11 @@ ********************************************************************************/ // Libraries -#include "RigidBody.h" -#include "constraint/Joint.h" -#include "collision/shapes/CollisionShape.h" -#include "engine/DynamicsWorld.h" +#include "reactphysics3d/body/RigidBody.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/constraint/Joint.h" +#include "reactphysics3d/engine/DynamicsWorld.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/CollisionDetection.cpp b/src/reactphysics3d/collision/CollisionDetection.cpp similarity index 97% rename from src/collision/CollisionDetection.cpp rename to src/reactphysics3d/collision/CollisionDetection.cpp index 22ab2e6d2..a3eeadb24 100644 --- a/src/collision/CollisionDetection.cpp +++ b/src/reactphysics3d/collision/CollisionDetection.cpp @@ -24,21 +24,18 @@ ********************************************************************************/ // Libraries -#include "CollisionDetection.h" -#include "engine/CollisionWorld.h" -#include "body/Body.h" -#include "collision/shapes/BoxShape.h" -#include "body/RigidBody.h" -#include "configuration.h" #include -#include #include #include -#include +#include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/body/Body.h" +#include "reactphysics3d/body/RigidBody.h" +#include "reactphysics3d/collision/shapes/BoxShape.h" +#include "reactphysics3d/collision/CollisionDetection.h" +#include "reactphysics3d/engine/CollisionWorld.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; -using namespace std; // Constructor CollisionDetection::CollisionDetection(CollisionWorld* world, MemoryAllocator& memoryAllocator) @@ -87,7 +84,7 @@ void CollisionDetection::reportCollisionBetweenShapes(CollisionCallback* callbac const std::set& shapes2) { // For each possible collision pair of bodies - map::iterator it; + std::map::iterator it; for (it = mOverlappingPairs.begin(); it != mOverlappingPairs.end(); ++it) { OverlappingPair* pair = it->second; @@ -160,7 +157,7 @@ void CollisionDetection::computeNarrowPhase() { PROFILE("CollisionDetection::computeNarrowPhase()"); // For each possible collision pair of bodies - map::iterator it; + std::map::iterator it; for (it = mOverlappingPairs.begin(); it != mOverlappingPairs.end(); ) { ContactPointInfo* contactInfo = NULL; @@ -247,7 +244,7 @@ void CollisionDetection::computeNarrowPhaseBetweenShapes(CollisionCallback* call const std::set& shapes2) { // For each possible collision pair of bodies - map::iterator it; + std::map::iterator it; for (it = mOverlappingPairs.begin(); it != mOverlappingPairs.end(); ) { ContactPointInfo* contactInfo = NULL; @@ -364,7 +361,7 @@ void CollisionDetection::broadPhaseNotifyOverlappingPair(ProxyShape* shape1, Pro OverlappingPair* newPair = new (mWorld->mMemoryAllocator.allocate(sizeof(OverlappingPair))) OverlappingPair(shape1, shape2, mWorld->mMemoryAllocator); assert(newPair != NULL); - std::pair::iterator, bool> check = + std::pair::iterator, bool> check = mOverlappingPairs.insert(make_pair(pairID, newPair)); assert(check.second); diff --git a/src/collision/ProxyShape.cpp b/src/reactphysics3d/collision/ProxyShape.cpp similarity index 98% rename from src/collision/ProxyShape.cpp rename to src/reactphysics3d/collision/ProxyShape.cpp index e87449128..ba754cda7 100644 --- a/src/collision/ProxyShape.cpp +++ b/src/reactphysics3d/collision/ProxyShape.cpp @@ -24,7 +24,7 @@ ********************************************************************************/ // Libraries -#include "ProxyShape.h" +#include "reactphysics3d/collision/ProxyShape.h" using namespace reactphysics3d; diff --git a/src/collision/RaycastInfo.cpp b/src/reactphysics3d/collision/RaycastInfo.cpp similarity index 94% rename from src/collision/RaycastInfo.cpp rename to src/reactphysics3d/collision/RaycastInfo.cpp index c68a2c6cd..51b185bcb 100644 --- a/src/collision/RaycastInfo.cpp +++ b/src/reactphysics3d/collision/RaycastInfo.cpp @@ -24,9 +24,9 @@ ********************************************************************************/ // Libraries -#include "decimal.h" -#include "RaycastInfo.h" -#include "ProxyShape.h" +#include "reactphysics3d/decimal.h" +#include "reactphysics3d/collision/RaycastInfo.h" +#include "reactphysics3d/collision/ProxyShape.h" using namespace reactphysics3d; diff --git a/src/collision/broadphase/BroadPhaseAlgorithm.cpp b/src/reactphysics3d/collision/broadphase/BroadPhaseAlgorithm.cpp similarity index 98% rename from src/collision/broadphase/BroadPhaseAlgorithm.cpp rename to src/reactphysics3d/collision/broadphase/BroadPhaseAlgorithm.cpp index 00ed62f5e..30e1b5833 100644 --- a/src/collision/broadphase/BroadPhaseAlgorithm.cpp +++ b/src/reactphysics3d/collision/broadphase/BroadPhaseAlgorithm.cpp @@ -24,11 +24,10 @@ ********************************************************************************/ // Libraries -#include "BroadPhaseAlgorithm.h" -#include "collision/CollisionDetection.h" -#include "engine/Profiler.h" +#include "reactphysics3d/collision/broadphase/BroadPhaseAlgorithm.h" +#include "reactphysics3d/collision/CollisionDetection.h" +#include "reactphysics3d/engine/Profiler.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/broadphase/DynamicAABBTree.cpp b/src/reactphysics3d/collision/broadphase/DynamicAABBTree.cpp similarity index 99% rename from src/collision/broadphase/DynamicAABBTree.cpp rename to src/reactphysics3d/collision/broadphase/DynamicAABBTree.cpp index 51651c5ce..ea95bf32a 100644 --- a/src/collision/broadphase/DynamicAABBTree.cpp +++ b/src/reactphysics3d/collision/broadphase/DynamicAABBTree.cpp @@ -24,10 +24,10 @@ ********************************************************************************/ // Libraries -#include "DynamicAABBTree.h" -#include "BroadPhaseAlgorithm.h" -#include "memory/Stack.h" -#include "engine/Profiler.h" +#include "reactphysics3d/collision/broadphase/DynamicAABBTree.h" +#include "reactphysics3d/collision/broadphase/BroadPhaseAlgorithm.h" +#include "reactphysics3d/memory/Stack.h" +#include "reactphysics3d/engine/Profiler.h" using namespace reactphysics3d; diff --git a/src/collision/narrowphase/EPA/EPAAlgorithm.cpp b/src/reactphysics3d/collision/narrowphase/EPA/EPAAlgorithm.cpp similarity index 99% rename from src/collision/narrowphase/EPA/EPAAlgorithm.cpp rename to src/reactphysics3d/collision/narrowphase/EPA/EPAAlgorithm.cpp index 0312a1889..73e3b65bd 100644 --- a/src/collision/narrowphase/EPA/EPAAlgorithm.cpp +++ b/src/reactphysics3d/collision/narrowphase/EPA/EPAAlgorithm.cpp @@ -24,11 +24,10 @@ ********************************************************************************/ // Libraries -#include "EPAAlgorithm.h" -#include "collision/narrowphase//GJK/GJKAlgorithm.h" -#include "TrianglesStore.h" +#include "reactphysics3d/collision/narrowphase/EPA/EPAAlgorithm.h" +#include "reactphysics3d/collision/narrowphase/EPA/TrianglesStore.h" +#include "reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/narrowphase/EPA/EdgeEPA.cpp b/src/reactphysics3d/collision/narrowphase/EPA/EdgeEPA.cpp similarity index 96% rename from src/collision/narrowphase/EPA/EdgeEPA.cpp rename to src/reactphysics3d/collision/narrowphase/EPA/EdgeEPA.cpp index d7b366eb9..58c4d1ee9 100644 --- a/src/collision/narrowphase/EPA/EdgeEPA.cpp +++ b/src/reactphysics3d/collision/narrowphase/EPA/EdgeEPA.cpp @@ -24,15 +24,13 @@ ********************************************************************************/ // Libraries -#include "EdgeEPA.h" -#include "TriangleEPA.h" -#include "TrianglesStore.h" #include +#include "reactphysics3d/collision/narrowphase/EPA/EdgeEPA.h" +#include "reactphysics3d/collision/narrowphase/EPA/TriangleEPA.h" +#include "reactphysics3d/collision/narrowphase/EPA/TrianglesStore.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; - // Constructor EdgeEPA::EdgeEPA() { diff --git a/src/collision/narrowphase/EPA/TriangleEPA.cpp b/src/reactphysics3d/collision/narrowphase/EPA/TriangleEPA.cpp similarity index 97% rename from src/collision/narrowphase/EPA/TriangleEPA.cpp rename to src/reactphysics3d/collision/narrowphase/EPA/TriangleEPA.cpp index ab30a5610..a571dac9f 100644 --- a/src/collision/narrowphase/EPA/TriangleEPA.cpp +++ b/src/reactphysics3d/collision/narrowphase/EPA/TriangleEPA.cpp @@ -23,13 +23,11 @@ * * ********************************************************************************/ - // Libraries -#include "TriangleEPA.h" -#include "EdgeEPA.h" -#include "TrianglesStore.h" +#include "reactphysics3d/collision/narrowphase/EPA/EdgeEPA.h" +#include "reactphysics3d/collision/narrowphase/EPA/TriangleEPA.h" +#include "reactphysics3d/collision/narrowphase/EPA/TrianglesStore.h" -// We use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/narrowphase/EPA/TrianglesStore.cpp b/src/reactphysics3d/collision/narrowphase/EPA/TrianglesStore.cpp similarity index 96% rename from src/collision/narrowphase/EPA/TrianglesStore.cpp rename to src/reactphysics3d/collision/narrowphase/EPA/TrianglesStore.cpp index e37df62a1..37b1d2f9a 100644 --- a/src/collision/narrowphase/EPA/TrianglesStore.cpp +++ b/src/reactphysics3d/collision/narrowphase/EPA/TrianglesStore.cpp @@ -24,9 +24,8 @@ ********************************************************************************/ // Libraries -#include "TrianglesStore.h" +#include "reactphysics3d/collision/narrowphase/EPA/TrianglesStore.h" -// We use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/narrowphase/GJK/GJKAlgorithm.cpp b/src/reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.cpp similarity index 98% rename from src/collision/narrowphase/GJK/GJKAlgorithm.cpp rename to src/reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.cpp index 20654c891..70436ca40 100644 --- a/src/collision/narrowphase/GJK/GJKAlgorithm.cpp +++ b/src/reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.cpp @@ -24,16 +24,15 @@ ********************************************************************************/ // Libraries -#include "GJKAlgorithm.h" -#include "Simplex.h" -#include "constraint/ContactPoint.h" -#include "configuration.h" -#include #include #include #include +#include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.h" +#include "reactphysics3d/collision/narrowphase/GJK/Simplex.h" +#include "reactphysics3d/constraint/ContactPoint.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/narrowphase/GJK/Simplex.cpp b/src/reactphysics3d/collision/narrowphase/GJK/Simplex.cpp similarity index 99% rename from src/collision/narrowphase/GJK/Simplex.cpp rename to src/reactphysics3d/collision/narrowphase/GJK/Simplex.cpp index 1fb796ac1..1c25d860c 100644 --- a/src/collision/narrowphase/GJK/Simplex.cpp +++ b/src/reactphysics3d/collision/narrowphase/GJK/Simplex.cpp @@ -24,10 +24,9 @@ ********************************************************************************/ // Libraries -#include "Simplex.h" #include +#include "reactphysics3d/collision/narrowphase/GJK/Simplex.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/narrowphase/NarrowPhaseAlgorithm.cpp b/src/reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.cpp similarity index 96% rename from src/collision/narrowphase/NarrowPhaseAlgorithm.cpp rename to src/reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.cpp index 40bfa921f..2a1071150 100644 --- a/src/collision/narrowphase/NarrowPhaseAlgorithm.cpp +++ b/src/reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.cpp @@ -24,9 +24,8 @@ ********************************************************************************/ // Libraries -#include "NarrowPhaseAlgorithm.h" +#include "reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/narrowphase/SphereVsSphereAlgorithm.cpp b/src/reactphysics3d/collision/narrowphase/SphereVsSphereAlgorithm.cpp similarity index 97% rename from src/collision/narrowphase/SphereVsSphereAlgorithm.cpp rename to src/reactphysics3d/collision/narrowphase/SphereVsSphereAlgorithm.cpp index ceeb528ad..01b592912 100644 --- a/src/collision/narrowphase/SphereVsSphereAlgorithm.cpp +++ b/src/reactphysics3d/collision/narrowphase/SphereVsSphereAlgorithm.cpp @@ -24,10 +24,9 @@ ********************************************************************************/ // Libraries -#include "SphereVsSphereAlgorithm.h" -#include "collision/shapes/SphereShape.h" +#include "reactphysics3d/collision/narrowphase/SphereVsSphereAlgorithm.h" +#include "reactphysics3d/collision/shapes/SphereShape.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/shapes/AABB.cpp b/src/reactphysics3d/collision/shapes/AABB.cpp similarity index 97% rename from src/collision/shapes/AABB.cpp rename to src/reactphysics3d/collision/shapes/AABB.cpp index 7b4d95a0e..50148f78c 100644 --- a/src/collision/shapes/AABB.cpp +++ b/src/reactphysics3d/collision/shapes/AABB.cpp @@ -24,12 +24,11 @@ ********************************************************************************/ // Libraries -#include "AABB.h" -#include "configuration.h" #include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/collision/shapes/AABB.h" using namespace reactphysics3d; -using namespace std; // Constructor AABB::AABB() { diff --git a/src/collision/shapes/BoxShape.cpp b/src/reactphysics3d/collision/shapes/BoxShape.cpp similarity index 97% rename from src/collision/shapes/BoxShape.cpp rename to src/reactphysics3d/collision/shapes/BoxShape.cpp index 76c11e31c..407b5c5df 100644 --- a/src/collision/shapes/BoxShape.cpp +++ b/src/reactphysics3d/collision/shapes/BoxShape.cpp @@ -24,11 +24,11 @@ ********************************************************************************/ // Libraries -#include "BoxShape.h" -#include "collision/ProxyShape.h" -#include "configuration.h" -#include #include +#include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/collision/shapes/BoxShape.h" +#include "reactphysics3d/collision/ProxyShape.h" using namespace reactphysics3d; diff --git a/src/collision/shapes/CapsuleShape.cpp b/src/reactphysics3d/collision/shapes/CapsuleShape.cpp similarity index 99% rename from src/collision/shapes/CapsuleShape.cpp rename to src/reactphysics3d/collision/shapes/CapsuleShape.cpp index ff2681ffb..7260b7fdf 100644 --- a/src/collision/shapes/CapsuleShape.cpp +++ b/src/reactphysics3d/collision/shapes/CapsuleShape.cpp @@ -24,10 +24,10 @@ ********************************************************************************/ // Libraries -#include "CapsuleShape.h" -#include "collision/ProxyShape.h" -#include "configuration.h" #include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/collision/shapes/CapsuleShape.h" +#include "reactphysics3d/collision/ProxyShape.h" using namespace reactphysics3d; diff --git a/src/collision/shapes/CollisionShape.cpp b/src/reactphysics3d/collision/shapes/CollisionShape.cpp similarity index 96% rename from src/collision/shapes/CollisionShape.cpp rename to src/reactphysics3d/collision/shapes/CollisionShape.cpp index 843f1c846..9d39098ea 100644 --- a/src/collision/shapes/CollisionShape.cpp +++ b/src/reactphysics3d/collision/shapes/CollisionShape.cpp @@ -24,11 +24,10 @@ ********************************************************************************/ // Libraries -#include "CollisionShape.h" -#include "engine/Profiler.h" -#include "body/CollisionBody.h" +#include "reactphysics3d/body/CollisionBody.h" +#include "reactphysics3d/collision/shapes/CollisionShape.h" +#include "reactphysics3d/engine/Profiler.h" -// We want to use the ReactPhysics3D namespace using namespace reactphysics3d; // Constructor diff --git a/src/collision/shapes/ConeShape.cpp b/src/reactphysics3d/collision/shapes/ConeShape.cpp similarity index 98% rename from src/collision/shapes/ConeShape.cpp rename to src/reactphysics3d/collision/shapes/ConeShape.cpp index 146e7b8a9..0eb0a002d 100644 --- a/src/collision/shapes/ConeShape.cpp +++ b/src/reactphysics3d/collision/shapes/ConeShape.cpp @@ -25,9 +25,9 @@ // Libraries #include -#include "configuration.h" -#include "ConeShape.h" -#include "collision/ProxyShape.h" +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/collision/shapes/ConeShape.h" +#include "reactphysics3d/collision/ProxyShape.h" using namespace reactphysics3d; diff --git a/src/collision/shapes/ConvexMeshShape.cpp b/src/reactphysics3d/collision/shapes/ConvexMeshShape.cpp similarity index 99% rename from src/collision/shapes/ConvexMeshShape.cpp rename to src/reactphysics3d/collision/shapes/ConvexMeshShape.cpp index aa4cf81e5..f60fc54b2 100644 --- a/src/collision/shapes/ConvexMeshShape.cpp +++ b/src/reactphysics3d/collision/shapes/ConvexMeshShape.cpp @@ -25,8 +25,8 @@ // Libraries #include -#include "configuration.h" -#include "ConvexMeshShape.h" +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/collision/shapes/ConvexMeshShape.h" using namespace reactphysics3d; diff --git a/src/collision/shapes/CylinderShape.cpp b/src/reactphysics3d/collision/shapes/CylinderShape.cpp similarity index 98% rename from src/collision/shapes/CylinderShape.cpp rename to src/reactphysics3d/collision/shapes/CylinderShape.cpp index 90dc9e0ce..bb923cd42 100644 --- a/src/collision/shapes/CylinderShape.cpp +++ b/src/reactphysics3d/collision/shapes/CylinderShape.cpp @@ -24,9 +24,9 @@ ********************************************************************************/ // Libraries -#include "CylinderShape.h" -#include "collision/ProxyShape.h" -#include "configuration.h" +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/collision/shapes/CylinderShape.h" +#include "reactphysics3d/collision/ProxyShape.h" using namespace reactphysics3d; diff --git a/src/collision/shapes/SphereShape.cpp b/src/reactphysics3d/collision/shapes/SphereShape.cpp similarity index 96% rename from src/collision/shapes/SphereShape.cpp rename to src/reactphysics3d/collision/shapes/SphereShape.cpp index 7cae0b1a9..22be14758 100644 --- a/src/collision/shapes/SphereShape.cpp +++ b/src/reactphysics3d/collision/shapes/SphereShape.cpp @@ -24,10 +24,10 @@ ********************************************************************************/ // Libraries -#include "SphereShape.h" -#include "collision/ProxyShape.h" -#include "configuration.h" #include +#include "reactphysics3d/configuration.h" +#include "reactphysics3d/collision/shapes/SphereShape.h" +#include "reactphysics3d/collision/ProxyShape.h" using namespace reactphysics3d; diff --git a/src/constraint/BallAndSocketJoint.cpp b/src/reactphysics3d/constraint/BallAndSocketJoint.cpp similarity index 98% rename from src/constraint/BallAndSocketJoint.cpp rename to src/reactphysics3d/constraint/BallAndSocketJoint.cpp index 30b6b8246..87ddf82e2 100644 --- a/src/constraint/BallAndSocketJoint.cpp +++ b/src/reactphysics3d/constraint/BallAndSocketJoint.cpp @@ -24,8 +24,8 @@ ********************************************************************************/ // Libraries -#include "BallAndSocketJoint.h" -#include "engine/ConstraintSolver.h" +#include "reactphysics3d/constraint/BallAndSocketJoint.h" +#include "reactphysics3d/engine/ConstraintSolver.h" using namespace reactphysics3d; diff --git a/src/constraint/ContactPoint.cpp b/src/reactphysics3d/constraint/ContactPoint.cpp similarity index 96% rename from src/constraint/ContactPoint.cpp rename to src/reactphysics3d/constraint/ContactPoint.cpp index 94a7bb41a..b176405d2 100644 --- a/src/constraint/ContactPoint.cpp +++ b/src/reactphysics3d/constraint/ContactPoint.cpp @@ -24,11 +24,10 @@ ********************************************************************************/ // Libraries -#include "ContactPoint.h" -#include "collision/ProxyShape.h" +#include "reactphysics3d/collision/ProxyShape.h" +#include "reactphysics3d/constraint/ContactPoint.h" using namespace reactphysics3d; -using namespace std; // Constructor ContactPoint::ContactPoint(const ContactPointInfo& contactInfo) diff --git a/src/constraint/FixedJoint.cpp b/src/reactphysics3d/constraint/FixedJoint.cpp similarity index 99% rename from src/constraint/FixedJoint.cpp rename to src/reactphysics3d/constraint/FixedJoint.cpp index 7a01f72b4..d6bc31b54 100644 --- a/src/constraint/FixedJoint.cpp +++ b/src/reactphysics3d/constraint/FixedJoint.cpp @@ -24,8 +24,8 @@ ********************************************************************************/ // Libraries -#include "FixedJoint.h" -#include "engine/ConstraintSolver.h" +#include "reactphysics3d/constraint/FixedJoint.h" +#include "reactphysics3d/engine/ConstraintSolver.h" using namespace reactphysics3d; diff --git a/src/constraint/HingeJoint.cpp b/src/reactphysics3d/constraint/HingeJoint.cpp similarity index 99% rename from src/constraint/HingeJoint.cpp rename to src/reactphysics3d/constraint/HingeJoint.cpp index 8d113636c..0544d1546 100644 --- a/src/constraint/HingeJoint.cpp +++ b/src/reactphysics3d/constraint/HingeJoint.cpp @@ -24,9 +24,9 @@ ********************************************************************************/ // Libraries -#include "HingeJoint.h" -#include "engine/ConstraintSolver.h" #include +#include "reactphysics3d/constraint/HingeJoint.h" +#include "reactphysics3d/engine/ConstraintSolver.h" using namespace reactphysics3d; diff --git a/src/constraint/Joint.cpp b/src/reactphysics3d/constraint/Joint.cpp similarity index 98% rename from src/constraint/Joint.cpp rename to src/reactphysics3d/constraint/Joint.cpp index 92c99821f..8448b18ba 100644 --- a/src/constraint/Joint.cpp +++ b/src/reactphysics3d/constraint/Joint.cpp @@ -24,7 +24,7 @@ ********************************************************************************/ // Libraries -#include "Joint.h" +#include "reactphysics3d/constraint/Joint.h" using namespace reactphysics3d; diff --git a/src/constraint/SliderJoint.cpp b/src/reactphysics3d/constraint/SliderJoint.cpp similarity index 99% rename from src/constraint/SliderJoint.cpp rename to src/reactphysics3d/constraint/SliderJoint.cpp index 4fe958210..026b560c5 100644 --- a/src/constraint/SliderJoint.cpp +++ b/src/reactphysics3d/constraint/SliderJoint.cpp @@ -24,7 +24,7 @@ ********************************************************************************/ // Libraries -#include "SliderJoint.h" +#include "reactphysics3d/constraint/SliderJoint.h" using namespace reactphysics3d; diff --git a/src/engine/CollisionWorld.cpp b/src/reactphysics3d/engine/CollisionWorld.cpp similarity index 99% rename from src/engine/CollisionWorld.cpp rename to src/reactphysics3d/engine/CollisionWorld.cpp index c129c92ac..141b7f520 100644 --- a/src/engine/CollisionWorld.cpp +++ b/src/reactphysics3d/engine/CollisionWorld.cpp @@ -24,12 +24,11 @@ ********************************************************************************/ // Libraries -#include "CollisionWorld.h" #include +#include "reactphysics3d/engine/CollisionWorld.h" // Namespaces using namespace reactphysics3d; -using namespace std; // Constructor CollisionWorld::CollisionWorld() diff --git a/src/engine/ConstraintSolver.cpp b/src/reactphysics3d/engine/ConstraintSolver.cpp similarity index 97% rename from src/engine/ConstraintSolver.cpp rename to src/reactphysics3d/engine/ConstraintSolver.cpp index f8d225777..11ef39ebe 100644 --- a/src/engine/ConstraintSolver.cpp +++ b/src/reactphysics3d/engine/ConstraintSolver.cpp @@ -24,8 +24,8 @@ ********************************************************************************/ // Libraries -#include "ConstraintSolver.h" -#include "Profiler.h" +#include "reactphysics3d/engine/ConstraintSolver.h" +#include "reactphysics3d/engine/Profiler.h" using namespace reactphysics3d; diff --git a/src/engine/ContactManifold.cpp b/src/reactphysics3d/engine/ContactManifold.cpp similarity index 99% rename from src/engine/ContactManifold.cpp rename to src/reactphysics3d/engine/ContactManifold.cpp index f5f74b35c..5d008d09a 100644 --- a/src/engine/ContactManifold.cpp +++ b/src/reactphysics3d/engine/ContactManifold.cpp @@ -24,8 +24,7 @@ ********************************************************************************/ // Libraries -#include -#include "ContactManifold.h" +#include "reactphysics3d/engine/ContactManifold.h" using namespace reactphysics3d; diff --git a/src/engine/ContactSolver.cpp b/src/reactphysics3d/engine/ContactSolver.cpp similarity index 99% rename from src/engine/ContactSolver.cpp rename to src/reactphysics3d/engine/ContactSolver.cpp index bb32bf852..5e0ff8f0b 100644 --- a/src/engine/ContactSolver.cpp +++ b/src/reactphysics3d/engine/ContactSolver.cpp @@ -24,14 +24,13 @@ ********************************************************************************/ // Libraries -#include "ContactSolver.h" -#include "DynamicsWorld.h" -#include "body/RigidBody.h" -#include "Profiler.h" #include +#include "reactphysics3d/body/RigidBody.h" +#include "reactphysics3d/engine/ContactSolver.h" +#include "reactphysics3d/engine/DynamicsWorld.h" +#include "reactphysics3d/engine/Profiler.h" using namespace reactphysics3d; -using namespace std; // Constants initialization const decimal ContactSolver::BETA = decimal(0.2); @@ -503,7 +502,7 @@ void ContactSolver::solve() { decimal beta = mIsSplitImpulseActive ? BETA_SPLIT_IMPULSE : BETA; decimal biasPenetrationDepth = 0.0; if (contactPoint.penetrationDepth > SLOP) biasPenetrationDepth = -(beta/mTimeStep) * - max(0.0f, float(contactPoint.penetrationDepth - SLOP)); + std::max(0.0f, float(contactPoint.penetrationDepth - SLOP)); decimal b = biasPenetrationDepth + contactPoint.restitutionBias; // Compute the Lagrange multiplier lambda diff --git a/src/engine/DynamicsWorld.cpp b/src/reactphysics3d/engine/DynamicsWorld.cpp similarity index 99% rename from src/engine/DynamicsWorld.cpp rename to src/reactphysics3d/engine/DynamicsWorld.cpp index 97fcfcda0..fceb492d5 100644 --- a/src/engine/DynamicsWorld.cpp +++ b/src/reactphysics3d/engine/DynamicsWorld.cpp @@ -24,15 +24,14 @@ ********************************************************************************/ // Libraries -#include "DynamicsWorld.h" -#include "constraint/BallAndSocketJoint.h" -#include "constraint/SliderJoint.h" -#include "constraint/HingeJoint.h" -#include "constraint/FixedJoint.h" +#include "reactphysics3d/constraint/BallAndSocketJoint.h" +#include "reactphysics3d/constraint/SliderJoint.h" +#include "reactphysics3d/constraint/HingeJoint.h" +#include "reactphysics3d/constraint/FixedJoint.h" +#include "reactphysics3d/engine/DynamicsWorld.h" // Namespaces using namespace reactphysics3d; -using namespace std; // Constructor /** diff --git a/src/engine/Island.cpp b/src/reactphysics3d/engine/Island.cpp similarity index 98% rename from src/engine/Island.cpp rename to src/reactphysics3d/engine/Island.cpp index 7e1ef9c83..0030acbd3 100644 --- a/src/engine/Island.cpp +++ b/src/reactphysics3d/engine/Island.cpp @@ -24,7 +24,7 @@ ********************************************************************************/ // Libraries -#include "Island.h" +#include "reactphysics3d/engine/Island.h" using namespace reactphysics3d; diff --git a/src/engine/Material.cpp b/src/reactphysics3d/engine/Material.cpp similarity index 98% rename from src/engine/Material.cpp rename to src/reactphysics3d/engine/Material.cpp index 1eff58f8c..9fb2fc58f 100644 --- a/src/engine/Material.cpp +++ b/src/reactphysics3d/engine/Material.cpp @@ -24,7 +24,7 @@ ********************************************************************************/ // Libraries -#include "Material.h" +#include "reactphysics3d/engine/Material.h" using namespace reactphysics3d; diff --git a/src/engine/OverlappingPair.cpp b/src/reactphysics3d/engine/OverlappingPair.cpp similarity index 97% rename from src/engine/OverlappingPair.cpp rename to src/reactphysics3d/engine/OverlappingPair.cpp index 979189b67..b8ada36b0 100644 --- a/src/engine/OverlappingPair.cpp +++ b/src/reactphysics3d/engine/OverlappingPair.cpp @@ -24,11 +24,10 @@ ********************************************************************************/ // Libraries -#include "OverlappingPair.h" +#include "reactphysics3d/engine/OverlappingPair.h" using namespace reactphysics3d; - // Constructor OverlappingPair::OverlappingPair(ProxyShape* shape1, ProxyShape* shape2, MemoryAllocator& memoryAllocator) diff --git a/src/engine/Profiler.cpp b/src/reactphysics3d/engine/Profiler.cpp similarity index 100% rename from src/engine/Profiler.cpp rename to src/reactphysics3d/engine/Profiler.cpp diff --git a/src/mathematics/Matrix2x2.cpp b/src/reactphysics3d/mathematics/Matrix2x2.cpp similarity index 98% rename from src/mathematics/Matrix2x2.cpp rename to src/reactphysics3d/mathematics/Matrix2x2.cpp index 40da18199..1f00795f0 100644 --- a/src/mathematics/Matrix2x2.cpp +++ b/src/reactphysics3d/mathematics/Matrix2x2.cpp @@ -24,13 +24,12 @@ ********************************************************************************/ // Libraries -#include "Matrix2x2.h" +#include "reactphysics3d/mathematics/Matrix2x2.h" using namespace reactphysics3d; // Constructor of the class Matrix2x2 Matrix2x2::Matrix2x2() { - // Initialize all values in the matrix to zero setAllValues(0.0, 0.0, 0.0, 0.0); } diff --git a/src/mathematics/Matrix3x3.cpp b/src/reactphysics3d/mathematics/Matrix3x3.cpp similarity index 98% rename from src/mathematics/Matrix3x3.cpp rename to src/reactphysics3d/mathematics/Matrix3x3.cpp index e63a97bff..61c3ebf77 100644 --- a/src/mathematics/Matrix3x3.cpp +++ b/src/reactphysics3d/mathematics/Matrix3x3.cpp @@ -24,10 +24,8 @@ ********************************************************************************/ // Libraries -#include -#include "Matrix3x3.h" +#include "reactphysics3d/mathematics/Matrix3x3.h" -// Namespaces using namespace reactphysics3d; // Constructor of the class Matrix3x3 diff --git a/src/mathematics/Quaternion.cpp b/src/reactphysics3d/mathematics/Quaternion.cpp similarity index 98% rename from src/mathematics/Quaternion.cpp rename to src/reactphysics3d/mathematics/Quaternion.cpp index 7c85d0625..d87153455 100644 --- a/src/mathematics/Quaternion.cpp +++ b/src/reactphysics3d/mathematics/Quaternion.cpp @@ -24,11 +24,10 @@ ********************************************************************************/ // Libraries -#include "Quaternion.h" -#include "Vector3.h" #include +#include "reactphysics3d/mathematics/Vector3.h" +#include "reactphysics3d/mathematics/Quaternion.h" -// Namespace using namespace reactphysics3d; // Constructor of the class diff --git a/src/mathematics/Transform.cpp b/src/reactphysics3d/mathematics/Transform.cpp similarity index 98% rename from src/mathematics/Transform.cpp rename to src/reactphysics3d/mathematics/Transform.cpp index f6f897f14..96df3ef16 100644 --- a/src/mathematics/Transform.cpp +++ b/src/reactphysics3d/mathematics/Transform.cpp @@ -24,9 +24,8 @@ ********************************************************************************/ // Libraries -#include "Transform.h" +#include "reactphysics3d/mathematics/Transform.h" -// Namespaces using namespace reactphysics3d; // Constructor diff --git a/src/mathematics/Vector2.cpp b/src/reactphysics3d/mathematics/Vector2.cpp similarity index 98% rename from src/mathematics/Vector2.cpp rename to src/reactphysics3d/mathematics/Vector2.cpp index ccad70dc9..19e98bd03 100644 --- a/src/mathematics/Vector2.cpp +++ b/src/reactphysics3d/mathematics/Vector2.cpp @@ -24,10 +24,8 @@ ********************************************************************************/ // Libraries -#include "Vector2.h" -#include +#include "reactphysics3d/mathematics/Vector2.h" -// Namespaces using namespace reactphysics3d; // Constructor diff --git a/src/mathematics/Vector3.cpp b/src/reactphysics3d/mathematics/Vector3.cpp similarity index 96% rename from src/mathematics/Vector3.cpp rename to src/reactphysics3d/mathematics/Vector3.cpp index 1e33136af..50cf07e1f 100644 --- a/src/mathematics/Vector3.cpp +++ b/src/reactphysics3d/mathematics/Vector3.cpp @@ -24,14 +24,11 @@ ********************************************************************************/ // Libraries -#include "Vector3.h" -#include -#include +#include "reactphysics3d/mathematics/Vector3.h" -// Namespaces using namespace reactphysics3d; -// Constructor of the class Vector3D +// Constructor Vector3::Vector3() : x(0.0), y(0.0), z(0.0) { } diff --git a/src/memory/MemoryAllocator.cpp b/src/reactphysics3d/memory/MemoryAllocator.cpp similarity index 99% rename from src/memory/MemoryAllocator.cpp rename to src/reactphysics3d/memory/MemoryAllocator.cpp index e2dd5a48f..5e01b9fea 100644 --- a/src/memory/MemoryAllocator.cpp +++ b/src/reactphysics3d/memory/MemoryAllocator.cpp @@ -24,9 +24,9 @@ ********************************************************************************/ // Libraries -#include "MemoryAllocator.h" -#include #include +#include +#include "reactphysics3d/memory/MemoryAllocator.h" using namespace reactphysics3d; diff --git a/testbed/CMakeLists.txt b/testbed/CMakeLists.txt index 12bbea840..42ec3f0e9 100644 --- a/testbed/CMakeLists.txt +++ b/testbed/CMakeLists.txt @@ -26,7 +26,8 @@ FILE(COPY "shaders/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/shaders/") FILE(COPY "meshes/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/meshes/") # Headers -INCLUDE_DIRECTORIES("src/" "opengl-framework/src/" "glfw/include/" "common/" "scenes/" "imgui/") +INCLUDE_DIRECTORIES("../include/reactphysics3d" "src" "opengl-framework/src/" + "glfw/include/" "common/" "scenes/" "imgui/") # Testbed source files SET(TESTBED_SOURCES