Commit Graph

72 Commits

Author SHA1 Message Date
Xuchen Han
362bc6d9a3 fix the bug that prevents the pd control forces/torques being added 2019-11-08 17:08:59 -08:00
Xuchen Han
13314360a8 add option for deformable rigid split impulse 2019-11-05 18:07:58 -08:00
Chuyuan Fu
4f70e71afa take out btrigidbody field mass 2019-08-06 16:18:43 -07:00
Chuyuan Fu
1cb3655f71 add support to load rigidbody 2019-08-05 13:38:43 -07:00
erwincoumans
cdd56e4641 Merge pull request #1895 from erwincoumans/master
Code-style consistency improvement: _clang-format applied
2018-09-23 19:22:09 -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
Lucas Walter
fbf4d946c4 Spelling fix: on-way -> one-way 2018-09-18 07:40:22 -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
a883cead46 maintain backward compatibility using BT_ENABLE_GYROPSCOPIC_FORCE = BT_ENABLE_GYROSCOPIC_FORCE_IMPLICIT_BODY 2015-03-30 11:58:57 -07:00
erwin coumans
cba140431e prepare to add ForkLiftDemo in App_AllBullet2Demos
rename Ewert/Catto to World/Body for implicit coriolis forces
2015-03-27 11:59:22 -07:00
Erwin Coumans
9931dd9684 remove Cooper implicit (it was just for comparison, it is buggy)
add btMatrix3x3::solve33, thanks to Erin Catto, and added safety against division by zero
2015-03-25 19:33:02 -07:00
Erwin Coumans
0a04a745dd added Erin Catto's 'local' implicit coriolis/gyroscopic force, next to 'Ewert', Cooper, explicit and none
Configured the gyroscopic demo to show the Dzhanibekov effect
see also https://www.youtube.com/watch?v=L2o9eBl_Gzw
2015-03-24 23:16:45 -07:00
erwin coumans
1e13454511 Added experimental implicit gyroscopic force implementation, one by Michael Ewert, and another by Cooper (from OpenDE)
Will also add Erin Catto's local implicit version from the GDC 2015 tutorial
Added demo for btGeneric6DofSpring2Constraint, thanks to Gabor Puhr
Add gfxBridge.autogenerateGraphicsObjects method for Bullet 2 demos in new framework (need to implement all Bullet 2 collision shape types...)
Use 1,1,1 for local scaling in btStaticPlaneShape
2015-03-24 15:55:05 -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@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
0c555a5afe just use 16-byte aligned data for solverbody, not 64byte
fixes Issue 659
2012-12-17 21:29:20 +00:00
erwin.coumans
59a29b1859 fix kinematic objects, see Issue 652
add m_rollingFriction to btRigidBody::btRigidBodyConstructionInfo
2012-09-20 03:32:52 +00:00
erwin.coumans
54744b6ab9 added gyroscopic force option for btRigidBody, body->setFlags(BT_ENABLE_GYROPSCOPIC_FORCE);
Note that it can easily introduce instability at regular (60Hertz) simulation steps so it is generally best to not use the option.
If needed, use a very small internal step, such as 1000 Hertz (world->stepSimulation(dt,100,1./1000.f); or stepSimulation(1./1000.,0);
2012-09-14 21:39:48 +00:00
erwin.coumans
84b1774dda improve handling of restitution by using the velocity (linear/angular) before applying forces: this is done by re-introducing the btSolverBody and only apply the forces to solver body, and use the original rigid body velocity for restitution computation.
warmstarting for contact points was broken, fix in btPersistentManifold
enable split impulse by default (at the cost of some performance)
add  the option for zero-length friction (instead of recomputing friction directions using btPlaneSpace), use the solver mode flag SOLVER_ALLOW_ZERO_LENGTH_FRICTION_DIRECTIONS
precompute lateral friction directions (in btManifoldResult)
remove the mConstraintRow[3] from btManifoldPoint, it just took a lot of memory with no benefits: fixed it in btParallelConstraintSolver
2012-08-31 19:46:24 +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
f10846ed7a Added preliminary cmake support for PE branch, Win32 only for now. 2011-01-07 01:48:50 +00:00
erwin.coumans
77b9181d8b make some getters const,
thanks to Mark for the report in Issue 431
2010-10-02 00:09:01 +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
rponom
b409abac09 Deltas of linear and angular velocities applied to rigid bodies now are kept between simulation steps.
Read-only access functions added to btRigidBody to get these values
Several OpenCL functions are implemented for MiniCL
2010-03-17 19:06:59 +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
d4c3633405 Get rid of btSolverBody and use btRigidBody directly. btSolverBody didn't improve performance after all, due to random-access
Tweak the BenchmarkDemo a bit: 

1) disable deactivation in graphical mode
2) add some settings that increase performance in the BenchmarkDemo2 (1000 stack) from 35ms to 15ms on this quad core (at the cost of a bit of quality)
2010-02-11 20:30:56 +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
87b313d715 Add flags to btRigidBody to disable world gravity.
Use setFlags/getFlags with BT_DISABLE_WORLD_GRAVITY

See http://code.google.com/p/bullet/issues/detail?id=324
2010-02-03 23:58:48 +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
6af9f9434f worked a bit more on the serialization, and added a preliminary SerializeDemo. 2010-01-21 00:17:18 +00:00
erwin.coumans
91f1e8117b Add serialization for btRigidBody (all work-in-progress) 2009-12-09 14:11:13 +00:00
erwin.coumans
700db838b1 Add 1D and 2D support for Bullet: using rigidbody->angularFactor(const btVector3& factor) and body->setLinearFactor(const btVector3& linearFactor);
For example, to only allow linear motion in the X-Z plane, and only rotation around Y axis use:
	body->setLinearFactor(btVector3(1,0,1));
	body->setAngularFactor(btVector3(0,1,0));
Fix build issues with CodeBlocks, when generating projectfiles using CMake 2.6:
${OPENGL_glU_LIBRARY} should be ${OPENGL_glu_LIBRARY}
Fix build issue with CodeBlocks, comment out xmlfree in Extras/COLLADA_DOM/src/modules/LIBXMLPlugin/daeLIBXMLPlugin.cpp (will leak memory)
2009-03-08 04:14:17 +00:00
erwin.coumans
0754876d77 Calculate multiple contact points (for convex-convex and convex-plane) when less then 3 points exist in the persistent manifold.
Uses the normal pertubation method, described by Gino van den Bergen:  http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=4&t=288&p=888#p888
Made btRigidBody::getInvInertiaDiagLocal const, thanks to abhikp (http://code.google.com/p/bullet/issues/detail?id=183 )
2009-02-03 00:54:01 +00:00
rponom
1991bf3013 Added getInfo1()/ getInfo2() code for joints to support the new SIMD constraint solver 2008-12-25 02:13:46 +00:00
erwin.coumans
8ed2db9b42 finally applied this 'getGravity' patch, so getGravity matches setGravity.
Thanks to Evgeny for the report/patch:
http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1852
http://code.google.com/p/bullet/issues/detail?id=23
2008-12-09 02:16:05 +00:00
erwin.coumans
8e0ee0ad74 Removed assert from rigidbody::setLinearVelocity/rigidbody::setAngularVelocity -> it can be useful for special effects. 2008-11-04 21:18:43 +00:00
erwin.coumans
bcd0f48c28 some doxygen updates, added some comments to classes, fix broken links, rename some prefix some internal GIMPACT collision structures using (for example use GIM_AABB instead of BT_AAABB),
removed obsolete btGjkEpa (it was replaced by btGjkEpa2 ages ago)
2008-11-04 04:01:31 +00:00
erwin.coumans
6f28170422 Removed obsolete btPoint3: use btVector3 instead 2008-10-27 19:56:48 +00:00
erwin.coumans
07b577fd86 make debugDrawWorld virtual for btSoftRigidDynamicsWorld
Move btSoftBodyWorldInfo to public, instead of nested, so it can be easier forward declared.
See http://code.google.com/p/bullet/issues/detail?id=78

Add get methods for damping/thresholds, see http://code.google.com/p/bullet/issues/detail?id=77
2008-08-19 16:09:04 +00:00
erwin.coumans
3483e2dfc8 Fix btSoftBody so it compiles with older compilers, such as MSVC 6.0
Add support for angularFactor for applyForce, see http://code.google.com/p/bullet/issues/detail?id=59&can=1
2008-07-22 15:00:25 +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
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
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
fddd6c5721 remove accidental 'return' 2007-07-26 05:22:48 +00:00
ejcoumans
bf967a458a applied patches from Marten (Starbreeze) for per-rigidbody sleeping thresholds, access to constraint references.
Also added assert, to make sure users don't delete rigidbodies while constraints point to them.
2007-07-26 00:16:06 +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
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