diff --git a/CMakeLists.txt b/CMakeLists.txt index 528b667b8..add6c6a5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,59 +1,69 @@ -cmake_minimum_required(VERSION 2.4) - -PROJECT(BULLET_PHYSICS) - -IF (NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Debug") -ENDIF (NOT CMAKE_BUILD_TYPE) - - - -IF(COMMAND cmake_policy) - cmake_policy(SET CMP0003 NEW) -ENDIF(COMMAND cmake_policy) - - -# This is the shortcut to finding GLU, GLUT and OpenGL if they are properly installed on your system -# This should be the case. - -FIND_PACKAGE(OpenGL) -IF (OPENGL_FOUND) -MESSAGE("OPENGL FOUND") -MESSAGE(${OPENGL_LIBRARIES}) -ELSE (OPENGL_FOUND) -MESSAGE("OPENGL NOT FOUND") -SET(OPENGL_gl_LIBRARY opengl32) -SET(OPENGL_glu_LIBRARY glu32) -ENDIF (OPENGL_FOUND) - -# ADD_DEFINITIONS(-DBT_USE_FREEGLUT) - -FIND_PACKAGE(GLU) - -FIND_PACKAGE(GLUT) -IF (GLUT_FOUND) -MESSAGE("GLUT FOUND") -MESSAGE(${GLUT_glut_LIBRARY}) -ELSE (GLUT_FOUND) - -IF (MINGW) -MESSAGE ("GLUT NOT FOUND not found, trying to use MINGW glut32") -SET(GLUT_glut_LIBRARY glut32) -ENDIF (MINGW) - -IF (MSVC) -MESSAGE ("GLUT NOT FOUND, trying to use Bullet/Glut/glut32.lib for MSVC") -SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Glut/glut32.lib) -ENDIF (MSVC) -ENDIF (GLUT_FOUND) - - -IF (WIN32) - INCLUDE_DIRECTORIES(${BULLET_PHYSICS_SOURCE_DIR}/Glut) -ELSE (WIN32) - # This is the lines for linux. This should always work if everything is installed and working fine. - INCLUDE_DIRECTORIES(/usr/include /usr/local/include ${GLUT_INCLUDE_DIR}) -ENDIF (WIN32) - - -SUBDIRS(src Demos Extras) +cmake_minimum_required(VERSION 2.4) + +PROJECT(BULLET_PHYSICS) + +IF (NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "Debug") +ENDIF (NOT CMAKE_BUILD_TYPE) + + + +IF(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +ENDIF(COMMAND cmake_policy) + + +# This is the shortcut to finding GLU, GLUT and OpenGL if they are properly installed on your system +# This should be the case. + +FIND_PACKAGE(OpenGL) +IF (OPENGL_FOUND) +MESSAGE("OPENGL FOUND") +MESSAGE(${OPENGL_LIBRARIES}) +ELSE (OPENGL_FOUND) +MESSAGE("OPENGL NOT FOUND") +SET(OPENGL_gl_LIBRARY opengl32) +SET(OPENGL_glu_LIBRARY glu32) +ENDIF (OPENGL_FOUND) + +# ADD_DEFINITIONS(-DBT_USE_FREEGLUT) + +FIND_PACKAGE(GLU) + +FIND_PACKAGE(GLUT) +IF (GLUT_FOUND) +MESSAGE("GLUT FOUND") +MESSAGE(${GLUT_glut_LIBRARY}) +ELSE (GLUT_FOUND) + +IF (MINGW) +MESSAGE ("GLUT NOT FOUND not found, trying to use MINGW glut32") +SET(GLUT_glut_LIBRARY glut32) +ENDIF (MINGW) + +IF (MSVC) +MESSAGE ("GLUT NOT FOUND, trying to use Bullet/Glut/glut32.lib for MSVC") +SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Glut/glut32.lib) +ENDIF (MSVC) +ENDIF (GLUT_FOUND) + + +IF (WIN32) + INCLUDE_DIRECTORIES(${BULLET_PHYSICS_SOURCE_DIR}/Glut) +ELSE (WIN32) + # This is the lines for linux. This should always work if everything is installed and working fine. + INCLUDE_DIRECTORIES(/usr/include /usr/local/include ${GLUT_INCLUDE_DIR}) +ENDIF (WIN32) + + +OPTION(BUILD_DEMOS "Set when you want to build the demos" ON) +IF(BUILD_DEMOS) + SUBDIRS(Demos) +ENDIF(BUILD_DEMOS) + +OPTION(BUILD_EXTRAS "Set when you want to build the extras" ON) +IF(BUILD_EXTRAS) + SUBDIRS(Extras) +ENDIF(BUILD_EXTRAS) + +SUBDIRS(src) diff --git a/src/BulletCollision/CMakeLists.txt b/src/BulletCollision/CMakeLists.txt index 331061d7d..f079fb771 100644 --- a/src/BulletCollision/CMakeLists.txt +++ b/src/BulletCollision/CMakeLists.txt @@ -1,135 +1,70 @@ - INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src } ) - -ADD_LIBRARY(LibBulletCollision + +SET(LibBulletCollision_SRCS BroadphaseCollision/btAxisSweep3.cpp - BroadphaseCollision/btAxisSweep3.h BroadphaseCollision/btBroadphaseProxy.cpp - BroadphaseCollision/btBroadphaseProxy.h BroadphaseCollision/btCollisionAlgorithm.cpp - BroadphaseCollision/btCollisionAlgorithm.h BroadphaseCollision/btDispatcher.cpp - BroadphaseCollision/btDispatcher.h BroadphaseCollision/btDbvtBroadphase.cpp - BroadphaseCollision/btDbvtBroadphase.h BroadphaseCollision/btDbvt.cpp - BroadphaseCollision/btDbvt.h BroadphaseCollision/btMultiSapBroadphase.cpp - BroadphaseCollision/btMultiSapBroadphase.h BroadphaseCollision/btOverlappingPairCache.cpp - BroadphaseCollision/btOverlappingPairCache.h - BroadphaseCollision/btOverlappingPairCallback.h BroadphaseCollision/btQuantizedBvh.cpp - BroadphaseCollision/btQuantizedBvh.h BroadphaseCollision/btSimpleBroadphase.cpp - BroadphaseCollision/btSimpleBroadphase.h CollisionDispatch/btCollisionDispatcher.cpp - CollisionDispatch/btCollisionDispatcher.h CollisionDispatch/btCollisionObject.cpp - CollisionDispatch/btCollisionObject.h CollisionDispatch/btCollisionWorld.cpp - CollisionDispatch/btCollisionWorld.h CollisionDispatch/btCompoundCollisionAlgorithm.cpp - CollisionDispatch/btCompoundCollisionAlgorithm.h CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp - CollisionDispatch/btConvexConcaveCollisionAlgorithm.h CollisionDispatch/btDefaultCollisionConfiguration.cpp - CollisionDispatch/btDefaultCollisionConfiguration.h CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp - CollisionDispatch/btSphereSphereCollisionAlgorithm.h CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp - CollisionDispatch/btBoxBoxCollisionAlgorithm.h CollisionDispatch/btBoxBoxDetector.cpp - CollisionDispatch/btBoxBoxDetector.h CollisionDispatch/btGhostObject.cpp - CollisionDispatch/btGhostObject.h CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp - CollisionDispatch/btSphereBoxCollisionAlgorithm.h CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp - CollisionDispatch/btConvexPlaneCollisionAlgorithm.h CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp - CollisionDispatch/btSphereTriangleCollisionAlgorithm.h CollisionDispatch/btConvexConvexAlgorithm.cpp - CollisionDispatch/btConvexConvexAlgorithm.h CollisionDispatch/btEmptyCollisionAlgorithm.cpp - CollisionDispatch/btEmptyCollisionAlgorithm.h CollisionDispatch/btManifoldResult.cpp - CollisionDispatch/btManifoldResult.h CollisionDispatch/btSimulationIslandManager.cpp - CollisionDispatch/btSimulationIslandManager.h CollisionDispatch/btUnionFind.cpp - CollisionDispatch/btUnionFind.h CollisionDispatch/SphereTriangleDetector.cpp - CollisionDispatch/SphereTriangleDetector.h CollisionShapes/btBoxShape.cpp - CollisionShapes/btBoxShape.h CollisionShapes/btBvhTriangleMeshShape.cpp - CollisionShapes/btBvhTriangleMeshShape.h CollisionShapes/btCapsuleShape.cpp - CollisionShapes/btCapsuleShape.h CollisionShapes/btCollisionShape.cpp - CollisionShapes/btCollisionShape.h CollisionShapes/btCompoundShape.cpp - CollisionShapes/btCompoundShape.h CollisionShapes/btConcaveShape.cpp - CollisionShapes/btConcaveShape.h CollisionShapes/btConeShape.cpp - CollisionShapes/btConeShape.h CollisionShapes/btConvexHullShape.cpp - CollisionShapes/btConvexHullShape.h CollisionShapes/btConvexPointCloudShape.cpp - CollisionShapes/btConvexPointCloudShape.h CollisionShapes/btConvexShape.cpp - CollisionShapes/btConvexShape.h CollisionShapes/btConvexInternalShape.cpp - CollisionShapes/btConvexInternalShape.h CollisionShapes/btConvexTriangleMeshShape.cpp - CollisionShapes/btConvexTriangleMeshShape.h CollisionShapes/btCylinderShape.cpp - CollisionShapes/btCylinderShape.h CollisionShapes/btEmptyShape.cpp - CollisionShapes/btEmptyShape.h CollisionShapes/btHeightfieldTerrainShape.cpp - CollisionShapes/btHeightfieldTerrainShape.h CollisionShapes/btMinkowskiSumShape.cpp - CollisionShapes/btMinkowskiSumShape.h - CollisionShapes/btMaterial.h CollisionShapes/btMultimaterialTriangleMeshShape.cpp - CollisionShapes/btMultimaterialTriangleMeshShape.h CollisionShapes/btMultiSphereShape.cpp - CollisionShapes/btMultiSphereShape.h CollisionShapes/btOptimizedBvh.cpp - CollisionShapes/btOptimizedBvh.h CollisionShapes/btPolyhedralConvexShape.cpp - CollisionShapes/btPolyhedralConvexShape.h CollisionShapes/btScaledBvhTriangleMeshShape.cpp - CollisionShapes/btScaledBvhTriangleMeshShape.h CollisionShapes/btTetrahedronShape.cpp - CollisionShapes/btTetrahedronShape.h CollisionShapes/btSphereShape.cpp - CollisionShapes/btSphereShape.h - CollisionShapes/btShapeHull.h CollisionShapes/btShapeHull.cpp CollisionShapes/btStaticPlaneShape.cpp - CollisionShapes/btStaticPlaneShape.h CollisionShapes/btStridingMeshInterface.cpp - CollisionShapes/btStridingMeshInterface.h CollisionShapes/btTriangleCallback.cpp - CollisionShapes/btTriangleCallback.h CollisionShapes/btTriangleBuffer.cpp - CollisionShapes/btTriangleBuffer.h CollisionShapes/btTriangleIndexVertexArray.cpp - CollisionShapes/btTriangleIndexVertexArray.h - CollisionShapes/btTriangleIndexVertexMaterialArray.h CollisionShapes/btTriangleIndexVertexMaterialArray.cpp CollisionShapes/btTriangleMesh.cpp - CollisionShapes/btTriangleMesh.h CollisionShapes/btTriangleMeshShape.cpp - CollisionShapes/btTriangleMeshShape.h CollisionShapes/btUniformScalingShape.cpp - CollisionShapes/btUniformScalingShape.h Gimpact/btContactProcessing.cpp Gimpact/btGImpactShape.cpp Gimpact/gim_contact.cpp @@ -142,25 +77,109 @@ ADD_LIBRARY(LibBulletCollision Gimpact/btGImpactQuantizedBvh.cpp Gimpact/gim_box_set.cpp NarrowPhaseCollision/btContinuousConvexCollision.cpp - NarrowPhaseCollision/btContinuousConvexCollision.h NarrowPhaseCollision/btGjkEpa2.cpp - NarrowPhaseCollision/btGjkEpa2.h NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp - NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h NarrowPhaseCollision/btConvexCast.cpp - NarrowPhaseCollision/btConvexCast.h NarrowPhaseCollision/btGjkConvexCast.cpp - NarrowPhaseCollision/btGjkConvexCast.h NarrowPhaseCollision/btGjkPairDetector.cpp - NarrowPhaseCollision/btGjkPairDetector.h NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp - NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h NarrowPhaseCollision/btPersistentManifold.cpp - NarrowPhaseCollision/btPersistentManifold.h NarrowPhaseCollision/btRaycastCallback.cpp - NarrowPhaseCollision/btRaycastCallback.h NarrowPhaseCollision/btSubSimplexConvexCast.cpp - NarrowPhaseCollision/btSubSimplexConvexCast.h NarrowPhaseCollision/btVoronoiSimplexSolver.cpp +) + +SET(LibBulletCollision_HDRS + BroadphaseCollision/btAxisSweep3.h + BroadphaseCollision/btBroadphaseProxy.h + BroadphaseCollision/btCollisionAlgorithm.h + BroadphaseCollision/btDispatcher.h + BroadphaseCollision/btDbvtBroadphase.h + BroadphaseCollision/btDbvt.h + BroadphaseCollision/btMultiSapBroadphase.h + BroadphaseCollision/btOverlappingPairCache.h + BroadphaseCollision/btOverlappingPairCallback.h + BroadphaseCollision/btQuantizedBvh.h + BroadphaseCollision/btSimpleBroadphase.h + CollisionDispatch/btCollisionDispatcher.h + CollisionDispatch/btCollisionObject.h + CollisionDispatch/btCollisionWorld.h + CollisionDispatch/btCompoundCollisionAlgorithm.h + CollisionDispatch/btConvexConcaveCollisionAlgorithm.h + CollisionDispatch/btDefaultCollisionConfiguration.h + CollisionDispatch/btSphereSphereCollisionAlgorithm.h + CollisionDispatch/btBoxBoxCollisionAlgorithm.h + CollisionDispatch/btBoxBoxDetector.h + CollisionDispatch/btGhostObject.h + CollisionDispatch/btSphereBoxCollisionAlgorithm.h + CollisionDispatch/btConvexPlaneCollisionAlgorithm.h + CollisionDispatch/btSphereTriangleCollisionAlgorithm.h + CollisionDispatch/btConvexConvexAlgorithm.h + CollisionDispatch/btEmptyCollisionAlgorithm.h + CollisionDispatch/btManifoldResult.h + CollisionDispatch/btSimulationIslandManager.h + CollisionDispatch/btUnionFind.h + CollisionDispatch/SphereTriangleDetector.h + CollisionShapes/btBoxShape.h + CollisionShapes/btBvhTriangleMeshShape.h + CollisionShapes/btCapsuleShape.h + CollisionShapes/btCollisionShape.h + CollisionShapes/btCompoundShape.h + CollisionShapes/btConcaveShape.h + CollisionShapes/btConeShape.h + CollisionShapes/btConvexHullShape.h + CollisionShapes/btConvexPointCloudShape.h + CollisionShapes/btConvexShape.h + CollisionShapes/btConvexInternalShape.h + CollisionShapes/btConvexTriangleMeshShape.h + CollisionShapes/btCylinderShape.h + CollisionShapes/btEmptyShape.h + CollisionShapes/btHeightfieldTerrainShape.h + CollisionShapes/btMinkowskiSumShape.h + CollisionShapes/btMaterial.h + CollisionShapes/btMultimaterialTriangleMeshShape.h + CollisionShapes/btMultiSphereShape.h + CollisionShapes/btOptimizedBvh.h + CollisionShapes/btPolyhedralConvexShape.h + CollisionShapes/btScaledBvhTriangleMeshShape.h + CollisionShapes/btTetrahedronShape.h + CollisionShapes/btSphereShape.h + CollisionShapes/btShapeHull.h + CollisionShapes/btStaticPlaneShape.h + CollisionShapes/btStridingMeshInterface.h + CollisionShapes/btTriangleCallback.h + CollisionShapes/btTriangleBuffer.h + CollisionShapes/btTriangleIndexVertexArray.h + CollisionShapes/btTriangleIndexVertexMaterialArray.h + CollisionShapes/btTriangleMesh.h + CollisionShapes/btTriangleMeshShape.h + CollisionShapes/btUniformScalingShape.h + Gimpact/btGImpactShape.h + Gimpact/gim_contact.h + Gimpact/btGImpactBvh.h + Gimpact/btGenericPoolAllocator.h + Gimpact/gim_memory.h + Gimpact/btGImpactCollisionAlgorithm.h + Gimpact/btTriangleShapeEx.h + Gimpact/gim_tri_collision.h + Gimpact/btGImpactQuantizedBvh.h + Gimpact/gim_box_set.h + NarrowPhaseCollision/btContinuousConvexCollision.h + NarrowPhaseCollision/btContinuousConvexCollision.h + NarrowPhaseCollision/btGjkEpa2.h + NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h + NarrowPhaseCollision/btConvexCast.h + NarrowPhaseCollision/btGjkConvexCast.h + NarrowPhaseCollision/btGjkPairDetector.h + NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h + NarrowPhaseCollision/btPersistentManifold.h + NarrowPhaseCollision/btRaycastCallback.h + NarrowPhaseCollision/btSubSimplexConvexCast.h NarrowPhaseCollision/btVoronoiSimplexSolver.h ) + +#ADD_LIBRARY(LibBulletCollision SHARED ${LibBulletCollision_SRCS} ${LibBulletCollision_HDRS}) +ADD_LIBRARY(LibBulletCollision ${LibBulletCollision_SRCS} ${LibBulletCollision_HDRS}) + +INSTALL(TARGETS LibBulletCollision DESTINATION lib) +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h") diff --git a/src/BulletDynamics/CMakeLists.txt b/src/BulletDynamics/CMakeLists.txt index 58b023e97..3a1c13b63 100644 --- a/src/BulletDynamics/CMakeLists.txt +++ b/src/BulletDynamics/CMakeLists.txt @@ -2,35 +2,43 @@ INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src } ) -ADD_LIBRARY(LibBulletDynamics - +SET(LibBulletDynamics_SRCS ConstraintSolver/btContactConstraint.cpp - ConstraintSolver/btContactConstraint.h ConstraintSolver/btConeTwistConstraint.cpp - ConstraintSolver/btConeTwistConstraint.h ConstraintSolver/btGeneric6DofConstraint.cpp - ConstraintSolver/btGeneric6DofConstraint.h ConstraintSolver/btHingeConstraint.cpp - ConstraintSolver/btHingeConstraint.h ConstraintSolver/btPoint2PointConstraint.cpp - ConstraintSolver/btPoint2PointConstraint.h ConstraintSolver/btSequentialImpulseConstraintSolver.cpp - ConstraintSolver/btSequentialImpulseConstraintSolver.h ConstraintSolver/btSliderConstraint.cpp - ConstraintSolver/btSliderConstraint.h ConstraintSolver/btSolve2LinearConstraint.cpp - ConstraintSolver/btSolve2LinearConstraint.h ConstraintSolver/btTypedConstraint.cpp - ConstraintSolver/btTypedConstraint.h Dynamics/Bullet-C-API.cpp Dynamics/btDiscreteDynamicsWorld.cpp - Dynamics/btDiscreteDynamicsWorld.h Dynamics/btSimpleDynamicsWorld.cpp - Dynamics/btSimpleDynamicsWorld.h Dynamics/btRigidBody.cpp - Dynamics/btRigidBody.h Vehicle/btRaycastVehicle.cpp - Vehicle/btRaycastVehicle.h Vehicle/btWheelInfo.cpp +) + +SET(LibBulletDynamics_HDRS + ConstraintSolver/btContactConstraint.h + ConstraintSolver/btConeTwistConstraint.h + ConstraintSolver/btGeneric6DofConstraint.h + ConstraintSolver/btHingeConstraint.h + ConstraintSolver/btPoint2PointConstraint.h + ConstraintSolver/btSequentialImpulseConstraintSolver.h + ConstraintSolver/btSliderConstraint.h + ConstraintSolver/btSolve2LinearConstraint.h + ConstraintSolver/btTypedConstraint.h + Dynamics/btDiscreteDynamicsWorld.h + Dynamics/btSimpleDynamicsWorld.h + Dynamics/btRigidBody.h + Vehicle/btRaycastVehicle.h Vehicle/btWheelInfo.h ) + +#ADD_LIBRARY(LibBulletDynamics SHARED ${LibBulletDynamics_SRCS} ${LibBulletDynamics_HDRS}) +ADD_LIBRARY(LibBulletDynamics ${LibBulletDynamics_SRCS} ${LibBulletDynamics_HDRS}) + +INSTALL(TARGETS LibBulletDynamics DESTINATION lib) +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h") diff --git a/src/BulletMultiThreaded/SpuRaycastTask/SpuSubSimplexConvexCast.cpp b/src/BulletMultiThreaded/SpuRaycastTask/SpuSubSimplexConvexCast.cpp index 1cd2e983e..dacf7e16a 100644 --- a/src/BulletMultiThreaded/SpuRaycastTask/SpuSubSimplexConvexCast.cpp +++ b/src/BulletMultiThreaded/SpuRaycastTask/SpuSubSimplexConvexCast.cpp @@ -39,8 +39,8 @@ SpuSubsimplexRayCast::SpuSubsimplexRayCast (void* shapeB, SpuConvexPolyhedronVer * MSUM(Pellet, ConvexShape) * */ -void supportPoints (const btTransform xformRay, - const btTransform xformB, +void supportPoints (const btTransform& xformRay, + const btTransform& xformB, const int shapeType, const void* shape, SpuConvexPolyhedronVertexData* convexVertexData, diff --git a/src/BulletSoftBody/CMakeLists.txt b/src/BulletSoftBody/CMakeLists.txt index a725e10ff..e3667ace0 100644 --- a/src/BulletSoftBody/CMakeLists.txt +++ b/src/BulletSoftBody/CMakeLists.txt @@ -3,19 +3,30 @@ INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src } ) -ADD_LIBRARY(LibBulletSoftBody +SET(LibBulletSoftBody_SRCS btSoftBody.cpp - btSoftBody.h btSoftBodyHelpers.cpp - btSparseSDF.h - btSoftBodyHelpers.h btSoftBodyRigidBodyCollisionConfiguration.cpp btSoftRigidCollisionAlgorithm.cpp - btSoftRigidCollisionAlgorithm.h btSoftSoftCollisionAlgorithm.cpp - btSoftSoftCollisionAlgorithm.h btSoftBodyConcaveCollisionAlgorithm.cpp - btSoftBodyConcaveCollisionAlgorithm.h - btSoftRigidDynamicsWorld.h btSoftRigidDynamicsWorld.cpp ) + +SET(LibBulletSoftBody_HDRS + btSoftBody.h + btSparseSDF.h + btSoftBodyHelpers.h + btSoftRigidCollisionAlgorithm.h + btSoftSoftCollisionAlgorithm.h + btSoftBodyConcaveCollisionAlgorithm.h + btSoftRigidDynamicsWorld.h +) + + +#ADD_LIBRARY(LibBulletSoftBody SHARED ${LibBulletSoftBody_SRCS} ${LibBulletSoftBody_HDRS}) +ADD_LIBRARY(LibBulletSoftBody ${LibBulletSoftBody_SRCS} ${LibBulletSoftBody_HDRS}) + +INSTALL(TARGETS LibBulletSoftBody DESTINATION lib) +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h") + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e5c3c1904..698341d8f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,3 +3,5 @@ SUBDIRS( BulletSoftBody BulletCollision BulletDynamics LinearMath ) else (CMAKE_SIZEOF_VOID_P MATCHES "8") SUBDIRS( BulletMultiThreaded BulletSoftBody BulletCollision BulletDynamics LinearMath ) endif (CMAKE_SIZEOF_VOID_P MATCHES "8") + +INSTALL(FILES btBulletCollisionCommon.h btBulletDynamicsCommon.h Bullet-C-Api.h DESTINATION include) \ No newline at end of file diff --git a/src/LinearMath/CMakeLists.txt b/src/LinearMath/CMakeLists.txt index 643436575..a8a2ebb19 100644 --- a/src/LinearMath/CMakeLists.txt +++ b/src/LinearMath/CMakeLists.txt @@ -3,7 +3,14 @@ INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src } ) -ADD_LIBRARY(LibLinearMath +SET(LibLinearMath_SRCS + btConvexHull.cpp + btQuickprof.cpp + btGeometryUtil.cpp + btAlignedAllocator.cpp +) + +SET(LibLinearMath_HDRS btAlignedObjectArray.h btList.h btPoolAllocator.h @@ -16,7 +23,6 @@ ADD_LIBRARY(LibLinearMath btScalar.h btAabbUtil2.h btConvexHull.h - btConvexHull.cpp btMinMax.h btQuaternion.h btStackAlloc.h @@ -27,8 +33,10 @@ ADD_LIBRARY(LibLinearMath btIDebugDraw.h btQuickprof.h btTransformUtil.h - btQuickprof.cpp - btGeometryUtil.cpp - btAlignedAllocator.cpp ) +# ADD_LIBRARY(LibLinearMath SHARED ${LibLinearMath_SRCS} ${LibLinearMath_HDRS}) +ADD_LIBRARY(LibLinearMath ${LibLinearMath_SRCS} ${LibLinearMath_HDRS}) + +INSTALL(TARGETS LibLinearMath DESTINATION lib) +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h") diff --git a/src/LinearMath/btMatrix3x3.h b/src/LinearMath/btMatrix3x3.h index 8e499524e..c5f220b43 100644 --- a/src/LinearMath/btMatrix3x3.h +++ b/src/LinearMath/btMatrix3x3.h @@ -293,18 +293,18 @@ class btMatrix3x3 { euler_out2.yaw = 0; // From difference of angles formula - double delta = btAtan2(m_el[0].x(),m_el[0].z()); + btScalar delta = btAtan2(m_el[0].x(),m_el[0].z()); if (m_el[2].x() > 0) //gimbal locked up { - euler_out.pitch = SIMD_PI / 2.0; - euler_out2.pitch = SIMD_PI / 2.0; + euler_out.pitch = SIMD_PI / btScalar(2.0); + euler_out2.pitch = SIMD_PI / btScalar(2.0); euler_out.roll = euler_out.pitch + delta; euler_out2.roll = euler_out.pitch + delta; } else // gimbal locked down { - euler_out.pitch = -SIMD_PI / 2.0; - euler_out2.pitch = -SIMD_PI / 2.0; + euler_out.pitch = -SIMD_PI / btScalar(2.0); + euler_out2.pitch = -SIMD_PI / btScalar(2.0); euler_out.roll = -euler_out.pitch + delta; euler_out2.roll = -euler_out.pitch + delta; } @@ -314,32 +314,29 @@ class btMatrix3x3 { euler_out.pitch = - btAsin(m_el[2].x()); euler_out2.pitch = SIMD_PI - euler_out.pitch; - euler_out.roll = btAtan2(m_el[2].y()/cos(euler_out.pitch), - m_el[2].z()/cos(euler_out.pitch)); - euler_out2.roll = btAtan2(m_el[2].y()/cos(euler_out2.pitch), - m_el[2].z()/cos(euler_out2.pitch)); + euler_out.roll = btAtan2(m_el[2].y()/btCos(euler_out.pitch), + m_el[2].z()/btCos(euler_out.pitch)); + euler_out2.roll = btAtan2(m_el[2].y()/btCos(euler_out2.pitch), + m_el[2].z()/btCos(euler_out2.pitch)); - euler_out.yaw = btAtan2(m_el[1].x()/cos(euler_out.pitch), - m_el[0].x()/cos(euler_out.pitch)); - euler_out2.yaw = btAtan2(m_el[1].x()/cos(euler_out2.pitch), - m_el[0].x()/cos(euler_out2.pitch)); + euler_out.yaw = btAtan2(m_el[1].x()/btCos(euler_out.pitch), + m_el[0].x()/btCos(euler_out.pitch)); + euler_out2.yaw = btAtan2(m_el[1].x()/btCos(euler_out2.pitch), + m_el[0].x()/btCos(euler_out2.pitch)); } if (solution_number == 1) - { yaw = euler_out.yaw; - pitch = euler_out.pitch; - roll = euler_out.roll; + { + yaw = euler_out.yaw; + pitch = euler_out.pitch; + roll = euler_out.roll; } else - { yaw = euler_out2.yaw; - pitch = euler_out2.pitch; - roll = euler_out2.roll; + { + yaw = euler_out2.yaw; + pitch = euler_out2.pitch; + roll = euler_out2.roll; } - - - - return; - } /**@brief Create a scaled copy of the matrix