Commit Graph

66 Commits

Author SHA1 Message Date
Xuchen Han
a90cad2a96 deformable code refactor 2019-08-02 13:13:21 -07:00
Xuchen Han
35ce2ae0e2 add contact constraint as projections in CG 2019-08-02 13:10:56 -07:00
erwincoumans
ab8f16961e Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files.
make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type.
This commit contains no other changes aside from adding and applying clang-format-all.sh
2018-09-23 14:17:31 -07:00
Erwin Coumans
c0c4c8ba3f fix many warnings
remove btMultiSapBroadphase.*
make collisionFilterGroup/collisionFilterMark int (instead of short int)
2017-01-15 22:26:11 -08:00
Lunkhound
1c3686ca51 MultiThreaded Demo:
- fixing various race conditions throughout (usage of static vars, etc)
 - addition of a few lightweight mutexes (which are compiled out by default)
 - slight code rearrangement in discreteDynamicsWorld to facilitate multithreading
 - PoolAllocator::allocate() can now be called when pool is full without
     crashing (null pointer returned)
 - PoolAllocator allocate and freeMemory, are OPTIONALLY threadsafe
     (default is un-threadsafe)
 - CollisionDispatcher no longer checks if the pool allocator is full
     before calling allocate(), instead it just calls allocate() and
     checks if the return is null -- this avoids a race condition
 - SequentialImpulseConstraintSolver OPTIONALLY uses different logic in
     getOrInitSolverBody() to avoid a race condition with kinematic bodies
 - addition of 2 classes which together allow simulation islands to be run
   in parallel:
    - btSimulationIslandManagerMt
    - btDiscreteDynamicsWorldMt
 - MultiThreadedDemo example in the example browser demonstrating use of
   OpenMP, Microsoft PPL, and Intel TBB
 - use multithreading for other demos
 - benchmark demo: add parallel raycasting
2016-10-30 12:47:27 -07:00
erwincoumans
a159fbac69 Improved URDF support for btMultiBody and separate graphics/collision/inertial frames and shapes
Fix WinXP GetTickCount64 with a typedef
Expose debug drawing mode/flags in UI (hot keys A,D,L,W for now, buttons later)
GLInstancingRenderer: tweak near/far planes to allow closer approach of camera
btDiscreteDynamicsWorld: enable debug drawing for btGeneric6DofSpring2Constraint
btMultiBodyDynamicsWorld: enable basic debug drawing for btMultiBody
btMultibody: allow center-of-mass shift for prismatic and fixed constraint
2015-01-22 17:56:24 -08:00
erwin.coumans@gmail.com
f5320e4106 add "latency motion state interpolation", using previous frame/current, instead of current->next
See Demos/ForkLiftDemo for example (F7 to toggle, use single-frame stepping, press 'i' and 's' to see the effect)
2013-10-24 00:13:43 +00:00
erwin.coumans
f02dd51597 Added a first version of a Featherstone multi body implementation.
The original version was written by Stephen Thompson.
I replaced Eigen math by Bullet LinearMath, and added a dedicated 6x6 matrix solver. 
Also I integrated support for collisions/contact constraints between btMultiBody and btRigidBody, and de-activation support.
See Demos/FeatherstoneMultiBodyDemo/Win32FeatherstoneMultiBodyDemo.cpp for example usage.
There is currently only support for contact constraints for btMultiBody. 
Next on the list will be adding support for joint limit constraint for btMultiBody. 
The implementation is still experimental/untested, the quality will improve in upcoming Bullet releases.
2013-10-01 22:50:31 +00:00
erwin.coumans
eaabf1a2c8 Expose btManifoldResult::calculateCombinedRestitution and btManifoldResult::calculateCombinedFriction as static member functions, so it can be reused for speculative contacts
Add speculative contact restitution, but disabled by default, not well tested (btDiscreteDynamicsWorld::setApplySpeculativeContactRestitution)
Add --with-double-precision option to premake build system
2012-10-05 21:15:11 +00:00
erwin.coumans
6f60a388c6 add missing Demos/BulletXmlImportDemo
serialize DynamicsWorldInfo
2012-09-22 02:06:09 +00:00
erwin.coumans
9612561113 add btDiscreteDynamicsWorld::createPredictiveContacts after discrete collision detection and add temporary contact manifolds, for the constraint solver.
This should improve 'ccd' handling when using world->getDispatchInfo().m_useContinuous = true;body->setCcdSquareMotionThreshold(...); body->setCcdSquareMotionThreshold(...)
shoot smaller boxes (test)
use yellow instead of orange for contact point normals
tweak default erp and erp2 values, now split impulse is on by default (need to check it)
2012-09-11 00:56:11 +00:00
erwin.coumans
73b217fb07 Apple contribution for OSX SSE and iOS NEON optimizations unit tests, thanks to Jordan Hubbard, Ian Ollmann and Hristo Hristov.
For OSX:
cd build
./premake_osx xcode4
for iOS:
cd build
./ios_build.sh
./ios_run.sh

Also integrated the branches/StackAllocation to make it easier to multi-thread collision detection in the near future. It avoids changing the btCollisionObject while performing collision detection.

As this is a large patch, some stuff might be temporarily broken, I'll keep an eye out on issues.
2012-06-07 00:56:30 +00:00
erwin.coumans
606d65d95b Reduce dynamic memory allocation, fixes Issue 573
Thanks to Anton Breusov for the patch
2011-12-12 16:47:41 +00:00
erwin.coumans
642a6821a5 remove speculative contacts, they break restitution and cause other artifacts
use btConvexPolyhedron for debug rendering, if available
fixes in btConvexConvexAlgorithm for polyhedral contact clipping, if GJK separating normal is zero
don't shift vertices in btPolyhedralConvexShape
2011-08-30 03:28:32 +00:00
erwin.coumans
a4e8213ede Implemented btDiscreteDynamicsWorld::addSpeculativeContacts, using conservative advancement to find contact point ahead of time
make Extras/ConvexDecomposition thread safe, Issue 501
some improvements to the btInternalEdgeUtility, patch from Issue 501
2011-04-07 06:23:34 +00:00
erwin.coumans
0f707603f1 more work on serialization, work-in-progress 2010-01-23 00:04:58 +00:00
erwin.coumans
6af9f9434f worked a bit more on the serialization, and added a preliminary SerializeDemo. 2010-01-21 00:17:18 +00:00
erwin.coumans
fcd2b93a22 fix in box-box contact generation: choose better contact point location (along contact normal) when objects are swapped.
move debugDrawWorld to btCollisionWorld.
improved CollisionInterfaceDemo, show how to perform a closest point query for objects that are not in the collision world.
removed a bit of garbage from the debug drawer
2009-12-18 00:54:52 +00:00
erwin.coumans
659b215a69 Override btCollisionWorld::addCollisionObject with flags more appropriate for btDynamicsWorld (StaticFilter)
Minor fixes (#ifndef SPU_COLLISION_OBJECT_WRAPPER_H block etc)
Only update 'setNumTasks' when necessary
Revert vectormath.h include (can't resolve conflicts with PS3 SDK, need additional #include path)
2009-09-09 22:49:43 +00:00
erwin.coumans
c4ad354ac0 More GJK degeneracy fixes, thanks Jacob Langford for the feedback:
http://code.google.com/p/bullet/issues/detail?id=250

Added missing files for Maya Dynamica plugin
Thanks Herbert Law for the patch, and damrit and others for the report
http://code.google.com/p/bullet/issues/detail?id=231

Fix btQuaternion shortestArcQuat, thanks Stan Melax for original fix and shogun for reminder
http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1989

Implemented btDiscreteDynamicsWorld::removeCollisionObject (and btSoftBodyDynamicsWorld) to avoid
crashes. Thanks Jacob Langford for bringing that up.

Minor sphere-debug drawing issue (spheres were drawn inside-out (wrong face winding)
2009-07-13 21:48:19 +00:00
erwin.coumans
6c80353556 Minor fix in friction: calculate second friction direction based on un-scaling first friction direction (issue if it was scaled to zero)
Force activation state of static objects to be ISLAND_SLEEPING, once they are added to the world
Add backwards compatibility option btDiscreteDynamicsWorld::setSynchronizeAllMotionStates, just in case only updating active objects broke someones code
Don't disable 3D box-box in box2ddemo
2009-06-11 12:22:41 +00:00
erwin.coumans
3e5fc86a6c Iterate only over non-static rigid bodies, instead of all collision objects
http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=18&t=3625
http://code.google.com/p/bullet/issues/detail?id=128

Attempt to fix issue in mesh striding, multiple-mesh-parts were broken.
2009-06-11 01:25:10 +00:00
erwin.coumans
33029ad996 updated demos -> ALT + mouse uses Maya-style controls, replaced BMF_Fonts by GLDebugFont
fix debug drawing of btMultiSphereShape
added box2d demo
added experimental gpu 2d demo
2009-05-09 19:27:14 +00:00
erwin.coumans
0905002e3f make sure to be backwards compatible with spubullet 2.73 sp1 (PLAYSTATION 3 version) 2009-03-03 20:30:31 +00:00
erwin.coumans
90f96aec27 Introduced btActionInterface. This makes it easier to extend user-defined actions, such as vehicles and characters.
btRaycastVehicle and btKinematicCharacterController are derived from btActionInterface now.
Some cosmetic cleanup: changed sourceforce/sf.net url to bulletphysics.com.
2009-03-03 16:18:23 +00:00
erwin.coumans
8acadeb711 minor tweaks to demos: enable constraint debug drawing in AllBulletDemos, default constraint debugging size set to 0.3,
set svn:eol-style native for folder files
http://code.google.com/p/bullet/issues/detail?id=191
2009-02-18 22:52:03 +00:00
rponom
e7ca0e6a9c Bug in Generic 6DOF joint fixed
Debug visualization of joint constraints was added
2009-01-16 03:04:07 +00:00
erwin.coumans
f9aa7f3b53 Add Character control to btDiscreteDynamicsWorld (moved btCharacterControllerInterface/btKinematicCharacterController functionality from demo)
Remove ibmsdk from CcdPhysicsDemo and CollisionDemo
2008-11-08 21:01:20 +00:00
erwin.coumans
ce0bdd891d added synchronizeSingleMotionState, thanks Chunky. 2008-11-08 19:34:05 +00:00
erwin.coumans
075ba0b9d9 Enabling USE_SEPDISTANCE_UTIL2 requires 100% reliable distance computation, but there are issues with large size rations. todo: fix this
Make synchronizeMotionStates() pure virtual in btDynamicsWorld and public in btDiscreteDynamicsWorld. Thanks Chunky.
2008-11-08 19:27:53 +00:00
erwin.coumans
86353f0ad8 add btActivationCollisionAlgoritm to fix deactivation problems, reported here:
http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2616

provide access to active objects, requested here:
http://code.google.com/p/bullet/issues/detail?id=128
2008-11-07 03:37:14 +00:00
erwin.coumans
28e580c203 removed STL usage of Extras/ConvexBuilder and replaced by btAlignedObjectArray
fixed several warnings, thanks to sparkprime
added comments patch for linear math, thanks to Tully Foote
2008-10-28 18:52:46 +00:00
erwin.coumans
60fa900995 Added CCD motion camping, to avoid tunneling.
Not as versatile compared to btContinuousDynamicsWorld but still useful.
2008-09-11 18:13:56 +00:00
erwin.coumans
7838a5c980 provide interface for setting the number of tasks (unused in the btDiscreteDynamicsWorld). 2008-08-07 00:02:37 +00:00
erwin.coumans
d49aeb9dff + improved split impulse constraint solver option
+ improved friction warm starting
+ made constraint solver configuration more consistent (moved m_solverMode into btContactSolverInfo)
+ reset timing in CDTestFramework after initialization (SAP init destorts timings)
+ make it easier to change default sizes for stack allocator in btDefaultCollisionConfiguration
2008-05-29 03:33:32 +00:00
johnmccutchan
8fff5c54e9 Added name fields to Collision Object and Shape.
Added name field to Typed Constraint.
Added accessor for gravity in dynamics world.
2008-01-30 01:52:07 +00:00
ejcoumans
17a214a2b3 - Added btRigidBodyConstructionInfo, to make it easier to set individual setting (and leave other untouched) during rigid body construction.
This was harder using default arguments. Thanks Vangelis Kokkevis for pointing this out.
- Fixed memoryleak in the ConstraintDemo and Raytracer demo.
- fixed issue with clearing forces/gravity at the end of the stepSimulation, instead of during internalSingleStepSimulation.
Thanks chunky for pointing this out: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1780
- Disabled additional damping in rigid body by default, but enable it in most demos. Set btRigidBodyConstructionInfo m_additionalDamping to true to enable this.
- Removed obsolete QUICKPROF BEGIN/END_PROFILE, and enabled BT_PROFILE. Profiling is enabled by default (see Bullet/Demos/OpenGL/DemoApplication.cpp how to use this).
User can switch off profiling by enabling define BT_NO_PROFILE in Bullet/src/btQuickprof.h.
2007-12-17 04:26:36 +00:00
ejcoumans
947dc8d33d Moved the 'btRigidBody::clearForce' to the end of the stepSimulation, instead of in each substep.
Should help with this issue, reported here: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1601
We can optionally leave out the 'clearForces'.
Thanks everyone for the discussion.
2007-12-12 02:53:51 +00:00
ejcoumans
a45912e39c move updateAabbs from dynamics world to collision world 2007-12-10 02:59:04 +00:00
ejcoumans
71fb40b775 some demo cleanup, part 0 2007-12-06 23:58:50 +00:00
ejcoumans
cab75b53ec added hierarchical profiling (needs more cleanup)
avoid dynamic allocations in btRaycastVehicle
2007-11-21 03:00:40 +00:00
ejcoumans
fd1e672fcb updated demos to show debug display with new AllBulletDemos (AllInOne),
added btDynamicsWorld::getWorldType
2007-10-25 07:07:12 +00:00
ejcoumans
e7caaa28d3 re-organized memory (stack and pool) allocators. this lets the user pass in their own memory allocators. 2007-10-20 02:23:39 +00:00
ejcoumans
1f7646f72a Refactoring to enable multi SAP broadphase.
This was already planned, and Pierre Terdiman recent thread motivated me to decouple the paircache from the sweep and prune.
http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329
2007-08-02 23:48:46 +00:00
ejcoumans
0df4cedc3e added 'getConstraintSolver' and ability to 'reset' (set randseeds back to zero, and clear internal caches) 2007-07-27 23:54:22 +00:00
ejcoumans
685138d033 include paths should not be relative starting with "../
It leads to problems with certain compilers, when Bullet/src is located in a long pathname.
Keep include path starting with "LinearMath/, "BulletCollision/, or "BulletDynamics/
2007-07-14 05:08:57 +00:00
ejcoumans
e33f5390dd added patch from Marten Svanfeld to pass collision filter group/mask in addRigidbody. 2007-06-29 19:37:30 +00:00
ejcoumans
ced94d63bf Thanks to Mårten Svanfeldt for the contribution:
- optionally disable collisions between bodies that are linked with constraints
- improved debug rendering with support for compounds, spheres, capsules
2007-06-28 19:14:30 +00:00
ejcoumans
054d672592 - removed STL from the Bullet library: replace std::vector by btAlignedObjectArray. Also removed the std::set for overlapping pair set, and turned it into an overlapping pair array. The SAP only adds objects, never removed. Removal is postponed for during traversal of overlapping pairs (duplicates and non-overlapping pairs are removed during that traversal).
- added heap sort and binary search/linear search to btAlignedObjectArray
- fixed wrong cast, thanks Hamstray, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1015
2007-03-06 09:59:17 +00:00
sjbaker
e9b21e21a6 Pathnames between #include files that are intended to be used within application code should not depend on the paths to the subdirectories being known to the compiler because this will not always be the case when an end-user includes your headers.
Includes of files in the local hierarchy must not use <...> please stick with "..."
2006-12-26 15:33:28 +00:00