Commit Graph

160 Commits

Author SHA1 Message Date
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
erwin.coumans
561066af75 + make compound versus soft body work (soft body uses interpolated transform)
+ fixed issue with persistent manifold, warmstarting values were not initialized properly
+ don't clear manifold in sphere-sphere collision (need warmstarting)
+ added support for 'split impulse', decouple positional error correction from velocity correction
This avoids adding momentum due to penetration correction, it can be tuned using following variables:
solverInfo.m_splitImpulse = true/false (disable/enable)
solverInfo.m_splitImpulsePenetrationThreshold (below this value, baumgarte/mixed velocity/penetration is used (cheaper, looks more plausible)
solverInfo.m_linearSlop (less jitter, when small amound of penetration is allowed)
2008-05-23 09:05:37 +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
ejcoumans
a4e63aed00 - DemoApplication, debug text rendering was broken, glLoadIdentity() missing
- copy user data over to child shape
- added applied impulse to btManifoldPoint
- add ContactProcessedCallback (needs test/demo)
- didn't copy over m_additionalDampingFactor into btRigidBody.
2008-02-07 08:00:16 +00:00
ejcoumans
c0055bdb4a removed some profiling in the innerloop, it hurts performance 2008-01-18 06:48:55 +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
e252f5cadd Bugfix: allow btCollisionObjects (non-btRigidBody) to interact properly with btRigidBody for cache-friendly btSequentialImpulseConstraintSolver.
Thanks Andy O'Neil for pointing this out.
2007-11-28 03:17:09 +00:00
ejcoumans
cab75b53ec added hierarchical profiling (needs more cleanup)
avoid dynamic allocations in btRaycastVehicle
2007-11-21 03:00:40 +00:00
ejcoumans
a101719687 - removed warnings in GLUI, thanks Jorrit Tyberghein for the patch!
- removed memory leaks from BasicDemo and Bullet library (other demos needs to be cleaned up!)
- added memory leak debugging functionality in btAlignedAlloc.h: #define BT_DEBUG_MEMORY_ALLOCATIONS
2007-10-31 08:00:03 +00:00
ejcoumans
ec76f2e0a3 - keep track of all memory allocations (gNumAllignedAllocs/gNumAllignedFree)
All memory allocations in Bullet go through btAlignedAlloc/btAlignedFree
Fix in hinge constraint constructors, thanks Marcus Hennix!
2007-10-22 22:23:10 +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
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
0405ce278a use size_t instead of int, for allocator
added hashtable based PairManager, thanks Pierre Terdiman and Erin Catto
improved friction in 'cachefriendly' solver
moved 'refreshcontactpoints' into collision detection, instead of solver
avoid linear search for contact manifolds, by storing an index
ignore margin for sphere shape (its entire radius is already margin)
avoid alignment checks in BVH serialization, they don't compile on 64-bit architectures
made 'bomb' box more heavy
2007-10-11 03:17:54 +00:00
ejcoumans
811c105c24 align btQuadWord on 16byte boundary
slightly improved friction model
2007-09-25 06:58:53 +00:00
ejcoumans
f50f3ad722 fix for restitution
added preliminary continuous dynamics world (under construction, not ready yet)
fix crash on when restarting simplex demo using spacebar, Thanks Jorrit Tyberghein for reporting!
2007-09-20 05:24:03 +00:00
ejcoumans
15df0a7d7a revert to previous version of constraint solver, until the memory allocation issues are sorted properly. 2007-09-10 19:19:52 +00:00
ejcoumans
ab33083a9c make visual studio 6 compile/run (doesn't support 'long long int', so replace by char* pointers... 2007-09-10 01:53:07 +00:00
ejcoumans
b054f375bc - Added serialization to btBvhTriangleMeshShape/btOptimizedBvh. See ConcaveDemo for example usage.
- added bt32BitAxisSweep3, which co-exists without recompilation, using template class. This broadphase is recommended for large worlds with many objects (> 16384), until btMultiSwap is finished.
- Fixed some recent issues in Bullet 2.57 related to compound (thanks Proctoid) and memory allocations
2007-09-10 01:14:42 +00:00
ejcoumans
87df3d0f32 Based on feedback from another professional game company, there are several improvements, including some API change...
Some dynamic memory allocations have been replace by pool allocation or stack allocations.
quantized aabb versus quantized aabb overlap check is made branch-free (helps a lot on consoles PS3/XBox 360)
Collision algorithms are now created through a new btDefaultCollisionConfiguration, to decouple dependency (this is the API change):
Example:
	btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
	m_dispatcher = new	btCollisionDispatcher(collisionConfiguration);
2007-09-08 05:40:01 +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
5f8873c339 support diamondsubdivision (thanks Jay for contribution)
support user-defined broadphase collision filtering (thanks Marten)
make sure btSimpeDynamicsWorld doesn't use cache friendly optimization in the solver (added an assert, and updated BasicDemo)
2007-06-29 22:13:15 +00:00
ejcoumans
82c8687881 - initialize m_unusedW to avoid some warnings.
- added angularFactor to 'cachefriendly' constraint solver
2007-04-23 10:52:38 +00:00
ejcoumans
bc3f9535ad cleaned up, removed warning under MSVC2005 (Level 4)
Mostly related to alignment and unused variables
2007-04-13 01:37:21 +00:00
ejcoumans
c1a54d9edc Attempts to improve performance. Not much gain yet, but good to experiment what has effect and what hasn't.
Added 'DO_BENCHMARK_PYRAMID' to CcdPhysicsDemo.
2007-03-20 20:12:23 +00:00
ejcoumans
f199cd1347 make visual studio 6 compile again 2007-03-20 05:06:01 +00:00
sjbaker
6b102c65b3 Cleanup some trivial compilation warnings. 2007-03-19 04:27:59 +00:00
ejcoumans
b8ce13adb1 bugfix, also convert rigidbody into solverbodies for constraints (without contact manifolds), and do additional check for validity 2007-03-17 08:29:05 +00:00
ejcoumans
2b87104184 more solver optimizations, can be disabled using solver->setSolverMode(SOLVER_RANDMIZE_ORDER) 2007-03-17 07:59:27 +00:00
ejcoumans
151cd4b9da prepare and added constraint solver optimizations, not activated yet. 2007-03-17 00:09:12 +00:00
ejcoumans
adfdea5ca6 replaced #include "new.h" to #include <new> 2007-03-06 23:40:06 +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
ejcoumans
b73900bc60 Improved performance of convex collision shapes, cache local AABB instead of recomputation. This fixes issue with very slow performance in larger .bsp levels.
Moved some asserts into 'btFullAssert', which is disabled by default (see btScalar.h to enable them). This is to speed-up debugging.
2007-02-26 04:59:05 +00:00
ejcoumans
bf68a742cc by default, disable warmstarting, enable random ordering,
user can override this using solver->setSolverMode(...)
2007-02-13 16:14:55 +00:00
ejcoumans
df9230327c Contribution to add optional double precision floating point support. Define BT_USE_DOUBLE_PRECISION for all involved libraries/apps. 2006-12-16 05:51:30 +00:00