diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 43b9fdc23b..f4112a54e1 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -290,10 +290,10 @@ package_option(GTK2) # Bullet find_package(Bullet QUIET) -package_option(Bullet +package_option(BULLET "Enable this option to support game dynamics with the Bullet physics library.") -config_package(Bullet "Bullet physics") +config_package(BULLET "Bullet physics") # ODE find_package(ODE QUIET) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 851461e64f..4d256c18df 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -68,6 +68,8 @@ add_subdirectory(src/testbed) # physics add_subdirectory(src/physics) add_subdirectory(src/particlesystem) +# bullet +add_subdirectory(src/bullet) # ode add_subdirectory(src/ode) @@ -96,6 +98,10 @@ endif() if(HAVE_PYTHON) add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) + if(HAVE_BULLET) + add_python_module(bullet p3bullet IMPORT panda3d.core) + endif() + if(HAVE_EGG) add_python_module(egg p3egg p3egg2pg LINK pandaegg IMPORT panda3d.core) endif() diff --git a/panda/src/bullet/CMakeLists.txt b/panda/src/bullet/CMakeLists.txt new file mode 100644 index 0000000000..c2c4cd6b6d --- /dev/null +++ b/panda/src/bullet/CMakeLists.txt @@ -0,0 +1,117 @@ +if(NOT HAVE_BULLET) + return() +endif() + +set(P3BULLET_HEADERS + config_bullet.h + bullet_includes.h + bullet_utils.I bullet_utils.h + bulletAllHitsRayResult.I bulletAllHitsRayResult.h + bulletBaseCharacterControllerNode.I bulletBaseCharacterControllerNode.h + bulletBodyNode.I bulletBodyNode.h + bulletBoxShape.I bulletBoxShape.h + bulletCapsuleShape.I bulletCapsuleShape.h + bulletCharacterControllerNode.I bulletCharacterControllerNode.h + bulletClosestHitRayResult.I bulletClosestHitRayResult.h + bulletClosestHitSweepResult.I bulletClosestHitSweepResult.h + bulletConeShape.I bulletConeShape.h + bulletConeTwistConstraint.I bulletConeTwistConstraint.h + bulletConstraint.I bulletConstraint.h + bulletContactCallbackData.I bulletContactCallbackData.h + bulletContactCallbacks.h + bulletContactResult.I bulletContactResult.h + bulletConvexHullShape.I bulletConvexHullShape.h + bulletConvexPointCloudShape.I bulletConvexPointCloudShape.h + bulletCylinderShape.I bulletCylinderShape.h + bulletDebugNode.I bulletDebugNode.h + bulletFilterCallbackData.I bulletFilterCallbackData.h + bulletGenericConstraint.I bulletGenericConstraint.h + bulletGhostNode.I bulletGhostNode.h + bulletHeightfieldShape.I bulletHeightfieldShape.h + bulletHelper.I bulletHelper.h + bulletHingeConstraint.I bulletHingeConstraint.h + bulletManifoldPoint.I bulletManifoldPoint.h + bulletMinkowskiSumShape.I bulletMinkowskiSumShape.h + bulletMultiSphereShape.I bulletMultiSphereShape.h + bulletPersistentManifold.I bulletPersistentManifold.h + bulletPlaneShape.I bulletPlaneShape.h + bulletRigidBodyNode.I bulletRigidBodyNode.h + bulletRotationalLimitMotor.I bulletRotationalLimitMotor.h + bulletShape.I bulletShape.h + bulletSliderConstraint.I bulletSliderConstraint.h + bulletSoftBodyConfig.I bulletSoftBodyConfig.h + bulletSoftBodyControl.I bulletSoftBodyControl.h + bulletSoftBodyMaterial.I bulletSoftBodyMaterial.h + bulletSoftBodyNode.I bulletSoftBodyNode.h + bulletSoftBodyShape.I bulletSoftBodyShape.h + bulletSoftBodyWorldInfo.I bulletSoftBodyWorldInfo.h + bulletSphereShape.I bulletSphereShape.h + bulletSphericalConstraint.I bulletSphericalConstraint.h + bulletTickCallbackData.I bulletTickCallbackData.h + bulletTranslationalLimitMotor.I bulletTranslationalLimitMotor.h + bulletTriangleMesh.I bulletTriangleMesh.h + bulletTriangleMeshShape.I bulletTriangleMeshShape.h + bulletVehicle.I bulletVehicle.h + bulletWheel.I bulletWheel.h + bulletWorld.I bulletWorld.h) + +set(P3BULLET_SOURCES + config_bullet.cxx + bullet_utils.cxx + bulletAllHitsRayResult.cxx + bulletBaseCharacterControllerNode.cxx + bulletBodyNode.cxx + bulletBoxShape.cxx + bulletCapsuleShape.cxx + bulletCharacterControllerNode.cxx + bulletClosestHitRayResult.cxx + bulletClosestHitSweepResult.cxx + bulletConeShape.cxx + bulletConeTwistConstraint.cxx + bulletConstraint.cxx + bulletContactCallbackData.cxx + bulletContactResult.cxx + bulletConvexHullShape.cxx + bulletConvexPointCloudShape.cxx + bulletCylinderShape.cxx + bulletDebugNode.cxx + bulletFilterCallbackData.cxx + bulletGenericConstraint.cxx + bulletGhostNode.cxx + bulletHeightfieldShape.cxx + bulletHelper.cxx + bulletHingeConstraint.cxx + bulletManifoldPoint.cxx + bulletMinkowskiSumShape.cxx + bulletMultiSphereShape.cxx + bulletPersistentManifold.cxx + bulletPlaneShape.cxx + bulletRigidBodyNode.cxx + bulletRotationalLimitMotor.cxx + bulletShape.cxx + bulletSliderConstraint.cxx + bulletSoftBodyConfig.cxx + bulletSoftBodyControl.cxx + bulletSoftBodyMaterial.cxx + bulletSoftBodyNode.cxx + bulletSoftBodyShape.cxx + bulletSoftBodyWorldInfo.cxx + bulletSphereShape.cxx + bulletSphericalConstraint.cxx + bulletTickCallbackData.cxx + bulletTranslationalLimitMotor.cxx + bulletTriangleMesh.cxx + bulletTriangleMeshShape.cxx + bulletVehicle.cxx + bulletWheel.cxx + bulletWorld.cxx) + +composite_sources(p3bullet P3BULLET_SOURCES) +add_library(p3bullet ${P3BULLET_SOURCES} ${P3BULLET_HEADERS}) +set_target_properties(p3bullet PROPERTIES DEFINE_SYMBOL BUILDING_PANDABULLET) +target_link_libraries(p3bullet panda) +target_use_packages(p3bullet BULLET) +target_interrogate(p3bullet ALL) + +install(TARGETS p3bullet DESTINATION lib RUNTIME DESTINATION bin) +install(FILES ${P3BULLET_HEADERS} DESTINATION include/panda3d)