From dd0f022d1daf65c7accc91369042f509a922a201 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Wed, 21 Jul 2010 19:11:28 +0000 Subject: [PATCH] trying to sort out the vectormath include path mess: move vectormath to src folder, and add a vmInclude.h that contains the logic in a single location. If you still need a system-wide vectormath, make sure to define USE_SYSTEM_VECTORMATH (in build system) --- Demos/DX11ClothDemo/cloth_renderer.cpp | 2 +- .../CPU/btSoftBodySolverData.h | 2 +- .../CPU/btSoftBodySolver_CPU.cpp | 2 +- .../CPU/btSoftBodySolver_CPU.h | 3 +- .../DX11/btSoftBodySolver_DX11.cpp | 2 +- .../DX11/btSoftBodySolver_DX11.h | 3 +- .../OpenCL/btSoftBodySolver_OpenCL.cpp | 5 +-- .../OpenCL/btSoftBodySolver_OpenCL.h | 5 +-- src/BulletMultiThreaded/PlatformDefinitions.h | 8 ++--- .../SpuNarrowPhaseCollisionTask/Box.h | 3 +- src/BulletMultiThreaded/TrbDynBody.h | 2 +- src/BulletMultiThreaded/TrbStateVec.h | 2 +- .../btParallelConstraintSolver.cpp | 3 +- src/BulletMultiThreaded/vectormath2bullet.h | 3 +- .../vectormath/scalar/boolInVec.h | 0 .../vectormath/scalar/floatInVec.h | 0 .../vectormath/scalar/mat_aos.h | 0 .../vectormath/scalar/quat_aos.h | 0 .../vectormath/scalar/vec_aos.h | 0 .../vectormath/scalar/vectormath_aos.h | 0 .../vectormath/sse/boolInVec.h | 0 .../vectormath/sse/floatInVec.h | 0 .../vectormath/sse/mat_aos.h | 0 .../vectormath/sse/quat_aos.h | 0 .../vectormath/sse/vec_aos.h | 0 .../vectormath/sse/vecidx_aos.h | 0 .../vectormath/sse/vectormath_aos.h | 0 src/vectormath/vmInclude.h | 33 +++++++++++++++++++ 28 files changed, 48 insertions(+), 30 deletions(-) rename src/{BulletMultiThreaded => }/vectormath/scalar/boolInVec.h (100%) rename src/{BulletMultiThreaded => }/vectormath/scalar/floatInVec.h (100%) rename src/{BulletMultiThreaded => }/vectormath/scalar/mat_aos.h (100%) rename src/{BulletMultiThreaded => }/vectormath/scalar/quat_aos.h (100%) rename src/{BulletMultiThreaded => }/vectormath/scalar/vec_aos.h (100%) rename src/{BulletMultiThreaded => }/vectormath/scalar/vectormath_aos.h (100%) rename src/{BulletMultiThreaded => }/vectormath/sse/boolInVec.h (100%) rename src/{BulletMultiThreaded => }/vectormath/sse/floatInVec.h (100%) rename src/{BulletMultiThreaded => }/vectormath/sse/mat_aos.h (100%) rename src/{BulletMultiThreaded => }/vectormath/sse/quat_aos.h (100%) rename src/{BulletMultiThreaded => }/vectormath/sse/vec_aos.h (100%) rename src/{BulletMultiThreaded => }/vectormath/sse/vecidx_aos.h (100%) rename src/{BulletMultiThreaded => }/vectormath/sse/vectormath_aos.h (100%) create mode 100644 src/vectormath/vmInclude.h diff --git a/Demos/DX11ClothDemo/cloth_renderer.cpp b/Demos/DX11ClothDemo/cloth_renderer.cpp index 2a5a93c20..07848f731 100644 --- a/Demos/DX11ClothDemo/cloth_renderer.cpp +++ b/Demos/DX11ClothDemo/cloth_renderer.cpp @@ -21,7 +21,7 @@ #include "BulletSoftBody/btSoftRigidDynamicsWorld.h" #include "BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverVertexBuffer_DX11.h" #include "BulletSoftBody/btSoftBodyHelpers.h" -#include "vectormath_aos.h" +#include "vectormath/vmInclude.h" class btDefaultSoftBodySolver; class btCPUSoftBodySolver; diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h b/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h index b99412b5d..200b20535 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h @@ -17,7 +17,7 @@ subject to the following restrictions: #define BT_SOFT_BODY_SOLVER_DATA_H #include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h" -#include "vectormath_aos.h" +#include "vectormath/vmInclude.h" class btSoftBodyLinkData diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp b/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp index bf8194228..a7ff177f6 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp @@ -16,7 +16,7 @@ subject to the following restrictions: #include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/CollisionShapes/btCollisionShape.h" -#include "vectormath_aos.h" +#include "vectormath/vmInclude.h" #include "BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h" #include "BulletSoftBody/btSoftBody.h" diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h b/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h index 51adedf39..0e014c7d7 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h @@ -16,8 +16,7 @@ subject to the following restrictions: #ifndef BT_ACCELERATED_SOFT_BODY_CPU_SOLVER_H #define BT_ACCELERATED_SOFT_BODY_CPU_SOLVER_H -#include "vectormath_aos.h" - +#include "vectormath/vmInclude.h" #include "BulletSoftBody/btSoftBodySolvers.h" #include "BulletSoftBody/btSoftBodySolverVertexBuffer.h" #include "BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h" diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp index eeead9ab5..9c9b325a8 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp @@ -14,7 +14,7 @@ subject to the following restrictions: */ #include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h" -#include "vectormath_aos.h" +#include "vectormath/vmInclude.h" #include "btSoftBodySolver_DX11.h" #include "btSoftBodySolverVertexBuffer_DX11.h" diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h index 9bdae8b5c..a61e5166c 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h @@ -14,8 +14,7 @@ subject to the following restrictions: */ -#include "vectormath_aos.h" - +#include "vectormath/vmInclude.h" #include "BulletSoftBody/btSoftBodySolvers.h" #include "btSoftBodySolverVertexBuffer_DX11.h" #include "btSoftBodySolverLinkData_DX11.h" diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp index af8be10ed..31b52f679 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp @@ -15,10 +15,7 @@ subject to the following restrictions: #include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h" -#include "BulletMultiThreaded/vectormath/scalar/cpp/vectormath_aos.h" -#include "BulletMultiThreaded/vectormath/scalar/cpp/mat_aos.h" -#include "BulletMultiThreaded/vectormath/scalar/cpp/vec_aos.h" - +#include "vectormath/vmInclude.h" #include "BulletSoftBody/solvers/OpenCL/btSoftBodySolver_OpenCL.h" #include "BulletSoftBody/VertexBuffers/btSoftBodySolverVertexBuffer.h" #include "BulletSoftBody/btSoftBody.h" diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.h b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.h index 9fd86a854..84d208488 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.h +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.h @@ -16,10 +16,7 @@ subject to the following restrictions: #ifndef BT_SOFT_BODY_SOLVER_OPENCL_H #define BT_SOFT_BODY_SOLVER_OPENCL_H -#include "BulletMultiThreaded/vectormath/scalar/cpp/vectormath_aos.h" -#include "BulletMultiThreaded/vectormath/scalar/cpp/mat_aos.h" -#include "BulletMultiThreaded/vectormath/scalar/cpp/vec_aos.h" - +#include "vectormath/vmInclude.h" #include "BulletSoftBody/btSoftBodySolvers.h" #include "BulletSoftBody/solvers/OpenCL/btSoftBodySolverBuffer_OpenCL.h" #include "BulletSoftBody/solvers/OpenCL/btSoftBodySolverLinkData_OpenCL.h" diff --git a/src/BulletMultiThreaded/PlatformDefinitions.h b/src/BulletMultiThreaded/PlatformDefinitions.h index db4e2eebd..6e8ee0d27 100644 --- a/src/BulletMultiThreaded/PlatformDefinitions.h +++ b/src/BulletMultiThreaded/PlatformDefinitions.h @@ -5,12 +5,8 @@ #include "LinearMath/btScalar.h" #include "LinearMath/btMinMax.h" -#include "vectormath_aos.h" -typedef Vectormath::Aos::Vector3 vmVector3; -typedef Vectormath::Aos::Quat vmQuat; -typedef Vectormath::Aos::Matrix3 vmMatrix3; -typedef Vectormath::Aos::Transform3 vmTransform3; -typedef Vectormath::Aos::Point3 vmPoint3; +#include "vectormath/vmInclude.h" + diff --git a/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h b/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h index e07c731ef..eecee006a 100644 --- a/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h +++ b/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h @@ -24,8 +24,7 @@ subject to the following restrictions: #include -///only use a system-wide vectormath_aos.h on CELLOS_LV2 or if USE_SYSTEM_VECTORMATH -#include "vectormath_aos.h" +#include "vectormath/vmInclude.h" #include "../PlatformDefinitions.h" diff --git a/src/BulletMultiThreaded/TrbDynBody.h b/src/BulletMultiThreaded/TrbDynBody.h index d65c22e69..679dc4827 100644 --- a/src/BulletMultiThreaded/TrbDynBody.h +++ b/src/BulletMultiThreaded/TrbDynBody.h @@ -17,7 +17,7 @@ subject to the following restrictions: #ifndef __T_RB_DYN_BODY_H__ #define __T_RB_DYN_BODY_H__ -#include +#include "vectormath/vmInclude.h" using namespace Vectormath::Aos; #include "TrbStateVec.h" diff --git a/src/BulletMultiThreaded/TrbStateVec.h b/src/BulletMultiThreaded/TrbStateVec.h index 8a76a33d0..60cfd64fb 100644 --- a/src/BulletMultiThreaded/TrbStateVec.h +++ b/src/BulletMultiThreaded/TrbStateVec.h @@ -18,7 +18,7 @@ subject to the following restrictions: #define __TRBSTATEVEC_H__ #include -#include +#include "vectormath/vmInclude.h" #include "PlatformDefinitions.h" diff --git a/src/BulletMultiThreaded/btParallelConstraintSolver.cpp b/src/BulletMultiThreaded/btParallelConstraintSolver.cpp index c215e49b4..8b83a1146 100644 --- a/src/BulletMultiThreaded/btParallelConstraintSolver.cpp +++ b/src/BulletMultiThreaded/btParallelConstraintSolver.cpp @@ -21,8 +21,7 @@ subject to the following restrictions: #include "LinearMath/btQuickprof.h" #include "BulletMultiThreaded/btThreadSupportInterface.h" -#include "vectormath_aos.h" - +#include "vectormath/vmInclude.h" #include "HeapManager.h" diff --git a/src/BulletMultiThreaded/vectormath2bullet.h b/src/BulletMultiThreaded/vectormath2bullet.h index df0f688d4..16e730171 100644 --- a/src/BulletMultiThreaded/vectormath2bullet.h +++ b/src/BulletMultiThreaded/vectormath2bullet.h @@ -31,8 +31,7 @@ #define AOS_VECTORMATH_BULLET_CONVERT_H -#include "vectormath_aos.h" - +#include "vectormath/vmInclude.h" #include "LinearMath/btVector3.h" #include "LinearMath/btQuaternion.h" #include "LinearMath/btMatrix3x3.h" diff --git a/src/BulletMultiThreaded/vectormath/scalar/boolInVec.h b/src/vectormath/scalar/boolInVec.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/scalar/boolInVec.h rename to src/vectormath/scalar/boolInVec.h diff --git a/src/BulletMultiThreaded/vectormath/scalar/floatInVec.h b/src/vectormath/scalar/floatInVec.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/scalar/floatInVec.h rename to src/vectormath/scalar/floatInVec.h diff --git a/src/BulletMultiThreaded/vectormath/scalar/mat_aos.h b/src/vectormath/scalar/mat_aos.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/scalar/mat_aos.h rename to src/vectormath/scalar/mat_aos.h diff --git a/src/BulletMultiThreaded/vectormath/scalar/quat_aos.h b/src/vectormath/scalar/quat_aos.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/scalar/quat_aos.h rename to src/vectormath/scalar/quat_aos.h diff --git a/src/BulletMultiThreaded/vectormath/scalar/vec_aos.h b/src/vectormath/scalar/vec_aos.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/scalar/vec_aos.h rename to src/vectormath/scalar/vec_aos.h diff --git a/src/BulletMultiThreaded/vectormath/scalar/vectormath_aos.h b/src/vectormath/scalar/vectormath_aos.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/scalar/vectormath_aos.h rename to src/vectormath/scalar/vectormath_aos.h diff --git a/src/BulletMultiThreaded/vectormath/sse/boolInVec.h b/src/vectormath/sse/boolInVec.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/sse/boolInVec.h rename to src/vectormath/sse/boolInVec.h diff --git a/src/BulletMultiThreaded/vectormath/sse/floatInVec.h b/src/vectormath/sse/floatInVec.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/sse/floatInVec.h rename to src/vectormath/sse/floatInVec.h diff --git a/src/BulletMultiThreaded/vectormath/sse/mat_aos.h b/src/vectormath/sse/mat_aos.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/sse/mat_aos.h rename to src/vectormath/sse/mat_aos.h diff --git a/src/BulletMultiThreaded/vectormath/sse/quat_aos.h b/src/vectormath/sse/quat_aos.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/sse/quat_aos.h rename to src/vectormath/sse/quat_aos.h diff --git a/src/BulletMultiThreaded/vectormath/sse/vec_aos.h b/src/vectormath/sse/vec_aos.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/sse/vec_aos.h rename to src/vectormath/sse/vec_aos.h diff --git a/src/BulletMultiThreaded/vectormath/sse/vecidx_aos.h b/src/vectormath/sse/vecidx_aos.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/sse/vecidx_aos.h rename to src/vectormath/sse/vecidx_aos.h diff --git a/src/BulletMultiThreaded/vectormath/sse/vectormath_aos.h b/src/vectormath/sse/vectormath_aos.h similarity index 100% rename from src/BulletMultiThreaded/vectormath/sse/vectormath_aos.h rename to src/vectormath/sse/vectormath_aos.h diff --git a/src/vectormath/vmInclude.h b/src/vectormath/vmInclude.h new file mode 100644 index 000000000..7334691a2 --- /dev/null +++ b/src/vectormath/vmInclude.h @@ -0,0 +1,33 @@ + +#ifndef __VM_INCLUDE_H +#define __VM_INCLUDE_H + +#include "LinearMath/btScalar.h" + +#if defined (USE_SYSTEM_VECTORMATH) + #include +#else //(USE_SYSTEM_VECTORMATH) + #if defined (BT_USE_SSE) && defined (_WIN32) + #include "sse/vectormath_aos.h" + #elif defined (__CELLOS_LV2__) + #ifdef __SPU__ + #include "spu/vectormath_aos.h" + #else + #include "ppu/vectormath_aos.h" + #endif //__SPU__ + #else //all other platforms + #include "scalar/vectormath_aos.h" + #endif //(BT_USE_SSE) && defined (_WIN32) +#endif //(USE_SYSTEM_VECTORMATH) + + + +typedef Vectormath::Aos::Vector3 vmVector3; +typedef Vectormath::Aos::Quat vmQuat; +typedef Vectormath::Aos::Matrix3 vmMatrix3; +typedef Vectormath::Aos::Transform3 vmTransform3; +typedef Vectormath::Aos::Point3 vmPoint3; + +#endif //__VM_INCLUDE_H + +