Commit Graph

75 Commits

Author SHA1 Message Date
Erwin Coumans
0326fa93a8 made some progress in saving and restoring the state during the simulation, with identical results.
Option to de/serialize btPersistentContactManifolds and fix lossy conversion during btMultiBody de/serialization of base world transform
(serialize the quaternion, not the converted 3x3 matrix)
There are still several caches not taken into account, and btMultiBody links/constraints are not deserialized yet etc.
See examples\pybullet\examples\saveRestoreState.py for an example.
2017-12-30 14:19:13 -08:00
Erwin Coumans
af6bf8ddc8 plumb URDF/SDF audio_source into PhysicsServerCommandProcessor, allow to play sounds on collision !
See also https://youtu.be/eppOjTfx5Jg for a first test, and this modified URDF how to add sounds:
https://github.com/bulletphysics/bullet3/blob/master/data/plane_with_collision_audio.urdf
Add the --audio flag to enable sound in pybullet/Bullet-C-API
2017-05-01 11:14:09 -07:00
Erwin Coumans
0b017b0f53 fix issue with btMultiBody friction in combination with soft contacts (friction should not re-use normal contact cfm/erp)
implement friction anchors, position friction correction, disabled by default. Use colObj->setCollisionFlag(flag | CF_HAS_FRICTION_ANCHOR); See test/RobotClientAPI/SlopeFrictionMain.cpp. In URDF or SDF, add <friction_anchor/> in <contact> section of <link> to enable.
PhysicsServer: properly restore old activation state after releasing picked object
btMultiBodyConstraintSolver: disable flip/flop of contact/friction constraint solving by default (it breaks some internal flaky unit tests)
2017-03-20 10:58:07 -07:00
erwincoumans
0d5dcb3cc5 setDebugObjectColor 2016-11-21 07:42:11 -08:00
Lunkhound
2f4ec4f8c9 collisionObject: renamed uniqueId to worldArrayIndex; removed linear search in removeCollisionObject 2016-11-12 12:41:55 -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
Erwin Coumans
1d88cf71e4 separate spinning friction (torsional friction around contact normal) from
rolling friction (orthogonal to contact normal)
2016-09-16 00:04:33 +01:00
Erwin Coumans
ecd814c9c5 export contact friction/damping through URDF and API
convert from contact friction/damping to cfm/erp
btCollisionObject::setContactFrictionAndDamping
2016-09-02 16:40:56 -07:00
erwincoumans
85fd7f560c add first draft of contact point query in shared memory API
b3SharedMemoryCommandHandle b3InitRequestContactPointInformation(b3PhysicsClientHandle physClient);
void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA);
void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB);
void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointData);
Implemented for PhysicsClientSharedMemory, not for PhysicsDirect yet.
Add btCollisionObject::setUserIndex2
2016-09-01 13:30:07 -07:00
Erwin Coumans
7b28e86c7b add improved btGeneric6DofSpring2Constraint, thanks to Puhr Gabor and Tamas Umenhoffer!
improved the new demo testbed (work-in-progress)
add basic Lua demo, import URDF test, STL import, obj import
2014-08-20 16:28:16 -07:00
Erwin Coumans
7151865c16 Introduce kF_UseGjkConvexCastRaytest, and make kF_UseSubSimplexConvexCastRaytest the default for btCollisionWorld::rayTest See https://github.com/bulletphysics/bullet3/issues/34
Add btCollisionObject::setIgnoreCollisionCheck to disable collisions between specific instances, without having a btTypedConstraint. See https://github.com/bulletphysics/bullet3/issues/165

Make btMultiBody and btMultiBodyJointMotor backwards compatible with Bullet 2.82 API (single-DOF API)
2014-05-01 13:51:56 -07: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@gmail.com
4ed87140fc add an update revision, to make it easier to sync with Bullet 3.x
add set/getUserindex in addition to set/getUserPointer
2013-06-19 01:00:42 +00:00
erwin.coumans
f2c9cdfb11 add m_rollingFriction to serialization structures
add btContactSolverInfo and gravity to serialization structures
(actual serialization code will follow soon)
2012-09-21 23:37:24 +00:00
erwin.coumans
22fb7d5c1e improve rolling friction using anisotropic direction, to avoid resting in an instable position
(for implicit capsule, cylinder and cone shape)
See Bullet/Demos/RollingFrictionDemo for an example
2012-09-16 17:01:25 +00:00
erwin.coumans
7eebb79ced implemented rolling friction, using a contact constraint. Useful to get rolling spheres to rest, even on a slightly sloped plane.
See http://www.youtube.com/watch?v=RV7sBAsKu4M and Bullet/Demos/RollingFrictionDemo
Fixes in FractureDemo (mouse picking constraint needs to be removed, otherwise constraint solver crashes/asserts)
2012-09-15 06:52:17 +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
852fa3ba30 add the BT_ prefix for all #ifdef guards, to avoid conflicts with developers own header defines.
Fixes Issue 497

//license header
#ifndef BT_RIGIDBODY_H
#define BT_RIGIDBODY_H
class btRigidBody
{
};
#endif //BT_RIGIDBODY_H
2011-04-01 17:14:52 +00:00
erwin.coumans
844a54a409 Fix broken CDTestFramework
Avoid crash in BulletWorldImporter, ignoring 'invalid' constraints between two static bodies
Use a bitfield for btCollisionObject::CollisionObjectTypes (to allow custom types that are derived from build-in types such as btRigidBody)
Revert/improve softbody debug rendering
2010-08-15 20:45:55 +00:00
erwin.coumans
1c218bffed Add an 'extension' pointer to btCollisionObject for some of our Bullet extentions (a custom constraint solver that needs a back-pointer) 2010-04-13 21:43:34 +00:00
erwin.coumans
40dc18f604 remove Extras/obsolete/quickstep
improve serialization based on feedback: make it easier to serialize a single object, or single shape, or single bvh.
Modified Bullet/Demos/ConcaveDemo to use btSerializer to serialize the btOptimizedBvh (or optionally the trimesh+bvh)

You can also serialize trimesh without BVH, use:
serializer->setSerializationFlags(BT_SERIALIZE_NO_BVH);//	or BT_SERIALIZE_NO_TRIANGLEINFOMAP
2010-02-25 20:12:40 +00:00
erwin.coumans
45e7c7f564 Add missing files to XCode project
Add option to disable SPU collision processing, and add assert to detect unsupported recursive compounds on SPU.
2010-02-17 02:34:26 +00:00
erwin.coumans
58c5630d7f Add new demos to cmake: SerializeDemo and InternalEdgeDemo
Fix in btShapeHull for previous commit
Add support to serialize name for objects
Updated serialization structures.
2010-02-04 01:07:07 +00:00
erwin.coumans
725411a1f3 added a warning to all serialization structures:
///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
2010-01-27 02:41:38 +00:00
erwin.coumans
e7ff71d99b add support for double precision and 64bit serialization (and compatibility between all versions)
fix some issue in serialization of nested array data
add some tesing files
2010-01-25 19:42:51 +00:00
erwin.coumans
099c36a71e Add a new flag btCollisionObject::CF_DISABLE_VISUALIZE_OBJECT to give control over what objects are drawn using the debug drawer
This solves Issue 238 , thanks to  Linzner for the suggestion
Remove some warnings from GL_DialogDynamicsWorld.
2010-01-20 19:38:04 +00:00
erwin.coumans
3edd806b88 Binary serialization in the .bullet file format (work-in-progress) 2009-12-08 18:02:37 +00:00
erwin.coumans
0c097bd45a Added keyboardUpCallback,
Thanks to Erik Weitnauer
http://code.google.com/p/bullet/issues/detail?id=215#c1

Fixed ccdMotionThreshold (wrongly squared input value)
Thanks to Mark Carlson for the report/fix.
http://code.google.com/p/bullet/issues/detail?id=216#c1
2009-05-23 02:48:16 +00:00
erwin.coumans
459c22e7cb Synchronized changes of Bullet, from Blender.
Added optional flag btSoftBody::appendAnchor(	int node,btRigidBody* body, bool disableCollisionBetweenLinkedBodies=false), to disable collision between soft body and rigid body, when pinned
Added btCollisionObject::setAnisotropicFriction, to scale friction in x,y,z direction.
Added btCollisionObject::setContactProcessingThreshold(float threshold), to avoid collision resolution of contact above a certain distance.
Avoid collisions between static objects (causes the CharacterDemo to assert, when a dynamic object hits character)
2009-03-03 06:47:52 +00:00
john.mccutchan
a8ec916af0 Added Height Field Fluid Demo to Bullet. All code stored in the Demos/HeightFieldFluidDemo directory for now.
Please see HfFluidDemo.cpp for examples of how to use the height field fluid along with buoyant collision shapes.

The implementation is still lacking in my ways:
1) Need to complete more collision algorithms for buoyant collision shapes
2) Support compound buoyant shapes
3) The buoyancy model isn't that great
4) Fluid volume can be lost over time
2009-01-08 22:53:23 +00:00
erwin.coumans
cef40e5cce no 'const int' but inline for a few methods
remove redundant/unreachable 'breaks'
2008-11-08 05:27:26 +00:00
erwin.coumans
345da029b9 minor issues, don't inline a out-of-line method, reorder members 2008-11-07 04:02:32 +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
d25d264e77 Improved CharacterDemo/KinematicCharacterController, dynamic objects will bounce off.
Don't create a todo list for doxygen by default (the chaotic todo's would confuse most developers)
Improve support for small objects, by having dynamic contact breaking thresholds. Still needs small internal timestep and some GJK improvements.
2008-11-05 03:28:10 +00:00
erwin.coumans
4cbb3f2e7b Added btGhostObject and btPairCachingGhostObject functionality.
It is a fast way to keep track of overlapping objects in an area, and doing rayTest and convexSweepTest for overlapping objects, instead of btCollisionWorld::rayTest/convexSweepTest.

Updated KinematicCharacterController to use btPairCachingGhostObject.
2008-10-18 01:33:23 +00:00
erwin.coumans
b48d05d52a Preliminary adding btGhostObject.
It can be useful for collision sensors, explosion objects, character controller etc.

Similar to Havok phantom object.
2008-10-16 22:29:38 +00:00
erwin.coumans
9ad17dda22 Add aabbMin/aabbMax to broadphase proxy, and improve rayTest performance.
Todo: use broadphase acceleration structure (btDbvtBroadphase etc) for ray test
2008-10-10 17:32:52 +00:00
erwin.coumans
d2f7f9d25b make soft bodies more compatible with rigid body API: disable setCollisionShape (it would delete the shape passed in!) 2008-09-21 15:19:54 +00:00
erwin.coumans
bf5eafb759 make sure Bullet and Blender/extern/bullet2 is in sync 2008-09-17 20:01:01 +00:00
erwin.coumans
fae48b5c25 some more improvements to support basic CCD motion clamping 2008-09-11 23:50:50 +00:00
erwin.coumans
1c0fa00bc7 + provide access to 'root' collision shape, in case the original collision shape is temporarily replaced by a child collision shape.
+ added MultiMaterialDemo showing how to use the new btTriangleIndexVertexMaterialArray.
Thanks to Alex Silverman for this contribution!
2008-07-10 22:19:30 +00:00
erwin.coumans
bd97c5e569 Fixed warnings in Bullet/src core library
Thanks Martijn Reuvers from Two Tribes B.V. (www.twotribes.com) for the patch

To make this work more visible, suppress warnings in external libraries in Extras (COLLADA_DOM, libxml and glui contain many warnings)
Added PreprocessorDefinitions: _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE to vcproj files
2008-05-10 18:00:21 +00:00
erwin.coumans
1139c06a4d more soft body preparations, moved some parts from Demo/SoftBody to src/BulletDynamics/SoftBody
moved Extras/ConvexHull/btConvexHull.* to src/LinearMath/btConvexHull.*
removed btCollisionObject::m_internalOwner, replaced it by m_internalType. This should not affect external API (it was clearly marked as internal)
2008-04-10 20:00:41 +00:00
erwin.coumans
fe5386a5c8 Made the move from sourceforge to googlecode (no svn sync any longer)
Fixed BulletColladaConverter load/save
Removed btTypedUserInfo
Added btHashMap
Fixed btCapsuleShape
2008-03-13 05:16:42 +00:00
johnmccutchan
d368ef3d71 Remove name field and replace it with btTypedUserInfo field 2008-02-05 18:55:05 +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
eff4fe8ec8 more work on hashed pairmanager. growing doesn't work yet, so need to allocate enough room for the overlapping pairs in advance.
boxbox reports contact point in B, rather then average point
box, cylinder use halfextents corrected for scaling and margin. made the margin in this halfextents explicit in the 'getHalfExtentsWithMargin' and 'getHalfExtentsWithoutMargin'
integrated changed for ODE quickstep solver
replaced inline with SIMD_FORCE_INLINE
some minor optimizations in the btSequentialImpulseConstraintSolver

added cone drawing (for X,Y,Z cones)
2007-10-12 02:52:28 +00:00
ejcoumans
a38de566c6 make sure aligned structures/classes use the btAlignedAlloc/btAlignedFree, by overriding the operator new/delete for that struct/class.
integrated some contributions from IBM Germany for libspe2
2007-09-25 06:41:57 +00:00
ejcoumans
08d036afc7 multi-threading improvements: optionally use software caching (IBM/PS3), move some code from cpp to header to inline. 2007-09-20 22:42:56 +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