Commit Graph

46 Commits

Author SHA1 Message Date
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
CuriousRubick
c41d575907 early break if single object sleeping 2018-01-26 10:29:46 -06:00
erwincoumans
e138e85bca allow to enable/disable implicit cylinder conversion through an API
p.loadURDF("r2d2.urdf", flags=p.URDF_USE_IMPLICIT_CYLINDER)
allow to enable/disable deterministicOverlappingPairs through an API
p.setPhysicsEngineParameter(deterministicOverlappingPairs = False)
2018-01-09 10:10:36 -08:00
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
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
76375afff2 revert quickSort change in commit http://code.google.com/p/bullet/source/detail?r=2527 and fix the underlying sort issue
in VoronoiFractureDemo (store intermediate values in memory to avoid problems)
@todo: rewrite the island management to avoid sort for better performance
Thanks to Peter Kyme for the report, fixes Issue 607
2012-03-14 03:52:29 +00:00
erwin.coumans
1bcfd824f2 object that have no contact response should not activate other objects
See Issue 592
2012-02-29 03:56:53 +00:00
erwin.coumans
f754952232 Pass in a const reference to a CompareFunc for quickSort, to make Visual Studio 2011 happy.
Thanks to Cameron Hart
Fixes Issue 588
2012-01-23 21:39:44 +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
b80e5fd167 Remove co-planar faces from convex hull, using 2d Graham scan
Improve SAT performance, by skipping back-facing features
Add assert in array class (probably fires in places)
2011-05-20 12:29:24 +00:00
erwin.coumans
bc3b920995 clarified the comments for set/getting of an OpenGL submatrix
Thanks to Mihail Isakov, see Issue 452

Fix sleeping/deactivation issue with kinematic objects, see Issue 442
2010-11-11 22:18:02 +00:00
erwin.coumans
f5e6f87427 implemented patch by Vroonsh to optimize island management with many static objects.
It can be disabled by commenting out the #define STATIC_SIMULATION_ISLAND_OPTIMIZATION in Bullet/src/BulletCollision/CollisionDispatch/btUnionFind.h

See also Issue 406
2010-07-20 00:21:52 +00:00
erwin.coumans
836234696d applied patch removing some virtual calls in 'findUnions'
thanks to holorose for the patch
http://code.google.com/p/bullet/issues/detail?id=295
2009-11-03 06:06:56 +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
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
1381394dd8 reverted 'getActiveObjects', island management will be improved for Bullet 2.74 release.
The implementation was error-prone and could lead to crashes.

See http://code.google.com/p/bullet/issues/detail?id=128
2008-11-11 16:19:20 +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
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
d7b635cabf logic bug in (de)activation/island management: deactivated 'fantom' objects do merge islands, in particular when connected by constraints. (fantom = object with collision detection but no collision response). 2008-09-23 04:57:20 +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
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
65bb612598 - added quickSort to btAlignedObjectArray (has generally better performance then heapSort)
- replaced all usage of heapSort by quickSort
- finished btMultiSapBroadphase. Still some work to be done to increase performance (faster add/remove from child broadphases. 
  uses currently AABB tree to locate child broadphase (should use grid), and sorted array takes too much time.
2008-03-16 04:30:43 +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
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
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
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
ejcoumans
151cd4b9da prepare and added constraint solver optimizations, not activated yet. 2007-03-17 00:09:12 +00:00
ejcoumans
ea97ed3e30 fix in template usage, error only reported on Sun Solaris ?!?
Thanks Noerghel for reporting!
2007-03-13 15:21:01 +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
24691e8eb8 reverted jam buildsystem, until changed for make is working,
minor fix in island processing
2006-12-25 20:39:39 +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
ejcoumans
6dff5a218e process contact and non-contact constraints inside the same iteration loop
added first draft for hingeConstraint motor
2006-12-12 03:15:11 +00:00
ejcoumans
0757f1fe9e add 'force activate', for static/kinematic objects that get moved.
fixed some activation issues with kinematic objects
2006-11-21 13:00:18 +00:00
ejcoumans
07873854a4 more small refactoring: some methods were still upper-case. 2006-11-03 04:32:48 +00:00
ejcoumans
4050da0e2f One of the last parts of the refactoring (hopefully), made most members of btCollisionObject protected.
Also did some work on improving the constraint solver.
2006-11-02 03:42:53 +00:00
ejcoumans
d6c6cbaee6 enabled the vehicle demo again (still needs lots of tuning before it drives well)
fixed some warnings
2006-10-29 03:36:16 +00:00
ejcoumans
289c5ca7fe improvements/bugfixes related to kinematic(animated) objects, synchronizeMotionStates 2006-10-19 15:20:38 +00:00
ejcoumans
bf847b839a another large series of changes, related to the refactoring.
CompoundShapes are tricky to manage with respect to persistent contact points and swapped order of btCollisionObjects,
During dispatch, finding an algorith etc. order can be swapped.
fixed several other issues, related to SimpleBroadphase (removing a proxy was not working)
2006-10-06 05:22:13 +00:00
ejcoumans
2b1657b1dd Refactoring: another huge number of changes, renamed methods to start with lower-case. 2006-09-28 01:11:16 +00:00
ejcoumans
eb23bb5c0c merged most of the changes from the branch into trunk, except for COLLADA, libxml and glut glitches.
Still need to verify to make sure no unwanted renaming is introduced.
2006-09-27 20:43:51 +00:00
ejcoumans
37a53ee7d9 small cleanup in the DemoApplication, removed references to obsolete PHY_ShapeProps/PHY_MaterialProps
removed deletion of motionstate in CcdPhysics/CcdPhysicsController destructor
disabled m_type optimization in SimdTransform (making the memory size 64 byte, potentially more cache friendly)
fixed a bug in island generation, causing the activation not propagating in one frame, but one 'layer' of rigidbodies at a time
2006-09-26 18:59:29 +00:00
ejcoumans
0e04cfc806 First stage in refactoring Bullet: moved Bullet Collision and Dynamics and LinearMath into src folder, and all files in Collision Detection and Dynamics have bt prefix.
Made all buildsystems to work again (jam, msvc, cmake)
2006-09-25 08:58:57 +00:00