Commit Graph

143 Commits

Author SHA1 Message Date
erwin.coumans
22915b2344 enable randomization of non-contact constraints (disabled by default)
Thanks to Peter Kyme, http://code.google.com/p/bullet/issues/detail?id=576
2011-12-14 09:06:14 +00:00
erwin.coumans
8b849e0d07 Fixed split impulse SIMD issue in the constraint solver (doesn't affect default behaviour, as split impulse is switched off by default)
Thanks to Laurent Coulon for the report/fix. http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=7515&p=25766#p25766
2011-10-12 20:22:55 +00:00
erwin.coumans
16cc5665de fix in the breaking constraints feature 2011-07-01 21:51:38 +00:00
erwin.coumans
b16b61d9d6 disable constraints when they exceed a breaking threshold, control it with new methods in btTypedConstraint: get/setBreakingImpulseThreshold and get/setEnabled
Disabled constraints are not removed from the world and they use negligible CPU cycles
2011-04-02 19:01:23 +00:00
erwin.coumans
d198451909 clear the applied impulse for constraints (no warmstarting)
simplify logic, see Issue 499
2011-04-02 00:44:15 +00:00
erwin.coumans
f17fa297d5 wrapped up first version of the FractureDemo
move 'split impulse' / position solver before velocity solver, so that applied impulse is available for fracture
add btSliderConstraint::getAngularPos see http://code.google.com/p/bullet/issues/detail?id=489
2011-03-18 00:20:52 +00:00
erwin.coumans
7a9c349a8c enable predictive contact constraints, see BasicDemo 2011-03-05 03:01:44 +00:00
erwin.coumans
e621c880d6 avoid naming conflicts with vectormath/sse version 2011-02-28 06:54:08 +00:00
erwin.coumans
c296122e4e fix build for Intel Compiler 11.1 -> move static ::getFixedBody method from header to cpp file. 2010-09-08 00:38:15 +00:00
erwin.coumans
54c07ddac4 Implemented constraint damping, as requested in Issue 416
Thanks Mark for the feedback
2010-08-24 21:12:32 +00:00
erwin.coumans
b3f081fc85 Added preparation for GPU hardware accelerated solvers for BulletSoftBody (OpenCL and DirectCompute backends will follow)
Added assert to check for positive masses in btCompoundShape::calculatePrincipalAxisTransform, see Issue 399
Fixes for LLVM/GCC compilation issue in btSequentialImpulseConstraintSolver
(Untested) fix for Linux 64bit compilation Issue 409
2010-07-16 23:26:25 +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
155254d448 remove warning, remove Jamfile from CMakeLists.txt, check for two static objects in solver. 2010-02-20 21:12:50 +00:00
erwin.coumans
85724b5500 SerializeDemo: create a testFile.bullet if it is missing
Serialization: remove obsolete autogenerated headers
Minor changes in btSequentialImpulseConstraintSolver: split methods to make it easier to derive from the class and add functionality.
2010-02-19 23:24:04 +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
d58081ce37 Provide easier access to CFM and ERP (and Stop ERP/Stop CFM) for constraints in a similar way to Open Dynamics Engine
virtual	void	btTypedConstraint::setParam(int num, btScalar value, int axis = -1) = 0;
virtual	btScalar btTypedConstraint::getParam(int num, int axis = -1) const = 0;
	
Parameter can be BT_CONSTRAINT_ERP,BT_CONSTRAINT_STOP_ERP,BT_CONSTRAINT_CFM,BT_CONSTRAINT_STOP_CFM
Axis is 0 .. 5, first 3 for linear degrees of freedom, last 3 for angular. If no axis is specified it will take the 'default' degree of freedom. For a btHingeConstraint this would be the hinge axis (5)
2010-02-03 22:16:09 +00:00
rponom
f919baf03d Improved Slider, Hinge and Generic6DOF constraint setup.
Turned on by default, use m_useOffsetForConstraintFrame = false to use old setup
Use "O" (capital 'o') button to toggle it in SliderConstraintDemo and ConstraintDemo

Total applied impulse copied back from btSolverConstraint to btTypedConstraint
2009-11-25 23:52:12 +00:00
erwin.coumans
da4a1b14b5 Add support for target motion and slip/cfm for both friction directions.
It can be handy for effects such as powered conveyor belt effect or sideways slipping tyre friction.
2009-09-18 07:48:15 +00:00
erwin.coumans
d67aa861f2 Add support for childshape index for btCompoundShape during ContactAddedCallback,
see example in Bullet/Demos/ConvexDecompositionDemo
Removed some warnings
2009-08-11 00:30:41 +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
acf8ed3de5 Re-enabled split impulse: avoids adding linear/angular momentum due to penetration recovery.
Both SIMD and scalar version is supported.
2009-06-10 22:04:06 +00:00
rponom
ee664e7750 Damping for spring motors added
see btGeneric6DofSpringConstraint::setDamping()
2009-06-02 01:10:43 +00:00
erwin.coumans
258ef6e25a + Added joint feedback for constraints, needs testing/demo before 2.75 release.
See also http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2677
and http://code.google.com/p/bullet/issues/detail?id=227

To enable, use constraint->enableFeedback(true);
And then either use
constraint->getAppliedImpulse() for an estimated applied impulse,
or constraint-> getAppliedLinearImpulse(), or constraint->getAppliedAngularImpulseA() or constraint->getAppliedAngularImpulseB().

+removed a few warnings.
2009-05-27 01:34:46 +00:00
erwin.coumans
f3c3d2f156 + disable perturbation for btConvexPlaneCollisionAlgorithm, it introduces artifacts (additional points cause spheres/cylinders and other curved objects to move)
+ applied patch to mix double/single precision meshes independent from double/single precision Bullet build
Thanks to Ole for the patch, http://code.google.com/p/bullet/issues/detail?id=213
+ re-enable warming starting in constraint solver, it was disabled by accident
+ fix btConvexHullShape constructor, so accept vertices with non-16-byte striding
Thanks Shawn Baird for report and fix: http://code.google.com/p/bullet/issues/detail?id=204
2009-05-06 19:13:11 +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
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
erwin.coumans
210fe36106 Add backface culling and option to keep unflipped hit normal in case a ray hits a back-facing triangle.
Usage: set RayResultCallback.m_flags to kF_FilterBackfaces, optionally combined with kF_KeepUnflippedNormal.
Thanks Andy O'Neil for the patch!

Remove the force_inline for some internal constraint solver methods, it makes re-use easier.
Workaround/avoid MSVC 2005 compiler error in LibXML/trionan.c
2009-02-28 01:25:23 +00:00
erwin.coumans
4236764cfb enable 'getAngularFactor' again
add getAppliedImpulse accessor to btManifoldPoint
2009-02-17 20:38:54 +00:00
erwin.coumans
d886c06fa5 Add the option for the btSimulationIslandManager to avoid splitting islands (for constraint solving)
Move the convertContact inside constraint solver to its own method
2009-02-13 02:34:46 +00:00
erwin.coumans
7a2a98078a Fixes for broadphase/paircache determinism.
Revert definition for ATTRIBUTE_ALIGNED16, and try to force sizeof(btSolverConstraint) by using unions with btScalar, for non-btScalar data types.
Use btAssert and not assert.
Don't access btAlignedObjectArray elements, for zero sets
2009-02-10 23:50:21 +00:00
erwin.coumans
5593a23417 upgrade version of projectfiles, cmake
fix build for msvc 6.0
2009-02-06 05:37:37 +00:00
erwin.coumans
2162f6663d disable help text by default in AllBulletDemos (text slows down many graphics cards)
improve CollisionDemo.cpp, show multi-contact generation using perturbation
improve ColladaConverter: add hinge/point 2 point constraint conversion support, add btScaledTriangleMeshShape support
Fix Dynamica MayaPlygin: remove 'active' flag, it has to be replaced by mass=0 for active, mass<>0 for passive
Added missing projectfiles
Fixed single-shot contact generation. it is disabled by default to improve performance
Bugfixes for character controller, thanks to John McCutchan for reporting
Constraint solver: better default settings
btDefaultAllocator: aligned allocator uses non-aligned allocator (instead of directly malloc/free)
disable memalign by default, use Bullet's aligned allocator
2009-02-06 03:20:43 +00:00
erwin.coumans
57fb21879b Expose various advanced friction options to the developer, and use a higher-quality friction model by default, to match ODE quickstep constraint solver.
Thanks to Martijn Reuvers for bringing this up, and reproduction case.
See issue here: http://code.google.com/p/bullet/issues/detail?id=177
2009-01-20 01:21:48 +00:00
erwin.coumans
b89b71b38d improving the SSE constraint solver performance: avoid a FPU/minus operation, by replacing a _mm_add_ps(-normal,X) by _mm_sub_ps(X,normal) 2008-12-03 17:40:01 +00:00
erwin.coumans
a064fd2052 Use the opposite constraint axis inside the constraint solver for the second object (-normal).
This makes it easier to port existing constraints and makes it 100% compatible with ODE quickstep constraint layout (getInfo2)
2008-12-03 04:52:23 +00:00
erwin.coumans
76b3e44117 Enable contact constraint in the obsolete/experimental SpuParallellSolverTask. It will be replaced by a better parallel constraint solver. 2008-12-02 07:39:13 +00:00
erwin.coumans
5383ed4930 + need to reset rigid body using 'setCenterOfMassTransform' to reset world inertia tensor
+ fixes in compound algorithm -> recompute contact points
+ add debug drawing to some demos.
+ revert btJacobianEntry change
+ replace dCROSSMAT by btVector3::getSkewSymmetricMatrix
2008-12-02 04:01:56 +00:00
erwin.coumans
7341c6ee7e Minor fixes to keep trunk compiling, while doing the refactoring. 2008-12-01 06:55:27 +00:00
erwin.coumans
e80feca36b Big work-in-progress refactoring of the constraint solver:
1) Add fast branchless SIMD support for constraint solver (Windows only until we get other contributions).
See resolveSingleConstraintRowGenericSIMD in Bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
resolveSingleConstraintRowGenericSIMD can be used for all constraints, including contact, point 2 point, hinge, generic etc.

2) During this refactoring, all constraints support the obsolete 'solveConstraintObsolete' while we add 'getInfo1' and 'getInfo2' support.
This interface is almost identical interface to Open Dynamics Engine, to make it easier to port Dantzig LCP solver.

3) Some minor refactoring to reduce huge constructor overhead in math classes.
2008-12-01 06:41:25 +00:00
erwin.coumans
82047e601e updated Bullet sequential impulse constraint solver, so it matches 100% ODE PGS quickstep solver innerloop, mainly by renaming variables... 2008-11-26 00:27:35 +00:00
erwin.coumans
decf91a34d Made btCollisionWorld::convexSweepTest and btGhostObject::convexSweepTest consistent. Both have an optional last argument for allowedCcdPenetration.
Bugfix due to recent change in friction in constraint solver.
2008-11-19 19:55:14 +00:00
erwin.coumans
29bfd06af7 Disable friction warmstarting by default, removing second friction direction. This gives a large performance increase.
friction warmstarting can be turned on using:
dynamicsWorld ->getSolverInfo().m_solverMode |= SOLVER_USE_FRICTION_WARMSTARTING;
2008-11-15 22:20:55 +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
780350a9e1 Fix copy/paste bug, resulting in wrong friction warmstarting,
thanks to sandeep_slash, http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2724
2008-10-14 04:44:24 +00:00
erwin.coumans
a42b7d93f1 Stop resitution for resting contact, after n frames (can be controlled by btContactSolverInfo.m_restingContactRestitutionThreshold
Thanks Jan Bender for bringing this up
2008-10-09 16:24:00 +00:00
erwin.coumans
af4520801b + Fix btSubsimplexConvexCast
Thanks to Nacho, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2422)
Fix in rendering, GL_STENCIL
+ btTriangleIndexVertexArray indices should be unsigned int/unsigned short int,
+ Made InternalProcessAllTriangles virtual, thanks to 
Both thank to Fullmetalcoder, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2401
+clamp impulse for btPoint2PointConstraint
Thanks to Martijn Reuvers, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2418
+ Free memory of bvh, pass in scaling factor (optional)
Thanks to Roy Eltham, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2375
2008-07-31 19:44:28 +00:00
erwin.coumans
9cd83c004b + add dummy getcwd/getenv for PS3 compatibility
+ disable HAVE_SIGNAL_H 0 for LibXML
+ removed unused variable in btCollisionWorld
+ removed unused variable in btSequentialImpulseConstraintSolver
2008-07-28 23:15:43 +00:00
erwin.coumans
884a494412 make the source code compile with older compilers again (Visual Studio 2006 in particular)
renamed btDbvt::Volume to btDbvtVolume and btDbvt::Node to btDbvtNode to distinguish from btSoftBody::Node
2008-07-15 23:27:18 +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
erwin.coumans
f8e5481612 Added method to collect all persistent contact manifolds, given a btBroadphasePair (collision algorithm)
virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
See Demos/CharacterDemo/CharacterDemo.cpp for example usage of getAllContactManifolds
Added btDbvtBroadphase to btBulletCollisionCommon.h headerfile
Enable soft body vs concave (albeit slow)
Improved contact point debug rendering (moved from constraint solver into debugDrawWorld)
2008-05-24 04:23:00 +00:00