-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bullet physics engine implementation #10013
Closed
Closed
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
ff3352c
Bullet physics engine implementation
AndreaCatania aba1c04
Fixed GridMap performance problem
AndreaCatania cb7f5ce
Fixed scaling
AndreaCatania 076676f
Fixed Area to Area signal emission
AndreaCatania d9273e0
Supported not-uniform body scale
AndreaCatania db5d34d
Prepared softbody wrapper
AndreaCatania 734f96e
Fixed travis error
AndreaCatania d64121c
Implemented better support for softbody
AndreaCatania 340cc45
Improved performance for Kinematic Body, Improved performance during …
AndreaCatania e321adf
Implemented forgotten API (not yet tested)
AndreaCatania 365fef0
Tested function rest_info
AndreaCatania f84f3d9
Tested function collide_shape
AndreaCatania 5d94066
Removed reminders because got implemented
AndreaCatania 574ce05
rebased
AndreaCatania 5561d2e
Fixed swapping mode bug. Removed not used functions.
AndreaCatania 12fd869
Fixed character rotation with fast floating point
AndreaCatania 62e7fbd
Improved mass managing
AndreaCatania f81421e
Added new Physics server API
AndreaCatania 92c20ba
Improved change mode
AndreaCatania 1c045ae
Fixed a bug that set angular factor 0 when you set the mass
AndreaCatania 938dd0e
Fixed changing mode and can sleep handling
AndreaCatania 4ce3e8f
Implemented area GTK check. Fixed area overlapping performance problem.
AndreaCatania 57407d6
Improved stepper and flush query
AndreaCatania 937c31d
Removed setStepper
AndreaCatania 35ea097
Renamed FI callback
AndreaCatania d19908e
Fixed lock axis
AndreaCatania 3479786
Optimization
AndreaCatania 7a18f1b
issues 12267
AndreaCatania 0c2b8b8
Fixed 12289
AndreaCatania 9821256
Fixed contact body local location
AndreaCatania 907459b
Updated Bullet version
AndreaCatania b56710b
Bouncing works like Godot
AndreaCatania 8fb0235
RayShape fix in progress
AndreaCatania d0b4a3d
RayShape fix in progress
AndreaCatania dcaf880
Fixed contact point report
AndreaCatania 16d4ebf
RayShape fix in progress
AndreaCatania fd6bae9
Fixed Ray shape
AndreaCatania a91a47f
Implemented bullet plug. Set Bullet as default physics engine
AndreaCatania 6ee7101
Fixed stepping
AndreaCatania File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
#!/usr/bin/env python | ||
|
||
Import('env') | ||
|
||
# build only version 2 | ||
# Bullet 2.87 | ||
bullet_src__2_x = [ | ||
# BulletCollision | ||
"BulletCollision/BroadphaseCollision/btAxisSweep3.cpp" | ||
, "BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp" | ||
, "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp" | ||
, "BulletCollision/BroadphaseCollision/btDbvt.cpp" | ||
, "BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp" | ||
, "BulletCollision/BroadphaseCollision/btDispatcher.cpp" | ||
, "BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp" | ||
, "BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp" | ||
, "BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp" | ||
, "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp" | ||
, "BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp" | ||
, "BulletCollision/CollisionDispatch/btCollisionDispatcherMt.cpp" | ||
, "BulletCollision/CollisionDispatch/btCollisionObject.cpp" | ||
, "BulletCollision/CollisionDispatch/btCollisionWorld.cpp" | ||
, "BulletCollision/CollisionDispatch/btCollisionWorldImporter.cpp" | ||
, "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp" | ||
, "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btGhostObject.cpp" | ||
, "BulletCollision/CollisionDispatch/btHashedSimplePairCache.cpp" | ||
, "BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp" | ||
, "BulletCollision/CollisionDispatch/btManifoldResult.cpp" | ||
, "BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp" | ||
, "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp" | ||
, "BulletCollision/CollisionDispatch/btUnionFind.cpp" | ||
, "BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp" | ||
, "BulletCollision/CollisionShapes/btBoxShape.cpp" | ||
, "BulletCollision/CollisionShapes/btBox2dShape.cpp" | ||
, "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp" | ||
, "BulletCollision/CollisionShapes/btCapsuleShape.cpp" | ||
, "BulletCollision/CollisionShapes/btCollisionShape.cpp" | ||
, "BulletCollision/CollisionShapes/btCompoundShape.cpp" | ||
, "BulletCollision/CollisionShapes/btConcaveShape.cpp" | ||
, "BulletCollision/CollisionShapes/btConeShape.cpp" | ||
, "BulletCollision/CollisionShapes/btConvexHullShape.cpp" | ||
, "BulletCollision/CollisionShapes/btConvexInternalShape.cpp" | ||
, "BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp" | ||
, "BulletCollision/CollisionShapes/btConvexPolyhedron.cpp" | ||
, "BulletCollision/CollisionShapes/btConvexShape.cpp" | ||
, "BulletCollision/CollisionShapes/btConvex2dShape.cpp" | ||
, "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp" | ||
, "BulletCollision/CollisionShapes/btCylinderShape.cpp" | ||
, "BulletCollision/CollisionShapes/btEmptyShape.cpp" | ||
, "BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp" | ||
, "BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp" | ||
, "BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp" | ||
, "BulletCollision/CollisionShapes/btMultiSphereShape.cpp" | ||
, "BulletCollision/CollisionShapes/btOptimizedBvh.cpp" | ||
, "BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp" | ||
, "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp" | ||
, "BulletCollision/CollisionShapes/btShapeHull.cpp" | ||
, "BulletCollision/CollisionShapes/btSphereShape.cpp" | ||
, "BulletCollision/CollisionShapes/btStaticPlaneShape.cpp" | ||
, "BulletCollision/CollisionShapes/btStridingMeshInterface.cpp" | ||
, "BulletCollision/CollisionShapes/btTetrahedronShape.cpp" | ||
, "BulletCollision/CollisionShapes/btTriangleBuffer.cpp" | ||
, "BulletCollision/CollisionShapes/btTriangleCallback.cpp" | ||
, "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp" | ||
, "BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp" | ||
, "BulletCollision/CollisionShapes/btTriangleMesh.cpp" | ||
, "BulletCollision/CollisionShapes/btTriangleMeshShape.cpp" | ||
, "BulletCollision/CollisionShapes/btUniformScalingShape.cpp" | ||
, "BulletCollision/Gimpact/btContactProcessing.cpp" | ||
, "BulletCollision/Gimpact/btGenericPoolAllocator.cpp" | ||
, "BulletCollision/Gimpact/btGImpactBvh.cpp" | ||
, "BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp" | ||
, "BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp" | ||
, "BulletCollision/Gimpact/btGImpactShape.cpp" | ||
, "BulletCollision/Gimpact/btTriangleShapeEx.cpp" | ||
, "BulletCollision/Gimpact/gim_box_set.cpp" | ||
, "BulletCollision/Gimpact/gim_contact.cpp" | ||
, "BulletCollision/Gimpact/gim_memory.cpp" | ||
, "BulletCollision/Gimpact/gim_tri_collision.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btConvexCast.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp" | ||
, "BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp" | ||
|
||
# BulletDynamics | ||
, "BulletDynamics/Character/btKinematicCharacterController.cpp" | ||
, "BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btContactConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btFixedConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btGearConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btHingeConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp" | ||
, "BulletDynamics/ConstraintSolver/btNNCGConstraintSolver.cpp" | ||
, "BulletDynamics/ConstraintSolver/btSliderConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btTypedConstraint.cpp" | ||
, "BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp" | ||
, "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp" | ||
, "BulletDynamics/Dynamics/btDiscreteDynamicsWorldMt.cpp" | ||
, "BulletDynamics/Dynamics/btSimulationIslandManagerMt.cpp" | ||
, "BulletDynamics/Dynamics/btRigidBody.cpp" | ||
, "BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp" | ||
#, "BulletDynamics/Dynamics/Bullet-C-API.cpp" | ||
, "BulletDynamics/Vehicle/btRaycastVehicle.cpp" | ||
, "BulletDynamics/Vehicle/btWheelInfo.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBody.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBodyJointLimitConstraint.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBodyConstraint.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBodyPoint2Point.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBodyFixedConstraint.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBodySliderConstraint.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBodyJointMotor.cpp" | ||
, "BulletDynamics/Featherstone/btMultiBodyGearConstraint.cpp" | ||
, "BulletDynamics/MLCPSolvers/btDantzigLCP.cpp" | ||
, "BulletDynamics/MLCPSolvers/btMLCPSolver.cpp" | ||
, "BulletDynamics/MLCPSolvers/btLemkeAlgorithm.cpp" | ||
|
||
# BulletInverseDynamics | ||
, "BulletInverseDynamics/IDMath.cpp" | ||
, "BulletInverseDynamics/MultiBodyTree.cpp" | ||
, "BulletInverseDynamics/details/MultiBodyTreeInitCache.cpp" | ||
, "BulletInverseDynamics/details/MultiBodyTreeImpl.cpp" | ||
|
||
# BulletSoftBody | ||
, "BulletSoftBody/btSoftBody.cpp" | ||
, "BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp" | ||
, "BulletSoftBody/btSoftBodyHelpers.cpp" | ||
, "BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.cpp" | ||
, "BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp" | ||
, "BulletSoftBody/btSoftRigidDynamicsWorld.cpp" | ||
, "BulletSoftBody/btSoftMultiBodyDynamicsWorld.cpp" | ||
, "BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp" | ||
, "BulletSoftBody/btDefaultSoftBodySolver.cpp" | ||
|
||
# clew | ||
, "clew/clew.c" | ||
|
||
# LinearMath | ||
, "LinearMath/btAlignedAllocator.cpp" | ||
, "LinearMath/btConvexHull.cpp" | ||
, "LinearMath/btConvexHullComputer.cpp" | ||
, "LinearMath/btGeometryUtil.cpp" | ||
, "LinearMath/btPolarDecomposition.cpp" | ||
, "LinearMath/btQuickprof.cpp" | ||
, "LinearMath/btSerializer.cpp" | ||
, "LinearMath/btSerializer64.cpp" | ||
, "LinearMath/btThreads.cpp" | ||
, "LinearMath/btVector3.cpp" | ||
] | ||
|
||
thirdparty_dir = "#thirdparty/Bullet/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All thirdparty directories in Just do:
|
||
thirdparty_src = thirdparty_dir + "src/" | ||
|
||
bullet_sources = [thirdparty_src + file for file in bullet_src__2_x] | ||
|
||
# include headers | ||
env.Append(CPPPATH=[thirdparty_src]) | ||
|
||
env.add_source_files(env.modules_sources, bullet_sources) | ||
|
||
# Godot source files | ||
env.add_source_files(env.modules_sources, "*.cpp") | ||
|
||
Export('env') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python | ||
|
||
Import('env') | ||
|
||
thirdparty_dir = "#thirdparty/Bullet/" | ||
thirdparty_lib = thirdparty_dir + "Win64/lib/" | ||
|
||
bullet_libs = [ | ||
"Bullet2FileLoader", | ||
"Bullet3Collision", | ||
"Bullet3Common", | ||
"Bullet3Dynamics", | ||
"Bullet3Geometry", | ||
"Bullet3OpenCL_clew", | ||
"BulletCollision", | ||
"BulletDynamics", | ||
"BulletInverseDynamics", | ||
"BulletSoftBody", | ||
"LinearMath" | ||
] | ||
|
||
thirdparty_src = thirdparty_dir + "src/" | ||
# include headers | ||
env.Append(CPPPATH=[thirdparty_src]) | ||
|
||
# lib | ||
env.Append(LIBPATH=[thirdparty_dir + "/Win64/lib/"]) | ||
|
||
bullet_libs = [file+'.lib' for file in bullet_libs] | ||
# LIBS doesn't work in windows | ||
env.Append(LINKFLAGS=bullet_libs) | ||
|
||
env.add_source_files(env.modules_sources, "*.cpp") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a matter of style, but I think it's best to be consistent with other moduels and put the comma after the string, not before.