diff --git a/Makefile.am b/Makefile.am index b134e0420..58b35e051 100755 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src wavs images models data mods fonts +SUBDIRS = @BULLETTREE@ src wavs images models data mods fonts EXTRA_DIST = README ChangeLog COPYING missing diff --git a/README.bullet b/README.bullet index 8ea3252d2..ef58dbf18 100644 --- a/README.bullet +++ b/README.bullet @@ -1,16 +1,8 @@ Preliminary support for the bullet physics engine has been -added. To enable it (assume that 'STK' is the supertuxkart root -directory): -1) Uncompress a recent version of bullet (tested with 2.63) - in STK/src/bullet - 2.63 is the latest version, earlier versions will not - work due to changes in the bullet API. - NOTE: The location of bullet was changed, before it was in - STK/bullet, now it's in STK/src/bullet. -2) Compile bullet (follow the instructions in STK/src/bullet/INSTALL) -3) Run STK configure with: - ./configure --enable-bullet -4) make +added, and bullet itself is part of the STK sources by noq. +To enable it, use the '--enable-bullet' option in configure, +that should be all (though up to now only linux and cygwin +have been tested with the new, integrated bullet version). For now mainly the race track works as expected, all tracks can be played (though the performance in some tracks is somewhat diff --git a/configure.ac b/configure.ac index aeafdfcf6..0628e8b63 100644 --- a/configure.ac +++ b/configure.ac @@ -326,6 +326,7 @@ fi # ========================= # subst bars in Makefile.am # ========================= +AC_SUBST(bullet_LIBS) AC_SUBST(opengl_LIBS) AC_SUBST(openal_LIBS) AC_SUBST(mikmod_LIBS) @@ -360,25 +361,36 @@ if test "x${enable_bullet}" != "xno"; then AC_DEFINE([BULLET], [], [Use the bullet physics engine]) AC_MSG_RESULT([enabled]) CXXFLAGS="$CXXFLAGS -Ibullet/src" - LIBS="$LIBS -L bullet/out/*/*/libs -lbulletopenglsupport -lbulletdynamics -lbulletcollision -lbulletmath -lglut" + AC_CONFIG_FILES([ \ + src/bullet/Makefile \ + src/bullet/src/Makefile \ + src/bullet/Demos/OpenGL/Makefile + ]) + SUMMARY="$SUMMARY\nUsing bullet physics." + BULLETTREE="src/bullet" + bullet_LIBS="-L bullet/Demos/OpenGL -lbulletopenglsupport -L bullet/src -lbulletdynamics -lbulletcollision -lbulletmath -lglut" else AC_MSG_RESULT([disabled]) + BULLETTREE="" + bullet_LIBS="" + fi +AC_SUBST(BULLETTREE) dnl ================ dnl Create makefiles dnl ================ -AC_CONFIG_FILES([ \ - Makefile \ - data/Makefile \ - fonts/Makefile \ - images/Makefile \ - models/Makefile \ - mods/Makefile \ - src/Makefile \ - wavs/Makefile \ - wavs/radio/Makefile \ - wavs/tintagel/Makefile \ +AC_CONFIG_FILES([ \ + Makefile \ + data/Makefile \ + fonts/Makefile \ + images/Makefile \ + models/Makefile \ + mods/Makefile \ + src/Makefile \ + wavs/Makefile \ + wavs/radio/Makefile \ + wavs/tintagel/Makefile \ models/herrings/Makefile ]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index dacf2b803..ccbd43824 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -121,7 +121,7 @@ supertuxkart_SOURCES = main.cpp \ # Link in the specific gcc 4.1 bug work around supertuxkart_LDADD = -L. -lstatic_ssg \ -lplibjs -lplibsl -lplibssg -lplibpu -lplibfnt -lplibsg \ - -lplibul -lplibssgaux $(opengl_LIBS) $(sdl_LIBS) $(openal_LIBS) $(mikmod_LIBS) + -lplibul -lplibssgaux $(bullet_LIBS) $(opengl_LIBS) $(sdl_LIBS) $(openal_LIBS) $(mikmod_LIBS) .PHONY: pot pot: diff --git a/src/bullet/AUTHORS b/src/bullet/AUTHORS new file mode 100644 index 000000000..f2cc86dd7 --- /dev/null +++ b/src/bullet/AUTHORS @@ -0,0 +1,22 @@ + +Bullet Physics Library is an open source project with help from the community at the Physics Forum +See the forum at http://bulletphysics.com + +The project was started by Erwin Coumans + +Following people contributed to Bullet +(random order, please let us know on the forum if your name should be in this list) + +Gino van den Bergen: LinearMath classes +Christer Ericson: parts of the voronoi simplex solver +Simon Hobbs: 3d axis sweep and prune, Extras/SATCollision, separating axis theorem + SIMD code +Dirk Gregorius: generic D6 constraint +Erin Catto: accumulated impulse in sequential impulse +Nathanael Presson: EPA penetration depth calculation +Francisco Leon: GIMPACT Concave Concave collision +Joerg Henrichs: make buildsystem (work in progress) +Eric Sunshine: jam + msvcgen buildsystem +Steve Baker: GPU physics and general implementation improvements +Jay Lee: Double precision support +KleMiX, aka Vsevolod Klementjev, managed version, rewritten in C# for XNA +Erwin Coumans: most other source code diff --git a/src/bullet/BulletLicense.txt b/src/bullet/BulletLicense.txt new file mode 100644 index 000000000..c3ec68c21 --- /dev/null +++ b/src/bullet/BulletLicense.txt @@ -0,0 +1,17 @@ +/* +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +Free for commercial use, but please mail bullet@erwincoumans.com to report projects, and join the forum at +www.continuousphysics.com/Bullet/phpBB2 diff --git a/src/bullet/ChangeLog.txt b/src/bullet/ChangeLog.txt new file mode 100644 index 000000000..607ffceb1 --- /dev/null +++ b/src/bullet/ChangeLog.txt @@ -0,0 +1,451 @@ +Bullet Continuous Collision Detection and Physics Library +Primary author and maintainer: Erwin Coumans + +2007 Oct 22 + - All memory allocations go through btAlignedAlloc/btAlignedFree. User can override this to verify memory leaks + - added a few more demos to AllBulletDemos + - fix for one of the constructors of btHingeConstraint + Thanks Marcus Hennix + +2007 Oct 20 + - included glui, a GLUT/OpenGL based toolkit for some graphical user elements + Removed dynamic_cast from glui, to allow linkage without rtti + - added Box2D framework using glui, allowing all demos to run within one executable + Thanks Erin Catto for the FrameWork skeleton (http://www.box2d.org) + +2007 Ocy 17 + - Allow user to pass in their own memory (stack and pool) allocators, through collisionConfiguration. See demos how to use this + +2007 Oct 14 + - Included working version of Cell SPU parallel optimized version for Libspe2 SPU task scheduler. + This version compiles and runs on Playstation 3 Linux and IBM CellBlade, see BulletSpuOptimized.pdf for build instructions + (Official Playstation 3 developers can request a SPURS version through Sony PS3 Devnet.) + Thanks to IBM 'Extreme Blue' project for the contribution + http://www-913.ibm.com/employment/us/extremeblue/ + Thanks Minh Cuong Tran, Benjamin Hoeferlin, Frederick Roth and Martina Huellmann + for various contributions to get this initial Libspe2 parallel version up and running. + +2007 Oct 13 + - made 'btCollisionShape::calculateLocalInertia' const + Thanks to cgripeos, see http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1514 + - applied a large patch to remove warnings + Thanks to Enrico, see http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1568 + - removed SSE includes, added #incude for memset in Extras/quickstep, thanks Eternl Knight + +2007 Oct 11 + - added Hashed Overlapping Pair Cache, recommended by Pierre Terdiman. It works like a charm, thanks Pierre and Erin Catto (code from Box2D) + - modified some margins inside btBoxShape, btCylinderShape and btSphereShape + - added cone debug rendering (for cones with x, y and z up-axis) + - added improvements for optional Extra/quickstep, thanks to Remotion + - some performance improvements for Bullet constraint solver + +2007 Sept 28 + - upgraded GIMPACT to version 0.3 + Thanks to Francisco Leon + +2007 Sept 27 + - added contribution from IBM Extreme Blue project for Libspe2 support. This allow to execute BulletMultiThreaded on Cell SPU under PS3 Linux and Cell Blade. See http://www-913.ibm.com/employment/us/extremeblue + Thanks to Minh Cuong Tran, Frederick Roth, Martina Heullmann and Benjamin Hoeferlin. + +2007 Sept 13 + - Improved btGenericD6Constraint. It can be used to create ragdolls (similar to the new btConeTwistConstraint). See GenericJointDemo + - Added support for Bullet constraints in the optional Extras/quickstep ODE solver. See CcdPhysicsDemo, enable #COMPARE_WITH_QUICKSTEP and add libquickstep to the dependencies. + For both patches/improvements thanks Francisco Leon/projectileman + +2007 Sept 10 + - removed union from btQuadWordStorage, it caused issues under certain version of gcc/Linux + +2007 Sept 10 + - Reverted constraint solver, due to some issues. Need to review the recent memory allocation changes. + - Fixed issue with kinematic objects rotating at low speed: quaternion was de-normalized, passing value > 1 into acosf returns #IND00 invalid values + - 16 byte memory alignment for BVH serialization + - memory cleanup for btPoolAllocator + +2007 Sept 9 + - Added serialization for BVH/btBvhTriangleMeshShape, including endian swapping. See ConcaveDemo for an example. + Thanks to Phil Knight for the contribution. + - Fixed issues related to stack allocator/compound collision algorithm + Thanks Proctoid, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=18&t=1460 + - Increase some default memory pool settings, and added a fallback for the constraints solver to use heap memory + - Removed accidential testing code in btScalar.h related to operator new. + - Enable btAxis3Sweep and bt32BitAxis3Sweep to be linked in at the same time, using template + +2007 Sept 7 + - Replaced several dynamic memory allocations by stack allocation and pool allocations + - Added branch-free quantized aabb bounding box overlap check, works better on Playstation 3 and XBox 360 + Thanks to Phil Knight. Also see www.cellperformance.com for related articles + - Collision algorithms and settings for the memory/stack allocator can be done using btDefaultCollisionConfiguration + This is an API change. See demos how to modify existing implementations with a one-liner. + - Register several collision algorithms by default (sphere-sphere, sphere-box, sphere-triangle) + - Use other traveral method for BVH by default, this improves triangle mesh collision performance. + +2007 Aug 31 + - fixed MSVC 6 build + Thanks Proctoid, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1375 + - fixed double precision build issues + Thanks Alex Silverman, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1434 + +2007 Aug 24 + - fixed bug in btMatrix3x3::transposeTimes(const btMatrix3x3& m) const. Luckily it wasn't used in core parts of the library (yet). + Thanks to Jay Lee + +2007 Aug 15 + - fixed bug in Extras/GIMPACT 0.2 related to moving triangle meshes + Thanks Thomas, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1368 + +2007 Aug 14 + - added parallel constraint solver. Works on Playstation 3 Cell SPU and multi core (Win Threads on PC and XBox 360). + See Extras/BulletMultiThreaded for SpuSolverTask subfolder and SpuParallelSolver.cpp + Thanks Marten Svanfeldt (Starbreeze Studios) + - fixed some bugs related to parallel collision detection (Extras/BulletMultiThreaded) + Thanks Marten Svanfeldt (Starbreeze Studios) + +2007 Aug 2 + - added compound and concave-convex (swapped) case for BulletMultiThreaded collision detection, thanks to Marten Svanfeldt + - refactored broadphase and overlapping pair cache. This allows performance improvement by combining multiple broadphases. This helps add/remove of large batches of objects and large worlds. See also Pierre Terdiman forum topic: + http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329 + + +2007 July 27 + - added Ragdoll Demo + Thanks to Marten Svanfeldt (Starbreeze Studios) + + - added Vector Math library for SIMD 3D graphics linear algebra (vector, matrix, quaternion) + See Bullet/Extras/vectormathlibrary + Supports SIMD SSE, PowerPC PPU and Cell SPU (including PS3 Linux and CellBlade), as well as generic portable scalar version + Will be used to improve BulletMultiThreaded performance + Open Sourced by Sony Computer Entertainment Inc. under the new BSD license + - added SIMD math library + 4-way SIMD for common math functions like atan2f4, cosf4, floorf4, fabsf4, rsqrtf4 etc. Used by Vector Math library under PPU and SPU. + Supports PowerPC (PPU) and Cell SPU, including PS3 Linux and CellBlade. + See Bullet/Extras/simdmathlibrary + Open sourced by Sony Computer Entertainment Inc. under the new BSD license + + +2007 July 25 + - added several patches: per-rigidbody sleeping threshold. added Assert to prevent deletion of rigidbody while constraints are still pointing at it + Thanks to Marten Svanfeldt (Starbreeze Studios) + +2007 July 13 + - fixed relative #include paths again. We can't use "../" relative paths: some compilers choke on it (it causes extreme long paths) + Within the libraries, we always need to start with "BulletCollision/" or "BulletDynamics/ or "LinearMath/" + +2007 July 10 + - Updated Bullet User Manual + +2007 July 5 + - added btConeTwistConstraint, especially useful for ragdolls. See Demos/RagdollDemo + Thanks to Marten Svanfeldt (Starbreeze Studios) + +2007 June 29 + - btHeightfieldTerrainShape: Added heightfield support, with customizations + - Upgraded to GIMPACT 0.2, see Extras/GIMPACT and MovingConcaveDemo + - Several patches from Marten Svanfeldt (Starbreeze Studios) + Improved collision filtering (in broadphase and rigidbody) + Improved debug rendering + Allow to set collision filter group/mask in addRigidBody + + +2007 June 15 + - Changed btAlignedObjectArray to call copy constructor/replacement new for duplication, rather then assignment operator (operator=). + +2007 June 11 + - Added multi-threading. Originally for Playstation 3 Cell SPU, but the same code can run using Win32 Threads using fake DMA transfers (memcpy) + Libspe2 support for Cell Blade / PS3 Linux is upcoming + See Extras/BulletMultiThreaded. Usage: replace btCollisionDispatcher by btSpuGatheringCollisionDispatcher + + - Added managed Bullet library, entirely rewritten in C# for Windows and XBox 360 XNA + See Extras/BulletX + Thanks to KleMiX, aka Vsevolod Klementjev + +2007 May 31 + - sign-bit went wrong in case of 32-bit broadphase, causing quantization problems. + Thanks DevO for reporting. + +2007 May 23 + - Fixed quantization problem for planar triangle meshes in btOptimizedBvh + Thanks Phil Knight for reporting and helping to fix this bug. + +2007 May 20 + - btAxisSweep3: Fixed a bug in btAxisSweep3 (sweep and prune) related to object removal. Only showed up when at least one btStaticPlaneShape was inserted. + Thanks tbp for more details on reproducing case. + - btAxisSweep3: Fixed issue with full 32bit precision btAxisSweep3 (define BP_USE_FIXEDPOINT_INT_32), it used only 0xffff/65536 for quantization instead of full integer space (0xffffffff) + - btRaycastVehicle: Added 'getForwardVector' and getCurrentSpeedKmHour utility functions + - Fixed local scaling issues (btConvexTriangleMeshShape, btBvhTriangleMeshShape, removed scaling from btMatrix3x3). + Thanks Volker for reporting! + - Added second filename search, so that starting BspDemo and ConvexDecompositionDemo from within Visual Studio (without setting the starting path) still works + +2007 April 22 + - Added braking functionality to btRaycastVehicle + - Removed tons of warnings, under MSVC 2005 compilation in -W4 + +2007 March 21 + - Fixed issues: comma at end of enum causes errors for some compilers + - Fixed initialization bug in LocalRayResult ( m_localShapeInfo(localShapeInfo) ) + +2007 March 20 + - Added refit tree to quantized stackless tree, and updated ConcaveDemo as example. + +2007 March 17 + - Added constraint solver optimizations, avoiding cross products during iterations, and gather rigidbody/constraint info in contiguous memory (btSolverBody/btSolverConstraint) + - These optimizations don't give large benefit yet, but it has good potential. Turned on by default. Can be switched off using solver->setSolverMode(SOLVER_RANDMIZE_ORDER). + - Enabled anti-jitter for rigid bodies. This is experimental, and can be switched off by setting a global (it is experimental so no proper interface) gJitterVelocityDampingFactor = 1.0; + - Fixed bug in islandmanifold.heapSort(btPersistentManifoldSortPredicate()); , thanks Noehrgel for reporting this (affected Sun Solaris) + +2007 March 12 + - Added compile-time toggle between on 16-bit and 32-bit fixed-point SAP broadphase. + This allows the number of bodies to exceed 32767 + - Enable useQuantizedAabbCompression on btTriangleMesh, see ColladaDemo + +2007 March 8 + - Fixed bug in constraint/island sorting (caused by replacing STL by dedicated btAlignedObjectArray with heapSort) + Thanks Clemens Unterkofler for pointing this out! + +2007 March 6 + - 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 Feb 25 + - Improved performance of convex collision shapes, cache local AABB instead of recomputation. This fixes issue with very slow performance in larger .bsp levels + +2007 Feb 24 + - Added compressed/quantized AABB tree, 16 bytes per node, while supporting 32-bit (triangle) indices. + Should be faster and smaller then original version (quantized aabb check is done in integer space) + Original aabb tree nodes are still supported. They are 44 bytes, with full floating point precision and additional subPart index. + - added meter-unit scaling support in ColladaConverter.cpp + +2007 Feb 21 + - Build system: updated bullet.pc.in library names + - Updated EPA comparison integration (missing parameter) + +2007 Jan 04 + - fixed optimized AABB tree building: in some cases the tree building fails due to unbalanced trees, which generated stack overflow + +2006 Dec 15 + - added contribution to allow double precision collision detection/dynamics. Define BT_USE_DOUBLE_PRECISION in your project and libraries that include Bullet + +2006 Dec 14 + - merged contact and non-contact constraint solving into one loop, will improve stability of jointed bodies during collisions + - added first draft for hingeConstraint motor + +2006 Dec 8, Erwin Coumans + - preparation for SIMD: added btAlignedAllocator and btAlignedObjectArray, to replace stl std::vector, same interface, but compatible with 16 byte alignment + - cleaned up dependencies in autogenerated msvc projectfiles + - aligned btVector3 on 16 bytes boundary, under win32. see if developers will come up with problems + +2006 Dec 04, Erwin Coumans + Added btNearCallback. This is similar to Open Dynamics Engine (ODE) dNearCallback, but important differences: + - contact points are persistent (lifetime more then one frame, for warmstarting/incremental contact point management) + - continuous collision detection, time of impact + Added btRigidBody::isInWorld(), returns true if btRigidBody is inside a btCollisionWorld/btDynamicsWorld derived class + Added angularFactor to btRigidbody, this helps some character control (no angular impulse applied) + + +2006 Nov 28 + Moved StackAlloc from EPA into LinearMath/btStackAlloc + renamed internal class ConcaveShape into btConcaveShape + added btHeightfieldTerrainShape (not completed yet) + +2006 Nov 15 Nathanael Presson + Added EPA penetration depth algorithm, Expanding Polytope Algorithm + Added Pierre Terdiman penetration depth comparison/test DEMO + Fixed Bullet's Minkowski sampling penetration depth solver + Contributed by Nathanael Presson + +2006 Nov 11 Francisco León Nájera + Added GIMPACT trimesh collision detection: concave versus concave, + Contributed by Francisco León Nájera + +2006 Nov 2 + Minor refactoring: btCollisionObject changes from struct into class, added accessor methods + Force use of btMotionState to synchronize graphics transform, disabled old btRigidBody constructor that accepts btTransform + Renamed treshold into threshold throughout the code + +2006 Oct 30 + Enable decoupling of physics and graphics framerate using interpolation and internal fixed timestep, based on btMotionState + Enabled raycast vehicle demo (still needs tuning) + Refresh contact points, even when they are already persistent. + Fixed debugDraw colors (thanks pc0de for reporting) + Use Dispatcher in ConcaveConvexCollisionAlgorithm (so it uses the registered collision algorithm, not hardcoded convexconcave) + Improved performance of constraint solver by precalculating the cross product/impulse arm + Added collision comparison code: ODE box-box, also sphere-triangle + Added safety check into GJK, and an assert for AABB's that are very large + Fixed kinematic support (deriving velocities for animated objects) + Updated comparison/optional quickstep solver in Extras + UserCollisionAlgorithm demonstrates btTriangleMesh usage (easier trimesh compared to index array version) + Removed scaling from btTransform (we only want to deal with rigid transforms) + +2006 Oct 4 + Fixed minor leak in btOptimizeBVH + Cleanup of btRigidBody construction + added getW() in btQuaternion + assert when setLinearVelocity is called on btRigidBody + renamed projectfile library from collada-dom to colladadom (to make VC6 happy) + +2006 Sept 27 + Big Refactoring: renamed and moved files, create a replacement for CcdPhysicsEnvironment/CcdPhysicsController. + All Bullet classes in LinearMath, BulletCollision and BulletDynamics start with bt, and methods start with lowercase. + Moved classes into src folder, which is the only include folder needed. + Added 2 headerfiles in src: btBulletCollisionCommon.h and btBulletDynamicsCommon.h + +2006 Sept 23 + Fixed 2 bugs, causing crashes when removing objects. Should do better unit-testing. UnionFind and 3D SAP were involved. + +2006 Sept 19 + Allow programmable friction and contact solver model. User can register their own functions for several interaction types. + Improved performance, and removed hardcoded maximum overlaps (switched from C-array to stl::set) + +2006 Sept 16 + Added Bullet 2.0 User Manual + Allow registration of custom user collision algorithms + +2006 Sept 10 + Started cleaning up demos + +2006 Sept 4 + Fixed concave collision bug (caused instability/missing collisions in meshes/compounds) + Fixed memoryleak in OptimizedBvh, added RayTestSingle to CollisionWorld + Prepared for VehicleDemo + Increased Performance (island generation for sleeping objects took too much time) + Better COLLADA 1.4.1 physics conformance in ColladaDemo + +2006 August 11 + Added Quake BspDemo + Improved CCD for compound and non-convex objects + +2006 August 10 + Added per-triangle material (friction/restitution) support for non-convex meshes. See ConcaveDemo for usage. + +2006 August 9 + Added CMake support (see http://cmake.org) + This can autogenerate makefiles, projectfiles cross platform (including MacOS X Xcode ) + Just run cmake . in the root folder and it will autogenerate build files + +2006 July 26 Erwin Coumans + Upgraded to COLLADA-DOM 1.4.1, latest SVN version + ColladaDemo can export snapshots to .dae + +2006 July 24 Erwin Coumans + Added Compound CollisionShape support + (this is still low performance -> requires stackless tree-versus-tree traversal for better performance) + +2006 July 15 Erwin Coumans + Added initial support for Parallel execution (collision detection, constraint solving) + See ParallelPhysicsEnvironment in Extras\PhysicsInterface\CcdPhysics + +2006 July 10 Erwin Coumans + Added MacOS X support (some build issues mainly) + +2006 July 5 Erwin Coumans + Improved COLLADA 1.4 physics import, both COLLADA-DOM and FCollada + +2006 June 29 Erwin Coumans + Refactoring of the broadphase + Moved some optional files to Extras: Algebraic ccd and EPA, quickstep + Moved the limits on bodies/overlap to 32k and 65k + +2006 June 25 Erwin Coumans + Added basic Collision Filtering, during broadphase + Allow adding meshes to the TriangleIndexVertexArray, + (input for TriangleMeshShape) + Preparation for CompoundShape + +2006 June 19 Erwin Coumans + Added support for COLLADA Physics Import. + Both jam and Visual Studio can compile ColladaDemo + +2006 June 18 Dirk Gregorius + Started implementing Generic6DOF joint and setup basic interface + + +2006 June 17 Frank Richter + Bumped version in configure.ac to 1.5.6 (assuming that "1.5f" is + the next version released). + Updated files in mk/autoconf and mk/jam with copies from CS; fixes a + GLU detection issue on MinGW. + Set msvc/bullet_ico.ico as the default application icon. + Disabled exceptions for gcc builds. + Applied a patch from Michael D. Adams to fix a warning with gcc. +2006 jUNE 16 Erwin Coumans + Constraints now merge simulation islands. + +2006 May 24 + Improved GJK accuracy, fixed GjkConvexCast issue, thanks to ~MyXa~ for reporting + +2006 May 19 + Added restitution support + Moved out Friction and Dynamics info from ManifoldPoint (removed logical dependency) + Added a void* m_userPersistentData in ManifoldPoint. + Added a ContactDestroyedCallback, to allow user to handle destruction of m_userPersistentData + +2006 May 13 + Fixed some bugs in friction / jacobian calculations. Reported by Dirk Gregorius. Thanks! + +2006 May 9 + Fixed raycasting filtering + Moved repository to SVN at https://svn.sourceforge.net/svnroot/bullet + +2006 April 27 + Moved raycasting to CollisionWorld, to make it more generic + Added basic CCD option in the CcdCollisionDemo + Fixed 'noResponse' mode, for triggering rigidbodies (useful for Artificial Intelligence queries) + Improved Bullet/ODE sample (in Extras) + +2006 April 10 + Separating Axis Test (SAT) convex hull collision detector, contribution by Simon Hobbs + Added SIMD SSE Math classes (for above SAT) + Added Mouse picking in CcdPhysicsDemo + Improved penetration depth estimation in MinkowskiPenetrationDepthSolver, both accuracy and performance + Added Hinge constraint + Added quickprof profiling (see http://sourceforge.net/projects/quickprof ) + +2006 March 21 Frank Richter + Removed VC manifest files. + Removed superfluous "grpplugins" projects. + +2006 March 20 Erwin Coumans + Clamped the acculumated impulse rather then intermediate impulse (within the iteration) + Use the persistent contacts for reusing the impulse + Separated friction and normal solving for better stability + Decreased the default number of iterations of the constraint solver from 10 to 4 + +2006 March 19 Frank Richter + Removed a couple of CSisms from the VC projects. + Fixed VC include & lib paths to go to the Addtional* options + instead the command line arguments. + Added pkgconfig support. + +2006 March 14 Frank Richter + Added support for shipped GLUT on MinGW. + Fixed GLUT support on MinGW. + +2006 March 13 Frank Richter + Bolted on Jam-based build system. + Generated VC project files. + Fixed GCC warnings. + Fixed Linux build issues. + +2006 March 13 +Added 3D Sweep and Prune Broadphase Collision Detection, Contribution from Simon Hobbs. + +2006 March 2 + Minor change in license to ZLib/LibPNG + This makes it legally a bit easier to deploy on Playstation 3 + Prepared for more generic constraints, added ConstraintsDemo + +2006 Feb 23 + Rearranged files and dependencies to allow for easier standalone Collision Detection without Bullet Dynamics. + See Demos/CollisionInterfaceDemo and Extras/ode/ode/test/test_BulletGjk.cpp for examples how to use. + +2005 August 6 + Bullet 0.2 release with demos, sources, doxygen, draft manual + +2005 June 1 + First public release of Bullet + + +... todo: add history + +2003 Initial version (continuous collision detection) diff --git a/src/bullet/Demos/OpenGL/.deps/BMF_Api.Po b/src/bullet/Demos/OpenGL/.deps/BMF_Api.Po new file mode 100644 index 000000000..df9dacff0 --- /dev/null +++ b/src/bullet/Demos/OpenGL/.deps/BMF_Api.Po @@ -0,0 +1,12 @@ +BMF_Api.o BMF_Api.o: BMF_Api.cpp BMF_Api.h BMF_Fonts.h BMF_Settings.h \ + BMF_BitmapFont.h BMF_FontData.h + +BMF_Api.h: + +BMF_Fonts.h: + +BMF_Settings.h: + +BMF_BitmapFont.h: + +BMF_FontData.h: diff --git a/src/bullet/Demos/OpenGL/.deps/BMF_BitmapFont.Po b/src/bullet/Demos/OpenGL/.deps/BMF_BitmapFont.Po new file mode 100644 index 000000000..7ddba0627 --- /dev/null +++ b/src/bullet/Demos/OpenGL/.deps/BMF_BitmapFont.Po @@ -0,0 +1,31 @@ +BMF_BitmapFont.o BMF_BitmapFont.o: BMF_BitmapFont.cpp \ + /usr/include/string.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/xlocale.h /usr/include/GL/gl.h /usr/include/GL/glext.h \ + BMF_BitmapFont.h BMF_FontData.h + +/usr/include/string.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/GL/gl.h: + +/usr/include/GL/glext.h: + +BMF_BitmapFont.h: + +BMF_FontData.h: diff --git a/src/bullet/Demos/OpenGL/.deps/BMF_font_helv10.Po b/src/bullet/Demos/OpenGL/.deps/BMF_font_helv10.Po new file mode 100644 index 000000000..370141a71 --- /dev/null +++ b/src/bullet/Demos/OpenGL/.deps/BMF_font_helv10.Po @@ -0,0 +1,6 @@ +BMF_font_helv10.o BMF_font_helv10.o: BMF_font_helv10.cpp BMF_FontData.h \ + BMF_Settings.h + +BMF_FontData.h: + +BMF_Settings.h: diff --git a/src/bullet/Demos/OpenGL/.deps/DemoApplication.Po b/src/bullet/Demos/OpenGL/.deps/DemoApplication.Po new file mode 100644 index 000000000..40c95c3c5 --- /dev/null +++ b/src/bullet/Demos/OpenGL/.deps/DemoApplication.Po @@ -0,0 +1,359 @@ +DemoApplication.o DemoApplication.o: DemoApplication.cpp \ + DemoApplication.h /usr/include/GL/glut.h /usr/include/GL/freeglut_std.h \ + /usr/include/GL/gl.h /usr/include/GL/glext.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/GL/glu.h /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/endian.h /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + ../../src/LinearMath/btVector3.h ../../src/LinearMath/btQuadWord.h \ + ../../src/LinearMath/btScalar.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h ../../src/LinearMath/btMinMax.h \ + ../../src/LinearMath/btMatrix3x3.h ../../src/LinearMath/btVector3.h \ + ../../src/LinearMath/btQuaternion.h ../../src/LinearMath/btTransform.h \ + ../../src/LinearMath/btMatrix3x3.h ../../src/LinearMath/btQuickprof.h \ + /usr/include/sys/time.h ../../src/LinearMath/btIDebugDraw.h \ + ../../src/BulletDynamics/Dynamics/btDynamicsWorld.h \ + ../../src/BulletCollision/CollisionDispatch/btCollisionWorld.h \ + ../../src/LinearMath/btVector3.h ../../src/LinearMath/btTransform.h \ + ../../src/BulletCollision/CollisionDispatch/btCollisionObject.h \ + ../../src/LinearMath/btMotionState.h ../../src/LinearMath/btTransform.h \ + ../../src/LinearMath/btAlignedAllocator.h \ + ../../src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + ../../src/BulletCollision/BroadphaseCollision/btDispatcher.h \ + ../../src/LinearMath/btScalar.h \ + ../../src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + ../../src/LinearMath/btVector3.h ../../src/LinearMath/btTransform.h \ + ../../src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + ../../src/LinearMath/btTransformUtil.h \ + ../../src/LinearMath/btAlignedAllocator.h \ + ../../src/BulletCollision/CollisionDispatch/btManifoldResult.h \ + ../../src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + ../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + ../../src/LinearMath/btAlignedAllocator.h \ + ../../src/LinearMath/btAlignedObjectArray.h \ + ../../src/LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + ../../src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + ../../src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + ../../src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + ../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + ../../src/LinearMath/btVector3.h ../../src/LinearMath/btPoint3.h \ + ../../src/LinearMath/btAlignedObjectArray.h \ + ../../src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \ + ../../src/LinearMath/btVector3.h \ + ../../src/BulletDynamics/ConstraintSolver/btJacobianEntry.h \ + ../../src/BulletDynamics/Dynamics/btRigidBody.h \ + ../../src/LinearMath/btAlignedObjectArray.h \ + ../../src/LinearMath/btPoint3.h ../../src/LinearMath/btTransform.h \ + ../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + ../../src/BulletCollision/CollisionDispatch/btCollisionObject.h \ + ../../src/BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + ../../src/LinearMath/btScalar.h \ + ../../src/BulletCollision/CollisionShapes/btCollisionShape.h \ + ../../src/LinearMath/btTransform.h ../../src/LinearMath/btVector3.h \ + ../../src/LinearMath/btMatrix3x3.h ../../src/LinearMath/btPoint3.h \ + ../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + ../../src/BulletCollision/CollisionShapes/btBoxShape.h \ + ../../src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + ../../src/BulletCollision/CollisionShapes/btConvexInternalShape.h \ + ../../src/BulletCollision/CollisionShapes/btConvexShape.h \ + ../../src/BulletCollision/CollisionShapes/btCollisionShape.h \ + ../../src/BulletCollision/CollisionShapes/btCollisionMargin.h \ + ../../src/LinearMath/btAlignedAllocator.h \ + ../../src/LinearMath/btMinMax.h \ + ../../src/BulletCollision/CollisionShapes/btSphereShape.h \ + ../../src/BulletCollision/CollisionShapes/btCompoundShape.h \ + ../../src/LinearMath/btAlignedObjectArray.h \ + ../../src/BulletCollision/CollisionShapes/btUniformScalingShape.h \ + GL_ShapeDrawer.h ../../src/LinearMath/btDefaultMotionState.h BMF_Api.h \ + BMF_Fonts.h BMF_Settings.h + +DemoApplication.h: + +/usr/include/GL/glut.h: + +/usr/include/GL/freeglut_std.h: + +/usr/include/GL/gl.h: + +/usr/include/GL/glext.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/GL/glu.h: + +/usr/include/stdlib.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: + +/usr/include/math.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btQuadWord.h: + +../../src/LinearMath/btScalar.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +../../src/LinearMath/btMinMax.h: + +../../src/LinearMath/btMatrix3x3.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btQuaternion.h: + +../../src/LinearMath/btTransform.h: + +../../src/LinearMath/btMatrix3x3.h: + +../../src/LinearMath/btQuickprof.h: + +/usr/include/sys/time.h: + +../../src/LinearMath/btIDebugDraw.h: + +../../src/BulletDynamics/Dynamics/btDynamicsWorld.h: + +../../src/BulletCollision/CollisionDispatch/btCollisionWorld.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btTransform.h: + +../../src/BulletCollision/CollisionDispatch/btCollisionObject.h: + +../../src/LinearMath/btMotionState.h: + +../../src/LinearMath/btTransform.h: + +../../src/LinearMath/btAlignedAllocator.h: + +../../src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +../../src/BulletCollision/BroadphaseCollision/btDispatcher.h: + +../../src/LinearMath/btScalar.h: + +../../src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btTransform.h: + +../../src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +../../src/LinearMath/btTransformUtil.h: + +../../src/LinearMath/btAlignedAllocator.h: + +../../src/BulletCollision/CollisionDispatch/btManifoldResult.h: + +../../src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +../../src/LinearMath/btAlignedAllocator.h: + +../../src/LinearMath/btAlignedObjectArray.h: + +../../src/LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +../../src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +../../src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +../../src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btPoint3.h: + +../../src/LinearMath/btAlignedObjectArray.h: + +../../src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h: + +../../src/LinearMath/btVector3.h: + +../../src/BulletDynamics/ConstraintSolver/btJacobianEntry.h: + +../../src/BulletDynamics/Dynamics/btRigidBody.h: + +../../src/LinearMath/btAlignedObjectArray.h: + +../../src/LinearMath/btPoint3.h: + +../../src/LinearMath/btTransform.h: + +../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +../../src/BulletCollision/CollisionDispatch/btCollisionObject.h: + +../../src/BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +../../src/LinearMath/btScalar.h: + +../../src/BulletCollision/CollisionShapes/btCollisionShape.h: + +../../src/LinearMath/btTransform.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btMatrix3x3.h: + +../../src/LinearMath/btPoint3.h: + +../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +../../src/BulletCollision/CollisionShapes/btBoxShape.h: + +../../src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +../../src/BulletCollision/CollisionShapes/btConvexInternalShape.h: + +../../src/BulletCollision/CollisionShapes/btConvexShape.h: + +../../src/BulletCollision/CollisionShapes/btCollisionShape.h: + +../../src/BulletCollision/CollisionShapes/btCollisionMargin.h: + +../../src/LinearMath/btAlignedAllocator.h: + +../../src/LinearMath/btMinMax.h: + +../../src/BulletCollision/CollisionShapes/btSphereShape.h: + +../../src/BulletCollision/CollisionShapes/btCompoundShape.h: + +../../src/LinearMath/btAlignedObjectArray.h: + +../../src/BulletCollision/CollisionShapes/btUniformScalingShape.h: + +GL_ShapeDrawer.h: + +../../src/LinearMath/btDefaultMotionState.h: + +BMF_Api.h: + +BMF_Fonts.h: + +BMF_Settings.h: diff --git a/src/bullet/Demos/OpenGL/.deps/GLDebugDrawer.Po b/src/bullet/Demos/OpenGL/.deps/GLDebugDrawer.Po new file mode 100644 index 000000000..c13f3e46b --- /dev/null +++ b/src/bullet/Demos/OpenGL/.deps/GLDebugDrawer.Po @@ -0,0 +1,165 @@ +GLDebugDrawer.o GLDebugDrawer.o: GLDebugDrawer.cpp GLDebugDrawer.h \ + ../../src/LinearMath/btIDebugDraw.h ../../src/LinearMath/btVector3.h \ + ../../src/LinearMath/btQuadWord.h ../../src/LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h ../../src/LinearMath/btMinMax.h \ + ../../src/LinearMath/btPoint3.h /usr/include/GL/glut.h \ + /usr/include/GL/freeglut_std.h /usr/include/GL/gl.h \ + /usr/include/GL/glext.h /usr/include/GL/glu.h BMF_Api.h BMF_Fonts.h \ + BMF_Settings.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h + +GLDebugDrawer.h: + +../../src/LinearMath/btIDebugDraw.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btQuadWord.h: + +../../src/LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +../../src/LinearMath/btMinMax.h: + +../../src/LinearMath/btPoint3.h: + +/usr/include/GL/glut.h: + +/usr/include/GL/freeglut_std.h: + +/usr/include/GL/gl.h: + +/usr/include/GL/glext.h: + +/usr/include/GL/glu.h: + +BMF_Api.h: + +BMF_Fonts.h: + +BMF_Settings.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: diff --git a/src/bullet/Demos/OpenGL/.deps/GL_ShapeDrawer.Po b/src/bullet/Demos/OpenGL/.deps/GL_ShapeDrawer.Po new file mode 100644 index 000000000..7c5e043a3 --- /dev/null +++ b/src/bullet/Demos/OpenGL/.deps/GL_ShapeDrawer.Po @@ -0,0 +1,269 @@ +GL_ShapeDrawer.o GL_ShapeDrawer.o: GL_ShapeDrawer.cpp \ + /usr/include/GL/glut.h /usr/include/GL/freeglut_std.h \ + /usr/include/GL/gl.h /usr/include/GL/glext.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/GL/glu.h GlutStuff.h GL_ShapeDrawer.h \ + ../../src/LinearMath/btVector3.h ../../src/LinearMath/btQuadWord.h \ + ../../src/LinearMath/btScalar.h /usr/include/math.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/endian.h /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h ../../src/LinearMath/btMinMax.h \ + ../../src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + ../../src/LinearMath/btPoint3.h ../../src/LinearMath/btVector3.h \ + ../../src/LinearMath/btMatrix3x3.h ../../src/LinearMath/btQuaternion.h \ + ../../src/BulletCollision/CollisionShapes/btConvexInternalShape.h \ + ../../src/BulletCollision/CollisionShapes/btConvexShape.h \ + ../../src/BulletCollision/CollisionShapes/btCollisionShape.h \ + ../../src/LinearMath/btTransform.h ../../src/LinearMath/btMatrix3x3.h \ + ../../src/LinearMath/btVector3.h \ + ../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + ../../src/LinearMath/btScalar.h \ + ../../src/LinearMath/btAlignedAllocator.h \ + ../../src/BulletCollision/CollisionShapes/btCollisionMargin.h \ + ../../src/LinearMath/btAlignedAllocator.h \ + ../../src/BulletCollision/CollisionShapes/btTriangleMeshShape.h \ + ../../src/BulletCollision/CollisionShapes/btConcaveShape.h \ + ../../src/BulletCollision/CollisionShapes/btTriangleCallback.h \ + ../../src/BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + ../../src/BulletCollision/CollisionShapes/btBoxShape.h \ + ../../src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + ../../src/LinearMath/btMinMax.h \ + ../../src/BulletCollision/CollisionShapes/btSphereShape.h \ + ../../src/BulletCollision/CollisionShapes/btConeShape.h \ + ../../src/BulletCollision/CollisionShapes/btCylinderShape.h \ + ../../src/BulletCollision/CollisionShapes/btBoxShape.h \ + ../../src/BulletCollision/CollisionShapes/btTetrahedronShape.h \ + ../../src/BulletCollision/CollisionShapes/btCompoundShape.h \ + ../../src/LinearMath/btAlignedObjectArray.h \ + ../../src/LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + ../../src/BulletCollision/CollisionShapes/btCapsuleShape.h \ + ../../src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \ + ../../src/BulletCollision/CollisionShapes/btUniformScalingShape.h \ + ../../src/LinearMath/btIDebugDraw.h BMF_Api.h BMF_Fonts.h \ + BMF_Settings.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h + +/usr/include/GL/glut.h: + +/usr/include/GL/freeglut_std.h: + +/usr/include/GL/gl.h: + +/usr/include/GL/glext.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/GL/glu.h: + +GlutStuff.h: + +GL_ShapeDrawer.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btQuadWord.h: + +../../src/LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +../../src/LinearMath/btMinMax.h: + +../../src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +../../src/LinearMath/btPoint3.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btMatrix3x3.h: + +../../src/LinearMath/btQuaternion.h: + +../../src/BulletCollision/CollisionShapes/btConvexInternalShape.h: + +../../src/BulletCollision/CollisionShapes/btConvexShape.h: + +../../src/BulletCollision/CollisionShapes/btCollisionShape.h: + +../../src/LinearMath/btTransform.h: + +../../src/LinearMath/btMatrix3x3.h: + +../../src/LinearMath/btVector3.h: + +../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +../../src/LinearMath/btScalar.h: + +../../src/LinearMath/btAlignedAllocator.h: + +../../src/BulletCollision/CollisionShapes/btCollisionMargin.h: + +../../src/LinearMath/btAlignedAllocator.h: + +../../src/BulletCollision/CollisionShapes/btTriangleMeshShape.h: + +../../src/BulletCollision/CollisionShapes/btConcaveShape.h: + +../../src/BulletCollision/CollisionShapes/btTriangleCallback.h: + +../../src/BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +../../src/BulletCollision/CollisionShapes/btBoxShape.h: + +../../src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +../../src/LinearMath/btMinMax.h: + +../../src/BulletCollision/CollisionShapes/btSphereShape.h: + +../../src/BulletCollision/CollisionShapes/btConeShape.h: + +../../src/BulletCollision/CollisionShapes/btCylinderShape.h: + +../../src/BulletCollision/CollisionShapes/btBoxShape.h: + +../../src/BulletCollision/CollisionShapes/btTetrahedronShape.h: + +../../src/BulletCollision/CollisionShapes/btCompoundShape.h: + +../../src/LinearMath/btAlignedObjectArray.h: + +../../src/LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +../../src/BulletCollision/CollisionShapes/btCapsuleShape.h: + +../../src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h: + +../../src/BulletCollision/CollisionShapes/btUniformScalingShape.h: + +../../src/LinearMath/btIDebugDraw.h: + +BMF_Api.h: + +BMF_Fonts.h: + +BMF_Settings.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: diff --git a/src/bullet/Demos/OpenGL/.deps/GL_Simplex1to4.Po b/src/bullet/Demos/OpenGL/.deps/GL_Simplex1to4.Po new file mode 100644 index 000000000..2addfd736 --- /dev/null +++ b/src/bullet/Demos/OpenGL/.deps/GL_Simplex1to4.Po @@ -0,0 +1,189 @@ +GL_Simplex1to4.o GL_Simplex1to4.o: GL_Simplex1to4.cpp GL_Simplex1to4.h \ + ../../src/BulletCollision/CollisionShapes/btTetrahedronShape.h \ + ../../src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + ../../src/LinearMath/btPoint3.h ../../src/LinearMath/btVector3.h \ + ../../src/LinearMath/btQuadWord.h ../../src/LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h ../../src/LinearMath/btMinMax.h \ + ../../src/LinearMath/btMatrix3x3.h ../../src/LinearMath/btQuaternion.h \ + ../../src/BulletCollision/CollisionShapes/btConvexInternalShape.h \ + ../../src/BulletCollision/CollisionShapes/btConvexShape.h \ + ../../src/BulletCollision/CollisionShapes/btCollisionShape.h \ + ../../src/LinearMath/btTransform.h ../../src/LinearMath/btMatrix3x3.h \ + ../../src/LinearMath/btVector3.h \ + ../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + ../../src/LinearMath/btScalar.h \ + ../../src/LinearMath/btAlignedAllocator.h \ + ../../src/BulletCollision/CollisionShapes/btCollisionMargin.h \ + ../../src/LinearMath/btAlignedAllocator.h \ + ../../src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + ../../src/LinearMath/btVector3.h ../../src/LinearMath/btPoint3.h \ + ../../src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + ../../src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + GL_ShapeDrawer.h ../../src/LinearMath/btVector3.h /usr/include/GL/gl.h \ + /usr/include/GL/glext.h GlutStuff.h ../../src/LinearMath/btTransform.h + +GL_Simplex1to4.h: + +../../src/BulletCollision/CollisionShapes/btTetrahedronShape.h: + +../../src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +../../src/LinearMath/btPoint3.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btQuadWord.h: + +../../src/LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +../../src/LinearMath/btMinMax.h: + +../../src/LinearMath/btMatrix3x3.h: + +../../src/LinearMath/btQuaternion.h: + +../../src/BulletCollision/CollisionShapes/btConvexInternalShape.h: + +../../src/BulletCollision/CollisionShapes/btConvexShape.h: + +../../src/BulletCollision/CollisionShapes/btCollisionShape.h: + +../../src/LinearMath/btTransform.h: + +../../src/LinearMath/btMatrix3x3.h: + +../../src/LinearMath/btVector3.h: + +../../src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +../../src/LinearMath/btScalar.h: + +../../src/LinearMath/btAlignedAllocator.h: + +../../src/BulletCollision/CollisionShapes/btCollisionMargin.h: + +../../src/LinearMath/btAlignedAllocator.h: + +../../src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btPoint3.h: + +../../src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +../../src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +GL_ShapeDrawer.h: + +../../src/LinearMath/btVector3.h: + +/usr/include/GL/gl.h: + +/usr/include/GL/glext.h: + +GlutStuff.h: + +../../src/LinearMath/btTransform.h: diff --git a/src/bullet/Demos/OpenGL/.deps/GlutStuff.Po b/src/bullet/Demos/OpenGL/.deps/GlutStuff.Po new file mode 100644 index 000000000..d5577da1b --- /dev/null +++ b/src/bullet/Demos/OpenGL/.deps/GlutStuff.Po @@ -0,0 +1,172 @@ +GlutStuff.o GlutStuff.o: GlutStuff.cpp DemoApplication.h \ + /usr/include/GL/glut.h /usr/include/GL/freeglut_std.h \ + /usr/include/GL/gl.h /usr/include/GL/glext.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/GL/glu.h /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/endian.h /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + ../../src/LinearMath/btVector3.h ../../src/LinearMath/btQuadWord.h \ + ../../src/LinearMath/btScalar.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h ../../src/LinearMath/btMinMax.h \ + ../../src/LinearMath/btMatrix3x3.h ../../src/LinearMath/btVector3.h \ + ../../src/LinearMath/btQuaternion.h ../../src/LinearMath/btTransform.h \ + ../../src/LinearMath/btMatrix3x3.h ../../src/LinearMath/btQuickprof.h \ + /usr/include/sys/time.h GlutStuff.h + +DemoApplication.h: + +/usr/include/GL/glut.h: + +/usr/include/GL/freeglut_std.h: + +/usr/include/GL/gl.h: + +/usr/include/GL/glext.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/GL/glu.h: + +/usr/include/stdlib.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: + +/usr/include/math.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btQuadWord.h: + +../../src/LinearMath/btScalar.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +../../src/LinearMath/btMinMax.h: + +../../src/LinearMath/btMatrix3x3.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btQuaternion.h: + +../../src/LinearMath/btTransform.h: + +../../src/LinearMath/btMatrix3x3.h: + +../../src/LinearMath/btQuickprof.h: + +/usr/include/sys/time.h: + +GlutStuff.h: diff --git a/src/bullet/Demos/OpenGL/.deps/RenderTexture.Po b/src/bullet/Demos/OpenGL/.deps/RenderTexture.Po new file mode 100644 index 000000000..53162d384 --- /dev/null +++ b/src/bullet/Demos/OpenGL/.deps/RenderTexture.Po @@ -0,0 +1,123 @@ +RenderTexture.o RenderTexture.o: RenderTexture.cpp RenderTexture.h \ + ../../src/LinearMath/btVector3.h ../../src/LinearMath/btQuadWord.h \ + ../../src/LinearMath/btScalar.h /usr/include/math.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h ../../src/LinearMath/btMinMax.h BMF_FontData.h \ + /usr/include/memory.h /usr/include/string.h + +RenderTexture.h: + +../../src/LinearMath/btVector3.h: + +../../src/LinearMath/btQuadWord.h: + +../../src/LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +../../src/LinearMath/btMinMax.h: + +BMF_FontData.h: + +/usr/include/memory.h: + +/usr/include/string.h: diff --git a/src/bullet/Demos/OpenGL/BMF_Api.cpp b/src/bullet/Demos/OpenGL/BMF_Api.cpp new file mode 100644 index 000000000..3c6bf45cc --- /dev/null +++ b/src/bullet/Demos/OpenGL/BMF_Api.cpp @@ -0,0 +1,162 @@ +/** + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU bteral Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU bteral Public License for more details. + * + * You should have received a copy of the GNU bteral Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +/** + + * Copyright (C) 2001 NaN Technologies B.V. + * + * Implementation of the API of the OpenGL bitmap font library. + */ + +#include "BMF_Api.h" + +#include "BMF_BitmapFont.h" + + +#if BMF_INCLUDE_HELV10 +extern BMF_FontData BMF_font_helv10; +static BMF_BitmapFont bmfHelv10(&BMF_font_helv10); +#endif // BMF_INCLUDE_HELV10 +#if BMF_INCLUDE_HELV12 +extern BMF_FontData BMF_font_helv12; +static BMF_BitmapFont bmfHelv12(&BMF_font_helv12); +#endif // BMF_INCLUDE_HELV12 +#if BMF_INCLUDE_HELVB8 +extern BMF_FontData BMF_font_helvb8; +static BMF_BitmapFont bmfHelvb8(&BMF_font_helvb8); +#endif // BMF_INCLUDE_HELVB8 +#if BMF_INCLUDE_HELVB10 +extern BMF_FontData BMF_font_helvb10; +static BMF_BitmapFont bmfHelvb10(&BMF_font_helvb10); +#endif // BMF_INCLUDE_HELVB10 +#if BMF_INCLUDE_HELVB12 +extern BMF_FontData BMF_font_helvb12; +static BMF_BitmapFont bmfHelvb12(&BMF_font_helvb12); +#endif // BMF_INCLUDE_HELVB12 +#if BMF_INCLUDE_HELVB14 +extern BMF_FontData BMF_font_helvb14; +static BMF_BitmapFont bmfHelvb14(&BMF_font_helvb14); +#endif // BMF_INCLUDE_HELVB14 +#if BMF_INCLUDE_SCR12 +extern BMF_FontData BMF_font_scr12; +static BMF_BitmapFont bmfScreen12(&BMF_font_scr12); +#endif // BMF_INCLUDE_SCR12 +#if BMF_INCLUDE_SCR14 +extern BMF_FontData BMF_font_scr14; +static BMF_BitmapFont bmfScreen14(&BMF_font_scr14); +#endif // BMF_INCLUDE_SCR14 +#if BMF_INCLUDE_SCR15 +extern BMF_FontData BMF_font_scr15; +static BMF_BitmapFont bmfScreen15(&BMF_font_scr15); +#endif // BMF_INCLUDE_SCR15 + + +BMF_Font* BMF_GetFont(BMF_FontType font) +{ + switch (font) + { +#if BMF_INCLUDE_HELV10 + case BMF_kHelvetica10: return (BMF_Font*) &bmfHelv10; +#endif // BMF_INCLUDE_HELV10 +#if BMF_INCLUDE_HELV12 + case BMF_kHelvetica12: return (BMF_Font*) &bmfHelv12; +#endif // BMF_INCLUDE_HELV12 +#if BMF_INCLUDE_HELVB8 + case BMF_kHelveticaBold8: return (BMF_Font*) &bmfHelvb8; +#endif // BMF_INCLUDE_HELVB8 +#if BMF_INCLUDE_HELVB10 + case BMF_kHelveticaBold10: return (BMF_Font*) &bmfHelvb10; +#endif // BMF_INCLUDE_HELVB10 +#if BMF_INCLUDE_HELVB12 + case BMF_kHelveticaBold12: return (BMF_Font*) &bmfHelvb12; +#endif // BMF_INCLUDE_HELVB12 +#if BMF_INCLUDE_HELVB14 + case BMF_kHelveticaBold14: return (BMF_Font*) &bmfHelvb14; +#endif // BMF_INCLUDE_HELVB12 +#if BMF_INCLUDE_SCR12 + case BMF_kScreen12: return (BMF_Font*) &bmfScreen12; +#endif // BMF_INCLUDE_SCR12 +#if BMF_INCLUDE_SCR14 + case BMF_kScreen14: return (BMF_Font*) &bmfScreen14; +#endif // BMF_INCLUDE_SCR14 +#if BMF_INCLUDE_SCR15 + case BMF_kScreen15: return (BMF_Font*) &bmfScreen15; +#endif // BMF_INCLUDE_SCR15 + default: + break; + } + return 0; +} + + +int BMF_DrawCharacter(BMF_Font* font, char c) +{ + char str[2] = {c, '\0'}; + return BMF_DrawString(font, str); +} + + +int BMF_DrawString(BMF_Font* font, const char* str) +{ + if (!font) return 0; + ((BMF_BitmapFont*)font)->drawString(str); + return 1; +} + + +int BMF_GetCharacterWidth(BMF_Font* font, char c) +{ + char str[2] = {c, '\0'}; + return BMF_GetStringWidth(font, str); +} + + +int BMF_GetStringWidth(BMF_Font* font, char* str) +{ + if (!font) return 0; + return ((BMF_BitmapFont*)font)->getStringWidth(str); +} + + +void BMF_GetBoundingBox(BMF_Font* font, int *xmin_r, int *ymin_r, int *xmax_r, int *ymax_r) +{ + if (!font) return; + ((BMF_BitmapFont*)font)->getBoundingBox(*xmin_r, *ymin_r, *xmax_r, *ymax_r); +} + +int BMF_GetFontTexture(BMF_Font* font) { + if (!font) return -1; + return ((BMF_BitmapFont*)font)->getTexture(); +} + +void BMF_DrawStringTexture(BMF_Font* font, char *string, float x, float y, float z) { + if (!font) return; + ((BMF_BitmapFont*)font)->drawStringTexture(string, x, y, z); +} diff --git a/src/bullet/Demos/OpenGL/BMF_Api.h b/src/bullet/Demos/OpenGL/BMF_Api.h new file mode 100644 index 000000000..2bb3a7abf --- /dev/null +++ b/src/bullet/Demos/OpenGL/BMF_Api.h @@ -0,0 +1,128 @@ +/** + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU bteral Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU bteral Public License for more details. + * + * You should have received a copy of the GNU bteral Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +/** + + * Copyright (C) 2001 NaN Technologies B.V. + * + * API of the OpenGL bitmap font library. + * Currently draws fonts using the glBitmap routine. + * This implies that drawing speed is heavyly dependant on + * the 2D capabilities of the graphics card. + */ + +#ifndef __BMF_API_H +#define __BMF_API_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "BMF_Fonts.h" + +/** + * Returns the font for a given font type. + * @param font The font to retrieve. + * @return The font (or nil if not found). + */ +BMF_Font* BMF_GetFont(BMF_FontType font); + +/** + * Draws a character at the current raster position. + * @param font The font to use. + * @param c The character to draw. + * @return Indication of success (0 == error). + */ +int BMF_DrawCharacter(BMF_Font* font, char c); + +/** + * Draws a string at the current raster position. + * @param font The font to use. + * @param str The string to draw. + * @return Indication of success (0 == error). + */ +int BMF_DrawString(BMF_Font* font, const char* str); + +/** + * Returns the width of a character in pixels. + * @param font The font to use. + * @param c The character. + * @return The length. + */ +int BMF_GetCharacterWidth(BMF_Font* font, char c); + +/** + * Returns the width of a string of characters. + * @param font The font to use. + * @param str The string. + * @return The length. + */ +int BMF_GetStringWidth(BMF_Font* font, char* str); + +/** + * Returns the bounding box of the font. The width and + * height represent the bounding box of the union of + * all glyps. The minimum and maximum values of the + * box represent the extent of the font and its positioning + * about the origin. + */ +void BMF_GetBoundingBox(BMF_Font* font, int *xmin_r, int *ymin_r, int *xmax_r, int *ymax_r); + +/** + * Convert the given @a font to a texture, and return the GL texture + * ID of the texture. If the texture ID is bound, text can + * be drawn using the texture by calling drawStringTexture. + * + * @param font The font to create the texture from. + * @return The GL texture ID of the new texture, or -1 if unable + * to create. + */ +int BMF_GetFontTexture(BMF_Font* font); + +/** + * Draw the given @a str at the point @a x, @a y, @a z, using + * texture coordinates. This assumes that an appropriate texture + * has been bound, see BMF_BitmapFont::getTexture(). The string + * is drawn along the positive X axis. + * + * @param font The font to draw with. + * @param string The c-string to draw. + * @param x The x coordinate to start drawing at. + * @param y The y coordinate to start drawing at. + * @param z The z coordinate to start drawing at. + */ +void BMF_DrawStringTexture(BMF_Font* font, char* string, float x, float y, float z); + +#ifdef __cplusplus +} +#endif + +#endif /* __BMF_API_H */ + diff --git a/src/bullet/Demos/OpenGL/BMF_BitmapFont.cpp b/src/bullet/Demos/OpenGL/BMF_BitmapFont.cpp new file mode 100644 index 000000000..4098b214c --- /dev/null +++ b/src/bullet/Demos/OpenGL/BMF_BitmapFont.cpp @@ -0,0 +1,208 @@ +/** + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU bteral Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU bteral Public License for more details. + * + * You should have received a copy of the GNU bteral Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +/** + + * Copyright (C) 2001 NaN Technologies B.V. + */ + +#include + +#if defined(WIN32) || defined(__APPLE__) + #ifdef WIN32 + #if !defined(__CYGWIN32__) + #pragma warning(disable:4244) + #endif /* __CYGWIN32__ */ + #include + #include + #else // WIN32 + // __APPLE__ is defined + #include + #endif // WIN32 +#else // defined(WIN32) || defined(__APPLE__) + #include +#endif // defined(WIN32) || defined(__APPLE__) + +#include "BMF_BitmapFont.h" + + +BMF_BitmapFont::BMF_BitmapFont(BMF_FontData* fontData) +: m_fontData(fontData) +{ +} + + +BMF_BitmapFont::~BMF_BitmapFont(void) +{ +} + + +void BMF_BitmapFont::drawString(const char* str) +{ + if (!str) + return; + + GLint alignment; + unsigned char c; + + glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + while ((c = (unsigned char) *str++)) { + BMF_CharData & cd = m_fontData->chars[c]; + + if (cd.data_offset==-1) { + GLubyte nullBitmap = 0; + + glBitmap(1, 1, 0, 0, cd.advance, 0, &nullBitmap); + } else { + GLubyte *bitmap = &m_fontData->bitmap_data[cd.data_offset]; + + glBitmap(cd.width, cd.height, cd.xorig, cd.yorig, cd.advance, 0, bitmap); + } + } + + glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); +} + + +int BMF_BitmapFont::getStringWidth(char* str) +{ + unsigned char c; + int length = 0; + + while ((c = (unsigned char) *str++)) { + length += m_fontData->chars[c].advance; + } + + return length; +} + +void BMF_BitmapFont::getBoundingBox(int & xMin, int & yMin, int & xMax, int & yMax) +{ + xMin = m_fontData->xmin; + yMin = m_fontData->ymin; + xMax = m_fontData->xmax; + yMax = m_fontData->ymax; +} + +int BMF_BitmapFont::getTexture() +{ + int fWidth = m_fontData->xmax - m_fontData->xmin; + int fHeight = m_fontData->ymax - m_fontData->ymin; + + if (fWidth>=16 || fHeight>=16) { + return -1; + } + + int cRows = 16, cCols = 16; + int cWidth = 16, cHeight = 16; + int iWidth = cCols*cWidth; + int iHeight = cRows*cHeight; + GLubyte *img = new GLubyte [iHeight*iWidth]; + GLuint texId; + + int baseLine = -(m_fontData->ymin); + + memset(img, 0, iHeight*iWidth); + for (int i = 0; i<256; i++) { + BMF_CharData & cd = m_fontData->chars[i]; + + if (cd.data_offset != -1) { + int cellX = i%16; + int cellY = i/16; + + for (int y = 0; ybitmap_data[cd.data_offset + ((cd.width+7)/8)*y]; + + for (int x = 0; xymin); + + glBegin(GL_QUADS); + while ((c = (unsigned char) *str++)) { + BMF_CharData & cd = m_fontData->chars[c]; + + if (cd.data_offset != -1) { + float cellX = (c%16)/16.0; + float cellY = (c/16)/16.0; + + glTexCoord2f(cellX + 1.0/16.0, cellY); + glVertex3f(x + pos + 16.0, -baseLine + y + 0.0, z); + + glTexCoord2f(cellX + 1.0/16.0, cellY + 1.0/16.0); + glVertex3f(x + pos + 16.0, -baseLine + y + 16.0, z); + + glTexCoord2f(cellX, cellY + 1.0/16.0); + glVertex3f(x + pos + 0.0, -baseLine + y + 16.0, z); + + glTexCoord2f(cellX, cellY); + glVertex3f(x + pos + 0.0, -baseLine + y + 0.0, z); + } + + pos += cd.advance; + } + glEnd(); +} diff --git a/src/bullet/Demos/OpenGL/BMF_BitmapFont.h b/src/bullet/Demos/OpenGL/BMF_BitmapFont.h new file mode 100644 index 000000000..00354f4a3 --- /dev/null +++ b/src/bullet/Demos/OpenGL/BMF_BitmapFont.h @@ -0,0 +1,111 @@ +/** + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU bteral Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU bteral Public License for more details. + * + * You should have received a copy of the GNU bteral Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +/** + + * Copyright (C) 2001 NaN Technologies B.V. + */ + +#ifndef __BMF_BITMAP_FONT_H +#define __BMF_BITMAP_FONT_H + +#include "BMF_FontData.h" + +/** + * Base class for OpenGL bitmap fonts. + */ +class BMF_BitmapFont +{ +public: + /** + * Default constructor. + */ + BMF_BitmapFont(BMF_FontData* fontData); + + /** + * Destructor. + */ + virtual ~BMF_BitmapFont(void); + + /** + * Draws a string at the current raster position. + * @param str The string to draw. + */ + void drawString(const char* str); + + void drawStringMemory(char* str); + + + /** + * Draws a string at the current raster position. + * @param str The string to draw. + * @return The width of the string. + */ + int getStringWidth(char* str); + + /** + * Returns the bounding box of the font. The width and + * height represent the bounding box of the union of + * all glyps. The minimum and maximum values of the + * box represent the extent of the font and its positioning + * about the origin. + */ + void getBoundingBox(int & xMin, int & yMin, int & xMax, int & yMax); + + /** + * Convert the font to a texture, and return the GL texture + * ID of the texture. If the texture ID is bound, text can + * be drawn using the texture by calling drawStringTexture. + * + * @return The GL texture ID of the new texture, or -1 if unable + * to create. + */ + int getTexture(); + + /** + * Draw the given @a string at the point @a x, @a y, @a z, using + * texture coordinates. This assumes that an appropriate texture + * has been bound, see BMF_BitmapFont::getTexture(). The string + * is drawn along the positive X axis. + * + * @param string The c-string to draw. + * @param x The x coordinate to start drawing at. + * @param y The y coordinate to start drawing at. + * @param z The z coordinate to start drawing at. + */ + void drawStringTexture(char* string, float x, float y, float z); + +protected: + /** Pointer to the font data. */ + BMF_FontData* m_fontData; +}; + +#endif // __BMF_BITMAP_FONT_H + diff --git a/src/bullet/Demos/OpenGL/BMF_FontData.h b/src/bullet/Demos/OpenGL/BMF_FontData.h new file mode 100644 index 000000000..c3bdd8081 --- /dev/null +++ b/src/bullet/Demos/OpenGL/BMF_FontData.h @@ -0,0 +1,56 @@ +/** + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU bteral Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU bteral Public License for more details. + * + * You should have received a copy of the GNU bteral Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +/** + + * Copyright (C) 2001 NaN Technologies B.V. + */ + +#ifndef __BMF_FONTDATA_H__ +#define __BMF_FONTDATA_H__ + +typedef struct { + signed char width, height; + signed char xorig, yorig; + signed char advance; + + short data_offset; +} BMF_CharData; + +typedef struct { + int xmin, ymin; + int xmax, ymax; + + BMF_CharData chars[256]; + unsigned char* bitmap_data; +} BMF_FontData; + +#endif + diff --git a/src/bullet/Demos/OpenGL/BMF_Fonts.h b/src/bullet/Demos/OpenGL/BMF_Fonts.h new file mode 100644 index 000000000..96bc96100 --- /dev/null +++ b/src/bullet/Demos/OpenGL/BMF_Fonts.h @@ -0,0 +1,75 @@ +/** + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU bteral Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU bteral Public License for more details. + * + * You should have received a copy of the GNU bteral Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +/** + + * Copyright (C) 2001 NaN Technologies B.V. + * Defines the names of the fonts in the library. + */ + +#ifndef __BMF_FONTS_H +#define __BMF_FONTS_H + +#include "BMF_Settings.h" + +typedef enum +{ + BMF_kHelvetica10 = 0, +#if BMF_INCLUDE_HELV12 + BMF_kHelvetica12, +#endif +#if BMF_INCLUDE_HELVB8 + BMF_kHelveticaBold8, +#endif +#if BMF_INCLUDE_HELVB10 + BMF_kHelveticaBold10, +#endif +#if BMF_INCLUDE_HELVB12 + BMF_kHelveticaBold12, +#endif +#if BMF_INCLUDE_HELVB14 + BMF_kHelveticaBold14, +#endif +#if BMF_INCLUDE_SCR12 + BMF_kScreen12, +#endif +#if BMF_INCLUDE_SCR14 + BMF_kScreen14, +#endif +#if BMF_INCLUDE_SCR15 + BMF_kScreen15, +#endif + BMF_kNumFonts +} BMF_FontType; + +typedef struct BMF_Font BMF_Font; + +#endif /* __BMF_FONTS_H */ + diff --git a/src/bullet/Demos/OpenGL/BMF_Settings.h b/src/bullet/Demos/OpenGL/BMF_Settings.h new file mode 100644 index 000000000..90a073401 --- /dev/null +++ b/src/bullet/Demos/OpenGL/BMF_Settings.h @@ -0,0 +1,52 @@ +/** + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU bteral Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU bteral Public License for more details. + * + * You should have received a copy of the GNU bteral Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +/** + + * Copyright (C) 2001 NaN Technologies B.V. + * Allows you to determine which fonts to include in the library. + */ + +#ifndef __BMF_SETTINGS_H +#define __BMF_SETTINGS_H + + +#define BMF_INCLUDE_HELV12 0 +#define BMF_INCLUDE_HELVB8 0 +#define BMF_INCLUDE_HELVB10 0 +#define BMF_INCLUDE_HELVB12 0 +#define BMF_INCLUDE_HELVB14 0 +#define BMF_INCLUDE_SCR12 0 +#define BMF_INCLUDE_SCR14 0 +#define BMF_INCLUDE_SCR15 0 +#define BMF_INCLUDE_HELV10 1 + +#endif /* __BMF_SETTINGS_H */ + diff --git a/src/bullet/Demos/OpenGL/BMF_font_helv10.cpp b/src/bullet/Demos/OpenGL/BMF_font_helv10.cpp new file mode 100644 index 000000000..025ebf6b4 --- /dev/null +++ b/src/bullet/Demos/OpenGL/BMF_font_helv10.cpp @@ -0,0 +1,491 @@ +/** + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU bteral Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU bteral Public License for more details. + * + * You should have received a copy of the GNU bteral Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +#include "BMF_FontData.h" +#include "BMF_Settings.h" + +#if BMF_INCLUDE_HELV10 + +static unsigned char bitmap_data[]= { + 0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x80, + 0xa0,0xa0,0x50,0x50,0xf8,0x28,0x7c,0x28, + 0x28,0x20,0x70,0xa8,0x28,0x70,0xa0,0xa8, + 0x70,0x20,0x26,0x29,0x16,0x10,0x08,0x68, + 0x94,0x64,0x64,0x98,0x98,0xa4,0x60,0x50, + 0x50,0x20,0x80,0x40,0x40,0x20,0x40,0x40, + 0x80,0x80,0x80,0x80,0x40,0x40,0x20,0x80, + 0x40,0x40,0x20,0x20,0x20,0x20,0x40,0x40, + 0x80,0xa0,0x40,0xa0,0x20,0x20,0xf8,0x20, + 0x20,0x80,0x40,0x40,0xf8,0x80,0x80,0x80, + 0x40,0x40,0x40,0x40,0x20,0x20,0x70,0x88, + 0x88,0x88,0x88,0x88,0x88,0x70,0x40,0x40, + 0x40,0x40,0x40,0x40,0xc0,0x40,0xf8,0x80, + 0x40,0x30,0x08,0x08,0x88,0x70,0x70,0x88, + 0x08,0x08,0x30,0x08,0x88,0x70,0x10,0x10, + 0xf8,0x90,0x50,0x50,0x30,0x10,0x70,0x88, + 0x08,0x08,0xf0,0x80,0x80,0xf8,0x70,0x88, + 0x88,0xc8,0xb0,0x80,0x88,0x70,0x40,0x40, + 0x20,0x20,0x10,0x10,0x08,0xf8,0x70,0x88, + 0x88,0x88,0x70,0x88,0x88,0x70,0x70,0x88, + 0x08,0x68,0x98,0x88,0x88,0x70,0x80,0x00, + 0x00,0x00,0x00,0x80,0x80,0x40,0x40,0x00, + 0x00,0x00,0x00,0x40,0x20,0x40,0x80,0x40, + 0x20,0xf0,0x00,0xf0,0x80,0x40,0x20,0x40, + 0x80,0x40,0x00,0x40,0x40,0x20,0x10,0x90, + 0x60,0x3e,0x00,0x40,0x00,0x9b,0x00,0xa4, + 0x80,0xa4,0x80,0xa2,0x40,0x92,0x40,0x4d, + 0x40,0x20,0x80,0x1f,0x00,0x82,0x82,0x7c, + 0x44,0x28,0x28,0x10,0x10,0xf0,0x88,0x88, + 0x88,0xf0,0x88,0x88,0xf0,0x78,0x84,0x80, + 0x80,0x80,0x80,0x84,0x78,0xf0,0x88,0x84, + 0x84,0x84,0x84,0x88,0xf0,0xf8,0x80,0x80, + 0x80,0xf8,0x80,0x80,0xf8,0x80,0x80,0x80, + 0x80,0xf0,0x80,0x80,0xf8,0x74,0x8c,0x84, + 0x8c,0x80,0x80,0x84,0x78,0x84,0x84,0x84, + 0x84,0xfc,0x84,0x84,0x84,0x80,0x80,0x80, + 0x80,0x80,0x80,0x80,0x80,0x60,0x90,0x10, + 0x10,0x10,0x10,0x10,0x10,0x88,0x88,0x90, + 0x90,0xe0,0xa0,0x90,0x88,0xf0,0x80,0x80, + 0x80,0x80,0x80,0x80,0x80,0x92,0x92,0x92, + 0xaa,0xaa,0xc6,0xc6,0x82,0x8c,0x8c,0x94, + 0x94,0xa4,0xa4,0xc4,0xc4,0x78,0x84,0x84, + 0x84,0x84,0x84,0x84,0x78,0x80,0x80,0x80, + 0x80,0xf0,0x88,0x88,0xf0,0x02,0x7c,0x8c, + 0x94,0x84,0x84,0x84,0x84,0x78,0x88,0x88, + 0x88,0x88,0xf0,0x88,0x88,0xf0,0x70,0x88, + 0x88,0x08,0x70,0x80,0x88,0x70,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0xf8,0x78,0x84, + 0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x28, + 0x28,0x44,0x44,0x44,0x82,0x82,0x22,0x00, + 0x22,0x00,0x22,0x00,0x55,0x00,0x49,0x00, + 0x49,0x00,0x88,0x80,0x88,0x80,0x88,0x88, + 0x50,0x50,0x20,0x50,0x88,0x88,0x10,0x10, + 0x10,0x28,0x28,0x44,0x44,0x82,0xf8,0x80, + 0x40,0x20,0x20,0x10,0x08,0xf8,0xc0,0x80, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, + 0x20,0x20,0x40,0x40,0x40,0x40,0x80,0x80, + 0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x40,0xc0,0x88,0x50,0x50,0x20,0x20,0xfc, + 0x80,0x80,0x40,0x68,0x90,0x90,0x70,0x10, + 0xe0,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80, + 0x80,0x60,0x90,0x80,0x80,0x90,0x60,0x68, + 0x98,0x88,0x88,0x98,0x68,0x08,0x08,0x60, + 0x90,0x80,0xf0,0x90,0x60,0x40,0x40,0x40, + 0x40,0x40,0xe0,0x40,0x30,0x70,0x08,0x68, + 0x98,0x88,0x88,0x98,0x68,0x88,0x88,0x88, + 0x88,0xc8,0xb0,0x80,0x80,0x80,0x80,0x80, + 0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x80, + 0x80,0x80,0x80,0x80,0x00,0x80,0x90,0x90, + 0xa0,0xc0,0xa0,0x90,0x80,0x80,0x80,0x80, + 0x80,0x80,0x80,0x80,0x80,0x80,0x92,0x92, + 0x92,0x92,0x92,0xec,0x88,0x88,0x88,0x88, + 0xc8,0xb0,0x70,0x88,0x88,0x88,0x88,0x70, + 0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0, + 0x08,0x08,0x68,0x98,0x88,0x88,0x98,0x68, + 0x80,0x80,0x80,0x80,0xc0,0xa0,0x60,0x90, + 0x10,0x60,0x90,0x60,0x60,0x40,0x40,0x40, + 0x40,0xe0,0x40,0x40,0x70,0x90,0x90,0x90, + 0x90,0x90,0x20,0x20,0x50,0x50,0x88,0x88, + 0x28,0x28,0x54,0x54,0x92,0x92,0x88,0x88, + 0x50,0x20,0x50,0x88,0x80,0x40,0x40,0x60, + 0xa0,0xa0,0x90,0x90,0xf0,0x80,0x40,0x20, + 0x10,0xf0,0x20,0x40,0x40,0x40,0x40,0x80, + 0x40,0x40,0x40,0x20,0x80,0x80,0x80,0x80, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40, + 0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80, + 0x98,0x64,0x80,0x80,0x80,0x80,0x80,0x80, + 0x00,0x80,0x40,0x70,0xa8,0xa0,0xa0,0xa8, + 0x70,0x10,0xb0,0x48,0x40,0x40,0xe0,0x40, + 0x48,0x30,0x90,0x60,0x90,0x90,0x60,0x90, + 0x20,0xf8,0x20,0xf8,0x50,0x50,0x88,0x88, + 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x80, + 0x80,0x80,0x70,0x88,0x18,0x70,0xc8,0x98, + 0x70,0xc0,0x88,0x70,0xa0,0x38,0x44,0x9a, + 0xa2,0x9a,0x44,0x38,0xe0,0x00,0xa0,0x20, + 0xe0,0x28,0x50,0xa0,0x50,0x28,0x08,0x08, + 0xf8,0xe0,0x38,0x44,0xaa,0xb2,0xba,0x44, + 0x38,0xe0,0x60,0x90,0x90,0x60,0xf8,0x00, + 0x20,0x20,0xf8,0x20,0x20,0xe0,0x40,0xa0, + 0x60,0xc0,0x20,0x40,0xe0,0x80,0x40,0x80, + 0x80,0xf0,0x90,0x90,0x90,0x90,0x90,0x28, + 0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8, + 0x7c,0xc0,0xc0,0x40,0x40,0x40,0xc0,0x40, + 0xe0,0x00,0xe0,0xa0,0xe0,0xa0,0x50,0x28, + 0x50,0xa0,0x21,0x00,0x17,0x80,0x13,0x00, + 0x09,0x00,0x48,0x00,0x44,0x00,0xc4,0x00, + 0x42,0x00,0x27,0x12,0x15,0x0b,0x48,0x44, + 0xc4,0x42,0x21,0x00,0x17,0x80,0x13,0x00, + 0x09,0x00,0xc8,0x00,0x24,0x00,0x44,0x00, + 0xe2,0x00,0x60,0x90,0x80,0x40,0x20,0x20, + 0x00,0x20,0x82,0x82,0x7c,0x44,0x28,0x28, + 0x10,0x10,0x00,0x10,0x20,0x82,0x82,0x7c, + 0x44,0x28,0x28,0x10,0x10,0x00,0x10,0x08, + 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10, + 0x00,0x28,0x10,0x82,0x82,0x7c,0x44,0x28, + 0x28,0x10,0x10,0x00,0x28,0x14,0x82,0x82, + 0x7c,0x44,0x28,0x28,0x10,0x10,0x00,0x28, + 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10, + 0x10,0x28,0x10,0x8f,0x80,0x88,0x00,0x78, + 0x00,0x48,0x00,0x2f,0x80,0x28,0x00,0x18, + 0x00,0x1f,0x80,0x30,0x10,0x78,0x84,0x80, + 0x80,0x80,0x80,0x84,0x78,0xf8,0x80,0x80, + 0x80,0xf8,0x80,0x80,0xf8,0x00,0x20,0x40, + 0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8, + 0x00,0x20,0x10,0xf8,0x80,0x80,0xf8,0x80, + 0x80,0x80,0xf8,0x00,0x50,0x20,0xf8,0x80, + 0x80,0x80,0xf8,0x80,0x80,0xf8,0x00,0x50, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x00,0x40,0x80,0x80,0x80,0x80,0x80,0x80, + 0x80,0x80,0x80,0x00,0x80,0x40,0x40,0x40, + 0x40,0x40,0x40,0x40,0x40,0x40,0x00,0xa0, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x40,0x00,0xa0,0x78,0x44,0x42,0x42,0xf2, + 0x42,0x44,0x78,0x8c,0x8c,0x94,0x94,0xa4, + 0xa4,0xc4,0xc4,0x00,0x50,0x28,0x78,0x84, + 0x84,0x84,0x84,0x84,0x84,0x78,0x00,0x10, + 0x20,0x78,0x84,0x84,0x84,0x84,0x84,0x84, + 0x78,0x00,0x10,0x08,0x78,0x84,0x84,0x84, + 0x84,0x84,0x84,0x78,0x00,0x28,0x10,0x78, + 0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x00, + 0x50,0x28,0x78,0x84,0x84,0x84,0x84,0x84, + 0x84,0x78,0x00,0x48,0x88,0x50,0x20,0x50, + 0x88,0x80,0x78,0xc4,0xa4,0xa4,0x94,0x94, + 0x8c,0x78,0x04,0x78,0x84,0x84,0x84,0x84, + 0x84,0x84,0x84,0x00,0x10,0x20,0x78,0x84, + 0x84,0x84,0x84,0x84,0x84,0x84,0x00,0x20, + 0x10,0x78,0x84,0x84,0x84,0x84,0x84,0x84, + 0x84,0x00,0x28,0x10,0x78,0x84,0x84,0x84, + 0x84,0x84,0x84,0x84,0x00,0x48,0x10,0x10, + 0x10,0x28,0x28,0x44,0x44,0x82,0x00,0x10, + 0x08,0x80,0x80,0xf0,0x88,0x88,0xf0,0x80, + 0x80,0xa0,0x90,0x90,0x90,0xa0,0x90,0x90, + 0x60,0x68,0x90,0x90,0x70,0x10,0xe0,0x00, + 0x20,0x40,0x68,0x90,0x90,0x70,0x10,0xe0, + 0x00,0x20,0x10,0x68,0x90,0x90,0x70,0x10, + 0xe0,0x00,0x50,0x20,0x68,0x90,0x90,0x70, + 0x10,0xe0,0x00,0xa0,0x50,0x68,0x90,0x90, + 0x70,0x10,0xe0,0x00,0x50,0x68,0x90,0x90, + 0x70,0x10,0xe0,0x20,0x50,0x20,0x6c,0x92, + 0x90,0x7e,0x12,0xec,0x60,0x20,0x60,0x90, + 0x80,0x80,0x90,0x60,0x60,0x90,0x80,0xf0, + 0x90,0x60,0x00,0x20,0x40,0x60,0x90,0x80, + 0xf0,0x90,0x60,0x00,0x40,0x20,0x60,0x90, + 0x80,0xf0,0x90,0x60,0x00,0x50,0x20,0x60, + 0x90,0x80,0xf0,0x90,0x60,0x00,0x50,0x40, + 0x40,0x40,0x40,0x40,0x40,0x00,0x40,0x80, + 0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x80, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00, + 0xa0,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x00,0xa0,0x70,0x88,0x88,0x88,0x88,0x78, + 0x90,0x60,0x50,0x90,0x90,0x90,0x90,0x90, + 0xe0,0x00,0xa0,0x50,0x70,0x88,0x88,0x88, + 0x88,0x70,0x00,0x20,0x40,0x70,0x88,0x88, + 0x88,0x88,0x70,0x00,0x20,0x10,0x70,0x88, + 0x88,0x88,0x88,0x70,0x00,0x50,0x20,0x70, + 0x88,0x88,0x88,0x88,0x70,0x00,0x50,0x28, + 0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x50, + 0x20,0x00,0xf8,0x00,0x20,0x70,0x88,0xc8, + 0xa8,0x98,0x74,0x70,0x90,0x90,0x90,0x90, + 0x90,0x00,0x20,0x40,0x70,0x90,0x90,0x90, + 0x90,0x90,0x00,0x40,0x20,0x70,0x90,0x90, + 0x90,0x90,0x90,0x00,0x50,0x20,0x70,0x90, + 0x90,0x90,0x90,0x90,0x00,0x50,0x80,0x40, + 0x40,0x60,0xa0,0xa0,0x90,0x90,0x00,0x20, + 0x10,0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8, + 0xb0,0x80,0x80,0x80,0x40,0x40,0x60,0xa0, + 0xa0,0x90,0x90,0x00,0x50, +}; + +BMF_FontData BMF_font_helv10 = { + -1, -2, + 10, 11, + { + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0, 0, 0, 0, 12, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0, 0, 0, 0, 3, -1}, + {1, 8, -1, 0, 3, 0}, + {3, 2, -1, -6, 4, 8}, + {6, 7, 0, 0, 6, 10}, + {5, 9, 0, 1, 6, 17}, + {8, 8, 0, 0, 9, 26}, + {6, 8, -1, 0, 8, 34}, + {2, 3, -1, -5, 3, 42}, + {3, 10, 0, 2, 4, 45}, + {3, 10, -1, 2, 4, 55}, + {3, 3, 0, -5, 4, 65}, + {5, 5, 0, -1, 6, 68}, + {2, 3, 0, 2, 3, 73}, + {5, 1, -1, -3, 7, 76}, + {1, 1, -1, 0, 3, 77}, + {3, 8, 0, 0, 3, 78}, + {5, 8, 0, 0, 6, 86}, + {2, 8, -1, 0, 6, 94}, + {5, 8, 0, 0, 6, 102}, + {5, 8, 0, 0, 6, 110}, + {5, 8, 0, 0, 6, 118}, + {5, 8, 0, 0, 6, 126}, + {5, 8, 0, 0, 6, 134}, + {5, 8, 0, 0, 6, 142}, + {5, 8, 0, 0, 6, 150}, + {5, 8, 0, 0, 6, 158}, + {1, 6, -1, 0, 3, 166}, + {2, 8, 0, 2, 3, 172}, + {3, 5, -1, -1, 6, 180}, + {4, 3, 0, -2, 5, 185}, + {3, 5, -1, -1, 6, 188}, + {4, 8, -1, 0, 6, 193}, + {10, 10, 0, 2, 11, 201}, + {7, 8, 0, 0, 7, 221}, + {5, 8, -1, 0, 7, 229}, + {6, 8, -1, 0, 8, 237}, + {6, 8, -1, 0, 8, 245}, + {5, 8, -1, 0, 7, 253}, + {5, 8, -1, 0, 6, 261}, + {6, 8, -1, 0, 8, 269}, + {6, 8, -1, 0, 8, 277}, + {1, 8, -1, 0, 3, 285}, + {4, 8, 0, 0, 5, 293}, + {5, 8, -1, 0, 7, 301}, + {4, 8, -1, 0, 6, 309}, + {7, 8, -1, 0, 9, 317}, + {6, 8, -1, 0, 8, 325}, + {6, 8, -1, 0, 8, 333}, + {5, 8, -1, 0, 7, 341}, + {7, 9, -1, 1, 8, 349}, + {5, 8, -1, 0, 7, 358}, + {5, 8, -1, 0, 7, 366}, + {5, 8, 0, 0, 5, 374}, + {6, 8, -1, 0, 8, 382}, + {7, 8, 0, 0, 7, 390}, + {9, 8, 0, 0, 9, 398}, + {5, 8, -1, 0, 7, 414}, + {7, 8, 0, 0, 7, 422}, + {5, 8, -1, 0, 7, 430}, + {2, 10, -1, 2, 3, 438}, + {3, 8, 0, 0, 3, 448}, + {2, 10, 0, 2, 3, 456}, + {5, 5, 0, -3, 6, 466}, + {6, 1, 0, 2, 6, 471}, + {2, 3, 0, -5, 3, 472}, + {5, 6, 0, 0, 5, 475}, + {5, 8, 0, 0, 6, 481}, + {4, 6, 0, 0, 5, 489}, + {5, 8, 0, 0, 6, 495}, + {4, 6, 0, 0, 5, 503}, + {4, 8, 0, 0, 4, 509}, + {5, 8, 0, 2, 6, 517}, + {5, 8, 0, 0, 6, 525}, + {1, 8, 0, 0, 2, 533}, + {1, 9, 0, 1, 2, 541}, + {4, 8, 0, 0, 5, 550}, + {1, 8, 0, 0, 2, 558}, + {7, 6, 0, 0, 8, 566}, + {5, 6, 0, 0, 6, 572}, + {5, 6, 0, 0, 6, 578}, + {5, 8, 0, 2, 6, 584}, + {5, 8, 0, 2, 6, 592}, + {3, 6, 0, 0, 4, 600}, + {4, 6, 0, 0, 5, 606}, + {3, 8, 0, 0, 4, 612}, + {4, 6, 0, 0, 5, 620}, + {5, 6, 0, 0, 6, 626}, + {7, 6, 0, 0, 8, 632}, + {5, 6, 0, 0, 6, 638}, + {4, 8, 0, 2, 5, 644}, + {4, 6, 0, 0, 5, 652}, + {3, 10, 0, 2, 3, 658}, + {1, 10, -1, 2, 3, 668}, + {3, 10, 0, 2, 3, 678}, + {6, 2, 0, -3, 7, 688}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0,0,0,0,0, -1}, + {0, 0, 0, 0, 3, -1}, + {1, 8, -1, 2, 3, 690}, + {5, 8, 0, 1, 6, 698}, + {5, 8, 0, 0, 6, 706}, + {4, 6, 0, -1, 5, 714}, + {5, 8, 0, 0, 6, 720}, + {1, 10, -1, 2, 3, 728}, + {5, 10, 0, 2, 6, 738}, + {3, 1, 0, -7, 3, 748}, + {7, 7, -1, 0, 9, 749}, + {3, 5, 0, -3, 4, 756}, + {5, 5, 0, 0, 6, 761}, + {5, 3, -1, -2, 7, 766}, + {3, 1, 0, -3, 4, 769}, + {7, 7, -1, 0, 9, 770}, + {3, 1, 0, -7, 3, 777}, + {4, 4, 0, -3, 4, 778}, + {5, 7, 0, 0, 6, 782}, + {3, 4, 0, -3, 3, 789}, + {3, 4, 0, -3, 3, 793}, + {2, 2, 0, -6, 3, 797}, + {4, 8, 0, 2, 5, 799}, + {6, 10, 0, 2, 6, 807}, + {2, 1, 0, -3, 3, 817}, + {2, 2, 0, 2, 3, 818}, + {2, 4, 0, -3, 3, 820}, + {3, 5, 0, -3, 4, 824}, + {5, 5, 0, 0, 6, 829}, + {9, 8, 0, 0, 9, 834}, + {8, 8, 0, 0, 9, 850}, + {9, 8, 0, 0, 9, 858}, + {4, 8, -1, 2, 6, 874}, + {7, 11, 0, 0, 7, 882}, + {7, 11, 0, 0, 7, 893}, + {7, 11, 0, 0, 7, 904}, + {7, 11, 0, 0, 7, 915}, + {7, 10, 0, 0, 7, 926}, + {7, 11, 0, 0, 7, 936}, + {9, 8, 0, 0, 10, 947}, + {6, 10, -1, 2, 8, 963}, + {5, 11, -1, 0, 7, 973}, + {5, 11, -1, 0, 7, 984}, + {5, 11, -1, 0, 7, 995}, + {5, 10, -1, 0, 7, 1006}, + {2, 11, 0, 0, 3, 1016}, + {2, 11, -1, 0, 3, 1027}, + {3, 11, 0, 0, 3, 1038}, + {3, 10, 0, 0, 3, 1049}, + {7, 8, 0, 0, 8, 1059}, + {6, 11, -1, 0, 8, 1067}, + {6, 11, -1, 0, 8, 1078}, + {6, 11, -1, 0, 8, 1089}, + {6, 11, -1, 0, 8, 1100}, + {6, 11, -1, 0, 8, 1111}, + {6, 10, -1, 0, 8, 1122}, + {5, 5, 0, -1, 6, 1132}, + {6, 10, -1, 1, 8, 1137}, + {6, 11, -1, 0, 8, 1147}, + {6, 11, -1, 0, 8, 1158}, + {6, 11, -1, 0, 8, 1169}, + {6, 10, -1, 0, 8, 1180}, + {7, 11, 0, 0, 7, 1190}, + {5, 8, -1, 0, 7, 1201}, + {4, 8, 0, 0, 5, 1209}, + {5, 9, 0, 0, 5, 1217}, + {5, 9, 0, 0, 5, 1226}, + {5, 9, 0, 0, 5, 1235}, + {5, 9, 0, 0, 5, 1244}, + {5, 8, 0, 0, 5, 1253}, + {5, 9, 0, 0, 5, 1261}, + {7, 6, 0, 0, 8, 1270}, + {4, 8, 0, 2, 5, 1276}, + {4, 9, 0, 0, 5, 1284}, + {4, 9, 0, 0, 5, 1293}, + {4, 9, 0, 0, 5, 1302}, + {4, 8, 0, 0, 5, 1311}, + {2, 9, 1, 0, 2, 1319}, + {2, 9, 0, 0, 2, 1328}, + {3, 9, 1, 0, 2, 1337}, + {3, 8, 0, 0, 2, 1346}, + {5, 9, 0, 0, 6, 1354}, + {4, 9, 0, 0, 5, 1363}, + {5, 9, 0, 0, 6, 1372}, + {5, 9, 0, 0, 6, 1381}, + {5, 9, 0, 0, 6, 1390}, + {5, 9, 0, 0, 6, 1399}, + {5, 8, 0, 0, 6, 1408}, + {5, 5, 0, -1, 6, 1416}, + {6, 6, 0, 0, 6, 1421}, + {4, 9, 0, 0, 5, 1427}, + {4, 9, 0, 0, 5, 1436}, + {4, 9, 0, 0, 5, 1445}, + {4, 8, 0, 0, 5, 1454}, + {4, 11, 0, 2, 5, 1462}, + {5, 10, 0, 2, 6, 1473}, + {4, 10, 0, 2, 5, 1483}, + }, + bitmap_data +}; + +#endif + diff --git a/src/bullet/Demos/OpenGL/CMakeLists.txt b/src/bullet/Demos/OpenGL/CMakeLists.txt new file mode 100644 index 000000000..337d3ad52 --- /dev/null +++ b/src/bullet/Demos/OpenGL/CMakeLists.txt @@ -0,0 +1,63 @@ +# This is basically the overall name of the project in Visual Studio this is the name of the Solution File + + +# For every executable you have with a main method you should have an add_executable line below. +# For every add executable line you should list every .cpp and .h file you have associated with that executable. + + +# This is the variable for Windows. I use this to define the root of my directory structure. +SET(GLUT_ROOT ${BULLET_PHYSICS_SOURCE_DIR}/glut) + +# You shouldn't have to modify anything below this line +######################################################## + + +# This is the shortcut to finding GLU, GLUT and OpenGL if they are properly installed on your system +# This should be the case. +INCLUDE (${CMAKE_ROOT}/Modules/FindGLU.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/FindGLUT.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake) + + +IF (WIN32) + # This is the Windows code for which Opengl, and Glut are not properly installed + # since I can't install them I must cheat and copy libraries around + INCLUDE_DIRECTORIES(${GLUT_ROOT}) + # LINK_DIRECTORIES(${GLUT_ROOT}\\lib) + # IF (${GLUT_glut_LIBRARY} MATCHES "GLUT_glut_LIBRARY-NOTFOUND") + # LINK_LIBRARIES(${GLUT_ROOT}\\lib\\glut32 ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY}) + # TARGET_LINK_LIBRARIES(table ${GLUT_ROOT}\\lib\\glut32) +# +# ADD_CUSTOM_COMMAND(TARGET table POST_BUILD COMMAND copy ${GLUT_ROOT}\\lib\\glut32.dll ${GLUT_ROOT}\\bin\\vs2005\\Debug +# COMMAND copy ${GLUT_ROOT}\\lib\\glut32.dll ${GLUT_ROOT}\\bin\\vs2003\\Debug +# COMMAND copy ${GLUT_ROOT}\\lib\\glut32.dll ${GLUT_ROOT}\\bin\\vs6\\Debug) +# ELSE (${GLUT_glut_LIBRARY} MATCHES "GLUT_glut_LIBRARY-NOTFOUND") +# LINK_LIBRARIES(${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) +# TARGET_LINK_LIBRARIES(table ${GLUT_glut_LIBRARY}) +# ENDIF(${GLUT_glut_LIBRARY} MATCHES "GLUT_glut_LIBRARY-NOTFOUND") +# TARGET_LINK_LIBRARIES(table ${OPENGL_gl_LIBRARY}) +# TARGET_LINK_LIBRARIES(table ${OPENGL_glu_LIBRARY}) +ELSE (WIN32) + # This is the lines for linux. This should always work if everything is installed and working fine. +# SET(CMAKE_BUILD_TYPE Debug) +# SET(CMAKE_CXX_FLAGS_DEBUG "-g") + INCLUDE_DIRECTORIES(/usr/include /usr/local/include ${GLUT_INCLUDE_DIR}) +# TARGET_LINK_LIBRARIES(table ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) +# TARGET_LINK_LIBRARIES(checker ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) +ENDIF (WIN32) + +INCLUDE_DIRECTORIES( +${BULLET_PHYSICS_SOURCE_DIR}/src } +) + +ADD_LIBRARY(LibOpenGLSupport + BMF_Api.cpp + BMF_BitmapFont.cpp + BMF_font_helv10.cpp + GL_ShapeDrawer.cpp + GL_Simplex1to4.cpp + GLDebugDrawer.cpp + GlutStuff.cpp + RenderTexture.cpp + DemoApplication.cpp +) diff --git a/src/bullet/Demos/OpenGL/DebugCastResult.h b/src/bullet/Demos/OpenGL/DebugCastResult.h new file mode 100644 index 000000000..05ab92cb5 --- /dev/null +++ b/src/bullet/Demos/OpenGL/DebugCastResult.h @@ -0,0 +1,83 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef DEBUG_CAST_RESULT_H +#define DEBUG_CAST_RESULT_H + +#include "BulletCollision/NarrowPhaseCollision/btConvexCast.h" +#include "LinearMath/btTransform.h" +#include "GL_ShapeDrawer.h" +#include "GlutStuff.h" +#ifdef WIN32 +#include +#endif +//think different +#if defined(__APPLE__) && !defined (VMDMESA) +#include +#include +#else +#include +#endif +struct btDebugCastResult : public btConvexCast::CastResult +{ + + btTransform m_fromTrans; + const btPolyhedralConvexShape* m_shape; + btVector3 m_linVel; + btVector3 m_angVel; + + btDebugCastResult(const btTransform& fromTrans,const btPolyhedralConvexShape* shape, + const btVector3& linVel,const btVector3& angVel) + :m_fromTrans(fromTrans), + m_shape(shape), + m_linVel(linVel), + m_angVel(angVel) + { + } + + virtual void drawCoordSystem(const btTransform& tr) + { + btScalar m[16]; + tr.getOpenGLMatrix(m); + glPushMatrix(); + btglLoadMatrix(m); + glBegin(GL_LINES); + btglColor3(1, 0, 0); + btglVertex3(0, 0, 0); + btglVertex3(1, 0, 0); + btglColor3(0, 1, 0); + btglVertex3(0, 0, 0); + btglVertex3(0, 1, 0); + btglColor3(0, 0, 1); + btglVertex3(0, 0, 0); + btglVertex3(0, 0, 1); + glEnd(); + glPopMatrix(); + } + + virtual void DebugDraw(btScalar fraction) + { + + btScalar m[16]; + btTransform hitTrans; + btTransformUtil::integrateTransform(m_fromTrans,m_linVel,m_angVel,fraction,hitTrans); + hitTrans.getOpenGLMatrix(m); + GL_ShapeDrawer::drawOpenGL(m,m_shape,btVector3(1,0,0),btIDebugDraw::DBG_NoDebug); + + } +}; + + +#endif //DEBUG_CAST_RESULT_H diff --git a/src/bullet/Demos/OpenGL/DemoApplication.cpp b/src/bullet/Demos/OpenGL/DemoApplication.cpp new file mode 100644 index 000000000..66b4ae2e7 --- /dev/null +++ b/src/bullet/Demos/OpenGL/DemoApplication.cpp @@ -0,0 +1,1028 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "DemoApplication.h" +#include "LinearMath/btIDebugDraw.h" +#include "BulletDynamics/Dynamics/btDynamicsWorld.h" + +#include "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h"//picking +#include "BulletCollision/CollisionShapes/btCollisionShape.h" +#include "BulletCollision/CollisionShapes/btBoxShape.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" +#include "BulletCollision/CollisionShapes/btCompoundShape.h" +#include "BulletCollision/CollisionShapes/btUniformScalingShape.h" + +#include "GL_ShapeDrawer.h" +#include "LinearMath/btQuickprof.h" +#include "LinearMath/btDefaultMotionState.h" + +#include "BMF_Api.h" + +extern bool gDisableDeactivation; +int numObjects = 0; +const int maxNumObjects = 16384; +btTransform startTransforms[maxNumObjects]; +btCollisionShape* gShapePtr[maxNumObjects];//1 rigidbody has 1 shape (no re-use of shapes) +#define SHOW_NUM_DEEP_PENETRATIONS 1 + +#ifdef SHOW_NUM_DEEP_PENETRATIONS +extern int gNumDeepPenetrationChecks; +extern int gNumGjkChecks; +extern int gNumAlignedAllocs; +extern int gNumAlignedFree; +extern int gTotalBytesAlignedAllocs; + +#endif // + + +DemoApplication::DemoApplication() + //see btIDebugDraw.h for modes +: +m_dynamicsWorld(0), +m_pickConstraint(0), +m_shootBoxShape(0), + m_cameraDistance(15.0), + m_debugMode(0), + m_ele(20.f), + m_azi(0.f), + m_cameraPosition(0.f,0.f,0.f), + m_cameraTargetPosition(0.f,0.f,0.f), + m_scaleBottom(0.5f), + m_scaleFactor(2.f), + m_cameraUp(0,1,0), + m_forwardAxis(2), + m_glutScreenWidth(0), + m_glutScreenHeight(0), + m_ShootBoxInitialSpeed(40.f), + m_stepping(true), + m_singleStep(false), + m_idle(false) +{ +} + + + +DemoApplication::~DemoApplication() +{ + if (m_shootBoxShape) + delete m_shootBoxShape; + +} + + +void DemoApplication::myinit(void) +{ + + GLfloat light_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + /* light_position is NOT default value */ + GLfloat light_position0[] = { 1.0, 10.0, 1.0, 0.0 }; + GLfloat light_position1[] = { -1.0, -10.0, -1.0, 0.0 }; + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position0); + + glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT1, GL_POSITION, light_position1); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHT1); + + + glShadeModel(GL_SMOOTH); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glClearColor(0.7,0.7,0.7,0); + + // glEnable(GL_CULL_FACE); + // glCullFace(GL_BACK); +} + + +void DemoApplication::setCameraDistance(float dist) +{ + m_cameraDistance = dist; +} + +float DemoApplication::getCameraDistance() +{ + return m_cameraDistance; +} + + + +void DemoApplication::toggleIdle() { + if (m_idle) { + m_idle = false; + } + else { + m_idle = true; + } +} + + + + +void DemoApplication::updateCamera() { + + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + float rele = m_ele * 0.01745329251994329547;// rads per deg + float razi = m_azi * 0.01745329251994329547;// rads per deg + + + btQuaternion rot(m_cameraUp,razi); + + + btVector3 eyePos(0,0,0); + eyePos[m_forwardAxis] = -m_cameraDistance; + + btVector3 forward(eyePos[0],eyePos[1],eyePos[2]); + if (forward.length2() < SIMD_EPSILON) + { + forward.setValue(1.f,0.f,0.f); + } + btVector3 right = m_cameraUp.cross(forward); + btQuaternion roll(right,-rele); + + eyePos = btMatrix3x3(rot) * btMatrix3x3(roll) * eyePos; + + m_cameraPosition[0] = eyePos.getX(); + m_cameraPosition[1] = eyePos.getY(); + m_cameraPosition[2] = eyePos.getZ(); + + glFrustum(-1.0, 1.0, -1.0, 1.0, 1.0, 10000.0); + gluLookAt(m_cameraPosition[0], m_cameraPosition[1], m_cameraPosition[2], + m_cameraTargetPosition[0], m_cameraTargetPosition[1], m_cameraTargetPosition[2], + m_cameraUp.getX(),m_cameraUp.getY(),m_cameraUp.getZ()); + glMatrixMode(GL_MODELVIEW); +} + + + +const float STEPSIZE = 5; + +void DemoApplication::stepLeft() +{ + m_azi -= STEPSIZE; if (m_azi < 0) m_azi += 360; updateCamera(); +} +void DemoApplication::stepRight() +{ + m_azi += STEPSIZE; if (m_azi >= 360) m_azi -= 360; updateCamera(); +} +void DemoApplication::stepFront() +{ + m_ele += STEPSIZE; if (m_ele >= 360) m_ele -= 360; updateCamera(); +} +void DemoApplication::stepBack() +{ + m_ele -= STEPSIZE; if (m_ele < 0) m_ele += 360; updateCamera(); +} +void DemoApplication::zoomIn() +{ + m_cameraDistance -= 0.4; updateCamera(); + if (m_cameraDistance < 0.1) + m_cameraDistance = 0.1; + +} +void DemoApplication::zoomOut() +{ + m_cameraDistance += 0.4; updateCamera(); + +} + + + + + + + + + + +void DemoApplication::reshape(int w, int h) +{ + m_glutScreenWidth = w; + m_glutScreenHeight = h; + + glViewport(0, 0, w, h); + updateCamera(); +} + + + + +void DemoApplication::keyboardCallback(unsigned char key, int x, int y) +{ + (void)x; + (void)y; + + m_lastKey = 0; + + switch (key) + { + case 'q' : exit(0); break; + + case 'l' : stepLeft(); break; + case 'r' : stepRight(); break; + case 'f' : stepFront(); break; + case 'b' : stepBack(); break; + case 'z' : zoomIn(); break; + case 'x' : zoomOut(); break; + case 'i' : toggleIdle(); break; + case 'h': + if (m_debugMode & btIDebugDraw::DBG_NoHelpText) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_NoHelpText); + else + m_debugMode |= btIDebugDraw::DBG_NoHelpText; + break; + + case 'w': + if (m_debugMode & btIDebugDraw::DBG_DrawWireframe) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawWireframe); + else + m_debugMode |= btIDebugDraw::DBG_DrawWireframe; + break; + + case 'p': + if (m_debugMode & btIDebugDraw::DBG_ProfileTimings) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_ProfileTimings); + else + m_debugMode |= btIDebugDraw::DBG_ProfileTimings; + break; + + case 'm': + if (m_debugMode & btIDebugDraw::DBG_EnableSatComparison) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_EnableSatComparison); + else + m_debugMode |= btIDebugDraw::DBG_EnableSatComparison; + break; + + case 'n': + if (m_debugMode & btIDebugDraw::DBG_DisableBulletLCP) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DisableBulletLCP); + else + m_debugMode |= btIDebugDraw::DBG_DisableBulletLCP; + break; + + case 't' : + if (m_debugMode & btIDebugDraw::DBG_DrawText) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawText); + else + m_debugMode |= btIDebugDraw::DBG_DrawText; + break; + case 'y': + if (m_debugMode & btIDebugDraw::DBG_DrawFeaturesText) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawFeaturesText); + else + m_debugMode |= btIDebugDraw::DBG_DrawFeaturesText; + break; + case 'a': + if (m_debugMode & btIDebugDraw::DBG_DrawAabb) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawAabb); + else + m_debugMode |= btIDebugDraw::DBG_DrawAabb; + break; + case 'c' : + if (m_debugMode & btIDebugDraw::DBG_DrawContactPoints) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawContactPoints); + else + m_debugMode |= btIDebugDraw::DBG_DrawContactPoints; + break; + + case 'd' : + if (m_debugMode & btIDebugDraw::DBG_NoDeactivation) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_NoDeactivation); + else + m_debugMode |= btIDebugDraw::DBG_NoDeactivation; + if (m_debugMode & btIDebugDraw::DBG_NoDeactivation) + { + gDisableDeactivation = true; + } else + { + gDisableDeactivation = false; + } + break; + + + + + case 'o' : + { + m_stepping = !m_stepping; + break; + } + case 's' : clientMoveAndDisplay(); break; +// case ' ' : newRandom(); break; + case ' ': + clientResetScene(); + break; + case '1': + { + if (m_debugMode & btIDebugDraw::DBG_EnableCCD) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_EnableCCD); + else + m_debugMode |= btIDebugDraw::DBG_EnableCCD; + break; + } + + case '.': + { + shootBox(getCameraTargetPosition()); + break; + } + + case '+': + { + m_ShootBoxInitialSpeed += 10.f; + break; + } + case '-': + { + m_ShootBoxInitialSpeed -= 10.f; + break; + } + + default: +// std::cout << "unused key : " << key << std::endl; + break; + } + + if (getDynamicsWorld() && getDynamicsWorld()->getDebugDrawer()) + getDynamicsWorld()->getDebugDrawer()->setDebugMode(m_debugMode); + + glutPostRedisplay(); + +} + +void DemoApplication::setDebugMode(int mode) +{ + m_debugMode = mode; + if (getDynamicsWorld() && getDynamicsWorld()->getDebugDrawer()) + getDynamicsWorld()->getDebugDrawer()->setDebugMode(mode); +} + + +void DemoApplication::specialKeyboardUp(int key, int x, int y) +{ + + glutPostRedisplay(); + +} + +void DemoApplication::specialKeyboard(int key, int x, int y) +{ + (void)x; + (void)y; + + switch (key) + { + case GLUT_KEY_F1: + { + + break; + } + + case GLUT_KEY_F2: + { + + break; + } + + + case GLUT_KEY_END: + { + int numObj = getDynamicsWorld()->getNumCollisionObjects(); + if (numObj) + { + btCollisionObject* obj = getDynamicsWorld()->getCollisionObjectArray()[numObj-1]; + + getDynamicsWorld()->removeCollisionObject(obj); + btRigidBody* body = btRigidBody::upcast(obj); + if (body && body->getMotionState()) + { + delete body->getMotionState(); + } + delete obj; + + + } + break; + } + case GLUT_KEY_LEFT : stepLeft(); break; + case GLUT_KEY_RIGHT : stepRight(); break; + case GLUT_KEY_UP : stepFront(); break; + case GLUT_KEY_DOWN : stepBack(); break; + case GLUT_KEY_PAGE_UP : zoomIn(); break; + case GLUT_KEY_PAGE_DOWN : zoomOut(); break; + case GLUT_KEY_HOME : toggleIdle(); break; + default: +// std::cout << "unused (special) key : " << key << std::endl; + break; + } + + glutPostRedisplay(); + +} + + + +void DemoApplication::moveAndDisplay() +{ + if (!m_idle) + clientMoveAndDisplay(); +} + + + + +void DemoApplication::displayCallback() +{ +} + + + + +void DemoApplication::shootBox(const btVector3& destination) +{ + + if (m_dynamicsWorld) + { + float mass = 100.f; + btTransform startTransform; + startTransform.setIdentity(); + btVector3 camPos = getCameraPosition(); + startTransform.setOrigin(camPos); + + if (!m_shootBoxShape) + { + //#define TEST_UNIFORM_SCALING_SHAPE 1 +#ifdef TEST_UNIFORM_SCALING_SHAPE + btConvexShape* childShape = new btBoxShape(btVector3(1.f,1.f,1.f)); + m_shootBoxShape = new btUniformScalingShape(childShape,0.5f); +#else + m_shootBoxShape = new btBoxShape(btVector3(0.5f,0.5f,0.5f)); +#endif// + } + + btRigidBody* body = this->localCreateRigidBody(mass, startTransform,m_shootBoxShape); + + btVector3 linVel(destination[0]-camPos[0],destination[1]-camPos[1],destination[2]-camPos[2]); + linVel.normalize(); + linVel*=m_ShootBoxInitialSpeed; + + body->getWorldTransform().setOrigin(camPos); + body->getWorldTransform().setRotation(btQuaternion(0,0,0,1)); + body->setLinearVelocity(linVel); + body->setAngularVelocity(btVector3(0,0,0)); + } + +} + + +int gPickingConstraintId = 0; +btVector3 gOldPickingPos; +float gOldPickingDist = 0.f; +btRigidBody* pickedBody = 0;//for deactivation state + + +btVector3 DemoApplication::getRayTo(int x,int y) +{ + + float top = 1.f; + float bottom = -1.f; + float nearPlane = 1.f; + float tanFov = (top-bottom)*0.5f / nearPlane; + float fov = 2.0 * atanf (tanFov); + + btVector3 rayFrom = getCameraPosition(); + btVector3 rayForward = (getCameraTargetPosition()-getCameraPosition()); + rayForward.normalize(); + float farPlane = 600.f; + rayForward*= farPlane; + + btVector3 rightOffset; + btVector3 vertical = m_cameraUp; + + btVector3 hor; + hor = rayForward.cross(vertical); + hor.normalize(); + vertical = hor.cross(rayForward); + vertical.normalize(); + + float tanfov = tanf(0.5f*fov); + hor *= 2.f * farPlane * tanfov; + vertical *= 2.f * farPlane * tanfov; + btVector3 rayToCenter = rayFrom + rayForward; + btVector3 dHor = hor * 1.f/float(m_glutScreenWidth); + btVector3 dVert = vertical * 1.f/float(m_glutScreenHeight); + btVector3 rayTo = rayToCenter - 0.5f * hor + 0.5f * vertical; + rayTo += x * dHor; + rayTo -= y * dVert; + return rayTo; +} + + +void DemoApplication::mouseFunc(int button, int state, int x, int y) +{ + //printf("button %i, state %i, x=%i,y=%i\n",button,state,x,y); + //button 0, state 0 means left mouse down + + btVector3 rayTo = getRayTo(x,y); + + switch (button) + { + case 2: + { + if (state==0) + { + + shootBox(rayTo); + } + break; + }; + case 1: + { + + + if (state==0) + { + + + //apply an impulse + if (m_dynamicsWorld) + { + btCollisionWorld::ClosestRayResultCallback rayCallback(m_cameraPosition,rayTo); + m_dynamicsWorld->rayTest(m_cameraPosition,rayTo,rayCallback); + if (rayCallback.HasHit()) + { + + btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject); + if (body) + { + body->setActivationState(ACTIVE_TAG); + btVector3 impulse = rayTo; + impulse.normalize(); + float impulseStrength = 10.f; + impulse *= impulseStrength; + btVector3 relPos = rayCallback.m_hitPointWorld - body->getCenterOfMassPosition(); + body->applyImpulse(impulse,relPos); + } + } + } + + + + } else + { + + } + break; + } + case 0: + { + if (state==0) + { + + + //add a point to point constraint for picking + if (m_dynamicsWorld) + { + btCollisionWorld::ClosestRayResultCallback rayCallback(m_cameraPosition,rayTo); + m_dynamicsWorld->rayTest(m_cameraPosition,rayTo,rayCallback); + if (rayCallback.HasHit()) + { + + + btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject); + if (body) + { + //other exclusions? + if (!(body->isStaticObject() || body->isKinematicObject())) + { + pickedBody = body; + pickedBody->setActivationState(DISABLE_DEACTIVATION); + + + btVector3 pickPos = rayCallback.m_hitPointWorld; + + btVector3 localPivot = body->getCenterOfMassTransform().inverse() * pickPos; + + btPoint2PointConstraint* p2p = new btPoint2PointConstraint(*body,localPivot); + m_dynamicsWorld->addConstraint(p2p); + m_pickConstraint = p2p; + + //save mouse position for dragging + gOldPickingPos = rayTo; + + btVector3 eyePos(m_cameraPosition[0],m_cameraPosition[1],m_cameraPosition[2]); + + gOldPickingDist = (pickPos-eyePos).length(); + + //very weak constraint for picking + p2p->m_setting.m_tau = 0.1f; + } + } + } + } + + } else + { + + if (m_pickConstraint && m_dynamicsWorld) + { + m_dynamicsWorld->removeConstraint(m_pickConstraint); + delete m_pickConstraint; + //printf("removed constraint %i",gPickingConstraintId); + m_pickConstraint = 0; + pickedBody->forceActivationState(ACTIVE_TAG); + pickedBody->setDeactivationTime( 0.f ); + pickedBody = 0; + } + + + } + + break; + + } + default: + { + } + } + +} + +void DemoApplication::mouseMotionFunc(int x,int y) +{ + + if (m_pickConstraint) + { + //move the constraint pivot + btPoint2PointConstraint* p2p = static_cast(m_pickConstraint); + if (p2p) + { + //keep it at the same picking distance + + btVector3 newRayTo = getRayTo(x,y); + btVector3 eyePos(m_cameraPosition[0],m_cameraPosition[1],m_cameraPosition[2]); + btVector3 dir = newRayTo-eyePos; + dir.normalize(); + dir *= gOldPickingDist; + + btVector3 newPos = eyePos + dir; + p2p->setPivotB(newPos); + } + + } + + +} + + + +btRigidBody* DemoApplication::localCreateRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape) +{ + //rigidbody is dynamic if and only if mass is non zero, otherwise static + bool isDynamic = (mass != 0.f); + + btVector3 localInertia(0,0,0); + if (isDynamic) + shape->calculateLocalInertia(mass,localInertia); + + //using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects + +#define USE_MOTIONSTATE 1 +#ifdef USE_MOTIONSTATE + btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform); + btRigidBody* body = new btRigidBody(mass,myMotionState,shape,localInertia); + +#else + btRigidBody* body = new btRigidBody(mass,0,shape,localInertia); + body->setWorldTransform(startTransform); +#endif// + m_dynamicsWorld->addRigidBody(body); + + return body; +} + +//See http://www.lighthouse3d.com/opengl/glut/index.php?bmpfontortho +void DemoApplication::setOrthographicProjection() +{ + + // switch to projection mode + glMatrixMode(GL_PROJECTION); + // save previous matrix which contains the + //settings for the perspective projection + glPushMatrix(); + // reset matrix + glLoadIdentity(); + // set a 2D orthographic projection + gluOrtho2D(0, m_glutScreenWidth, 0, m_glutScreenHeight); + // invert the y axis, down is positive + glScalef(1, -1, 1); + // mover the origin from the bottom left corner + // to the upper left corner + glTranslatef(0, -m_glutScreenHeight, 0); + glMatrixMode(GL_MODELVIEW); +} + +void DemoApplication::resetPerspectiveProjection() +{ + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); +} + + +void DemoApplication::renderme() +{ + updateCamera(); + + btScalar m[16]; + + if (m_dynamicsWorld) + { + int numObjects = m_dynamicsWorld->getNumCollisionObjects(); + btVector3 wireColor(1,0,0); + for (int i=0;igetCollisionObjectArray()[i]; + btRigidBody* body = btRigidBody::upcast(colObj); + + if (body && body->getMotionState()) + { + btDefaultMotionState* myMotionState = (btDefaultMotionState*)body->getMotionState(); + myMotionState->m_graphicsWorldTrans.getOpenGLMatrix(m); + } else + { + colObj->getWorldTransform().getOpenGLMatrix(m); + } + + btVector3 wireColor(1.f,1.0f,0.5f); //wants deactivation + if (i & 1) + { + wireColor = btVector3(0.f,0.0f,1.f); + } + ///color differently for active, sleeping, wantsdeactivation states + if (colObj->getActivationState() == 1) //active + { + if (i & 1) + { + wireColor += btVector3 (1.f,0.f,0.f); + } else + { + wireColor += btVector3 (.5f,0.f,0.f); + } + } + if (colObj->getActivationState() == 2) //ISLAND_SLEEPING + { + if (i & 1) + { + wireColor += btVector3 (0.f,1.f, 0.f); + } else + { + wireColor += btVector3 (0.f,0.5f,0.f); + } + } + + GL_ShapeDrawer::drawOpenGL(m,colObj->getCollisionShape(),wireColor,getDebugMode()); + } + + + float xOffset = 10.f; + float yStart = 20.f; + float yIncr = 20.f; + char buf[124]; + + glDisable(GL_LIGHTING); + glColor3f(0, 0, 0); + + if ((m_debugMode & btIDebugDraw::DBG_NoHelpText)==0) + { + setOrthographicProjection(); + + #ifdef USE_QUICKPROF + + + if ( getDebugMode() & btIDebugDraw::DBG_ProfileTimings) + { + static int counter = 0; + counter++; + std::map::iterator iter; + for (iter = btProfiler::mProfileBlocks.begin(); iter != btProfiler::mProfileBlocks.end(); ++iter) + { + char blockTime[128]; + sprintf(blockTime, "%s: %lf",&((*iter).first[0]),btProfiler::getBlockTime((*iter).first, btProfiler::BLOCK_CYCLE_SECONDS));//BLOCK_TOTAL_PERCENT)); + glRasterPos3f(xOffset,yStart,0); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),blockTime); + yStart += yIncr; + + } + + } + #endif //USE_QUICKPROF + + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"mouse to interact"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"space to reset"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"cursor keys and z,x to navigate"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"i to toggle simulation, s single step"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"q to quit"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,". to shoot box"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + // not yet hooked up again after refactoring... + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"d to toggle deactivation"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"g to toggle mesh animation (ConcaveDemo)"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"h to toggle help text"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"p to toggle profiling (+results to file)"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + + //bool useBulletLCP = !(getDebugMode() & btIDebugDraw::DBG_DisableBulletLCP); + //bool useCCD = (getDebugMode() & btIDebugDraw::DBG_EnableCCD); + //glRasterPos3f(xOffset,yStart,0); + //sprintf(buf,"1 CCD mode (adhoc) = %i",useCCD); + //BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + //yStart += yIncr; + + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"+- shooting speed = %10.2f",m_ShootBoxInitialSpeed); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + +#ifdef SHOW_NUM_DEEP_PENETRATIONS + + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"gNumDeepPenetrationChecks = %d",gNumDeepPenetrationChecks); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"gNumGjkChecks= %d",gNumGjkChecks); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"gNumAlignedAllocs = %d",gNumAlignedAllocs); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"gNumAlignedFree= %d",gNumAlignedFree); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"# alloc-free = %d",gNumAlignedAllocs-gNumAlignedFree); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + +//enable BT_DEBUG_MEMORY_ALLOCATIONS define in Bullet/src/LinearMath/btAlignedAllocator.h for memory leak detection +#ifdef BT_DEBUG_MEMORY_ALLOCATIONS + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"gTotalBytesAlignedAllocs = %d",gTotalBytesAlignedAllocs); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; +#endif //BT_DEBUG_MEMORY_ALLOCATIONS + + if (getDynamicsWorld()) + { + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"# objects = %d",getDynamicsWorld()->getNumCollisionObjects()); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"# pairs = %d",getDynamicsWorld()->getBroadphase()->getOverlappingPairCache()->getNumOverlappingPairs()); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + } + + +#endif //SHOW_NUM_DEEP_PENETRATIONS + + resetPerspectiveProjection(); + } + + glEnable(GL_LIGHTING); + + + } + +} + +void DemoApplication::clientResetScene() +{ +#ifdef SHOW_NUM_DEEP_PENETRATIONS + gNumDeepPenetrationChecks = 0; + gNumGjkChecks = 0; +#endif //SHOW_NUM_DEEP_PENETRATIONS + + int numObjects = 0; + if (m_dynamicsWorld) + { + m_dynamicsWorld->stepSimulation(1.f/60.f,0); + numObjects = m_dynamicsWorld->getNumCollisionObjects(); + } + + for (int i=0;igetCollisionObjectArray()[i]; + btRigidBody* body = btRigidBody::upcast(colObj); + if (body) + { + if (body->getMotionState()) + { + btDefaultMotionState* myMotionState = (btDefaultMotionState*)body->getMotionState(); + myMotionState->m_graphicsWorldTrans = myMotionState->m_startWorldTrans; + colObj->setWorldTransform( myMotionState->m_graphicsWorldTrans ); + colObj->setInterpolationWorldTransform( myMotionState->m_startWorldTrans ); + colObj->activate(); + } + //removed cached contact points + m_dynamicsWorld->getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(colObj->getBroadphaseHandle(),getDynamicsWorld()->getDispatcher()); + + btRigidBody* body = btRigidBody::upcast(colObj); + if (body && !body->isStaticObject()) + { + btRigidBody::upcast(colObj)->setLinearVelocity(btVector3(0,0,0)); + btRigidBody::upcast(colObj)->setAngularVelocity(btVector3(0,0,0)); + } + } + + /* + //quickly search some issue at a certain simulation frame, pressing space to reset + int fixed=18; + for (int i=0;istepSimulation(1./60.f,1); + } + */ + } +} diff --git a/src/bullet/Demos/OpenGL/DemoApplication.h b/src/bullet/Demos/OpenGL/DemoApplication.h new file mode 100644 index 000000000..0c4585b54 --- /dev/null +++ b/src/bullet/Demos/OpenGL/DemoApplication.h @@ -0,0 +1,191 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef DEMO_APPLICATION_H +#define DEMO_APPLICATION_H + + +#ifdef WIN32//for glut.h +#include +#endif + +//think different +#if defined(__APPLE__) && !defined (VMDMESA) +#include +#include +#include +#else +#include +#endif + +#include +#include +#include + + +#include "LinearMath/btVector3.h" +#include "LinearMath/btMatrix3x3.h" +#include "LinearMath/btTransform.h" +#include "LinearMath/btQuickprof.h" + +class btCollisionShape; +class btDynamicsWorld; +class btRigidBody; +class btTypedConstraint; + +class DemoApplication +{ + + protected: + + btClock m_clock; + + ///this is the most important class + btDynamicsWorld* m_dynamicsWorld; + + ///constraint for mouse picking + btTypedConstraint* m_pickConstraint; + + btCollisionShape* m_shootBoxShape; + + float m_cameraDistance; + int m_debugMode; + + float m_ele; + float m_azi; + btVector3 m_cameraPosition; + btVector3 m_cameraTargetPosition;//look at + + float m_scaleBottom; + float m_scaleFactor; + btVector3 m_cameraUp; + int m_forwardAxis; + + int m_glutScreenWidth; + int m_glutScreenHeight; + + float m_ShootBoxInitialSpeed; + + bool m_stepping; + bool m_singleStep; + bool m_idle; + int m_lastKey; + +public: + + DemoApplication(); + + virtual ~DemoApplication(); + + btDynamicsWorld* getDynamicsWorld() + { + return m_dynamicsWorld; + } + + void setOrthographicProjection(); + void resetPerspectiveProjection(); + + int getDebugMode() + { + return m_debugMode ; + } + + void setDebugMode(int mode); + + + void setCameraUp(const btVector3& camUp) + { + m_cameraUp = camUp; + } + void setCameraForwardAxis(int axis) + { + m_forwardAxis = axis; + } + + void myinit(); + + void toggleIdle(); + + virtual void updateCamera(); + + btVector3 getCameraPosition() + { + return m_cameraPosition; + } + btVector3 getCameraTargetPosition() + { + return m_cameraTargetPosition; + } + + + ///glut callbacks + + float getCameraDistance(); + void setCameraDistance(float dist); + void moveAndDisplay(); + + virtual void clientMoveAndDisplay() = 0; + + virtual void clientResetScene(); + + ///Demo functions + void shootBox(const btVector3& destination); + + + btVector3 getRayTo(int x,int y); + + btRigidBody* localCreateRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape); + + ///callback methods by glut + + virtual void keyboardCallback(unsigned char key, int x, int y); + + virtual void specialKeyboard(int key, int x, int y); + + virtual void specialKeyboardUp(int key, int x, int y); + + virtual void reshape(int w, int h); + + virtual void mouseFunc(int button, int state, int x, int y); + + virtual void mouseMotionFunc(int x,int y); + + virtual void displayCallback(); + + virtual void renderme(); + + + void stepLeft(); + void stepRight(); + void stepFront(); + void stepBack(); + void zoomIn(); + void zoomOut(); + + bool isIdle() const + { + return m_idle; + } + + void setIdle(bool idle) + { + m_idle = idle; + } + + +}; + +#endif //DEMO_APPLICATION_H + diff --git a/src/bullet/Demos/OpenGL/GLDebugDrawer.cpp b/src/bullet/Demos/OpenGL/GLDebugDrawer.cpp new file mode 100644 index 000000000..3995a6e75 --- /dev/null +++ b/src/bullet/Demos/OpenGL/GLDebugDrawer.cpp @@ -0,0 +1,78 @@ + +#include "GLDebugDrawer.h" +#include "LinearMath/btPoint3.h" + +#ifdef WIN32 //needed for glut.h +#include +#endif + +//think different +#if defined(__APPLE__) && !defined (VMDMESA) +#include +#include +#include +#else +#include +#endif + +#include "BMF_Api.h" +#include //printf debugging +GLDebugDrawer::GLDebugDrawer() +:m_debugMode(0) +{ + +} +void GLDebugDrawer::drawLine(const btVector3& from,const btVector3& to,const btVector3& color) +{ + if (m_debugMode > 0) + { + glBegin(GL_LINES); + glColor3f(color.getX(), color.getY(), color.getZ()); + glVertex3d(from.getX(), from.getY(), from.getZ()); + glVertex3d(to.getX(), to.getY(), to.getZ()); + glEnd(); + } +} + +void GLDebugDrawer::setDebugMode(int debugMode) +{ + m_debugMode = debugMode; + +} + +void GLDebugDrawer::draw3dText(const btVector3& location,const char* textString) +{ + glRasterPos3f(location.x(), location.y(), location.z()); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),textString); +} + +void GLDebugDrawer::reportErrorWarning(const char* warningString) +{ + printf(warningString); +} + +void GLDebugDrawer::drawContactPoint(const btVector3& pointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color) +{ + if (m_debugMode & btIDebugDraw::DBG_DrawContactPoints) + { + btVector3 to=pointOnB+normalOnB*distance; + const btVector3&from = pointOnB; + glBegin(GL_LINES); + glColor3f(color.getX(), color.getY(), color.getZ()); + glVertex3d(from.getX(), from.getY(), from.getZ()); + glVertex3d(to.getX(), to.getY(), to.getZ()); + glEnd(); + + + glRasterPos3f(from.x(), from.y(), from.z()); + char buf[12]; + sprintf(buf," %d",lifeTime); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + + + } +} + + + + diff --git a/src/bullet/Demos/OpenGL/GLDebugDrawer.h b/src/bullet/Demos/OpenGL/GLDebugDrawer.h new file mode 100644 index 000000000..491d43295 --- /dev/null +++ b/src/bullet/Demos/OpenGL/GLDebugDrawer.h @@ -0,0 +1,31 @@ +#ifndef GL_DEBUG_DRAWER_H +#define GL_DEBUG_DRAWER_H + +#include "LinearMath/btIDebugDraw.h" + + + +class GLDebugDrawer : public btIDebugDraw +{ + int m_debugMode; + +public: + + GLDebugDrawer(); + + + virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color); + + virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color); + + virtual void reportErrorWarning(const char* warningString); + + virtual void draw3dText(const btVector3& location,const char* textString); + + virtual void setDebugMode(int debugMode); + + virtual int getDebugMode() const { return m_debugMode;} + +}; + +#endif//GL_DEBUG_DRAWER_H diff --git a/src/bullet/Demos/OpenGL/GL_ShapeDrawer.cpp b/src/bullet/Demos/OpenGL/GL_ShapeDrawer.cpp new file mode 100644 index 000000000..255ea1246 --- /dev/null +++ b/src/bullet/Demos/OpenGL/GL_ShapeDrawer.cpp @@ -0,0 +1,597 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifdef WIN32 //needed for glut.h +#include +#endif + +//think different +#if defined(__APPLE__) && !defined (VMDMESA) +#include +#include +#include +#else +#include +#endif + +#include "GlutStuff.h" +#include "GL_ShapeDrawer.h" +#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h" +#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h" +#include "BulletCollision/CollisionShapes/btBoxShape.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" +#include "BulletCollision/CollisionShapes/btConeShape.h" +#include "BulletCollision/CollisionShapes/btCylinderShape.h" +#include "BulletCollision/CollisionShapes/btTetrahedronShape.h" +#include "BulletCollision/CollisionShapes/btCompoundShape.h" +#include "BulletCollision/CollisionShapes/btCapsuleShape.h" +#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h" +#include "BulletCollision/CollisionShapes/btUniformScalingShape.h" + + + +#include "LinearMath/btIDebugDraw.h" +//for debugmodes +#include "BMF_Api.h" +#include //printf debugging + +//#define USE_DISPLAY_LISTS 1 +#ifdef USE_DISPLAY_LISTS + +#include + +using namespace std; + +//Set for storing Display list per trimesh +struct TRIMESH_KEY +{ + btCollisionShape* m_shape; + GLuint m_dlist;//OpenGL display list +}; + +typedef map TRIMESH_KEY_MAP; + +typedef pair TRIMESH_KEY_PAIR; + +TRIMESH_KEY_MAP g_display_lists; + +class GlDisplaylistDrawcallback : public btTriangleCallback +{ +public: + + virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex) + { + + btVector3 diff1 = triangle[1] - triangle[0]; + btVector3 diff2 = triangle[2] - triangle[0]; + btVector3 normal = diff1.cross(diff2); + + normal.normalize(); + + glBegin(GL_TRIANGLES); + glColor3f(0, 1, 0); + glNormal3d(normal.getX(),normal.getY(),normal.getZ()); + glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ()); + + glColor3f(0, 1, 0); + glNormal3d(normal.getX(),normal.getY(),normal.getZ()); + glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ()); + + glColor3f(0, 1, 0); + glNormal3d(normal.getX(),normal.getY(),normal.getZ()); + glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ()); + glEnd(); + + /*glBegin(GL_LINES); + glColor3f(1, 1, 0); + glNormal3d(normal.getX(),normal.getY(),normal.getZ()); + glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ()); + glNormal3d(normal.getX(),normal.getY(),normal.getZ()); + glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ()); + glColor3f(1, 1, 0); + glNormal3d(normal.getX(),normal.getY(),normal.getZ()); + glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ()); + glNormal3d(normal.getX(),normal.getY(),normal.getZ()); + glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ()); + glColor3f(1, 1, 0); + glNormal3d(normal.getX(),normal.getY(),normal.getZ()); + glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ()); + glNormal3d(normal.getX(),normal.getY(),normal.getZ()); + glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ()); + glEnd();*/ + + + } +}; + +GLuint OGL_get_displaylist_for_shape(btCollisionShape * shape) +{ + TRIMESH_KEY_MAP::iterator map_iter; + + unsigned long key = (unsigned long)shape; + map_iter = g_display_lists.find(key); + if(map_iter!=g_display_lists.end()) + { + return map_iter->second.m_dlist; + } + + return 0; +} + +void OGL_displaylist_clean() +{ + TRIMESH_KEY_MAP::iterator map_iter,map_itend; + + map_iter = g_display_lists.begin(); + + while(map_iter!=map_itend) + { + glDeleteLists(map_iter->second.m_dlist,1); + map_iter++; + } + + g_display_lists.clear(); +} + + +void OGL_displaylist_register_shape(btCollisionShape * shape) +{ + btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + btVector3 aabbMin(-btScalar(1e30),-btScalar(1e30),-btScalar(1e30)); + GlDisplaylistDrawcallback drawCallback; + TRIMESH_KEY dlist; + + dlist.m_dlist = glGenLists(1); + dlist.m_shape = shape; + + unsigned long key = (unsigned long)shape; + + g_display_lists.insert(TRIMESH_KEY_PAIR(key,dlist)); + + glNewList(dlist.m_dlist,GL_COMPILE); + + glEnable(GL_CULL_FACE); + + glCullFace(GL_BACK); + + if (shape->isConcave()) + { + btConcaveShape* concaveMesh = (btConcaveShape*) shape; + //todo pass camera, for some culling + concaveMesh->processAllTriangles(&drawCallback,aabbMin,aabbMax); + } + + glDisable(GL_CULL_FACE); + + glEndList(); +} +#endif //USE_DISPLAY_LISTS + +void GL_ShapeDrawer::drawCoordSystem() { + glBegin(GL_LINES); + glColor3f(1, 0, 0); + glVertex3d(0, 0, 0); + glVertex3d(1, 0, 0); + glColor3f(0, 1, 0); + glVertex3d(0, 0, 0); + glVertex3d(0, 1, 0); + glColor3f(0, 0, 1); + glVertex3d(0, 0, 0); + glVertex3d(0, 0, 1); + glEnd(); + +} + + + + + +class GlDrawcallback : public btTriangleCallback +{ + +public: + + bool m_wireframe; + + GlDrawcallback() + :m_wireframe(false) + { + } + + virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex) + { + + (void)triangleIndex; + (void)partId; + + + if (m_wireframe) + { + glBegin(GL_LINES); + glColor3f(1, 0, 0); + glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ()); + glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ()); + glColor3f(0, 1, 0); + glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ()); + glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ()); + glColor3f(0, 0, 1); + glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ()); + glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ()); + glEnd(); + } else + { + glBegin(GL_TRIANGLES); + glColor3f(1, 0, 0); + glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ()); + glColor3f(0, 1, 0); + glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ()); + glColor3f(0, 0, 1); + glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ()); + glEnd(); + } + } +}; + +class TriangleGlDrawcallback : public btInternalTriangleIndexCallback +{ +public: + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + { + (void)triangleIndex; + (void)partId; + + + glBegin(GL_TRIANGLES);//LINES); + glColor3f(1, 0, 0); + glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ()); + glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ()); + glColor3f(0, 1, 0); + glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ()); + glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ()); + glColor3f(0, 0, 1); + glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ()); + glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ()); + glEnd(); + } +}; + +void GL_ShapeDrawer::drawCylinder(float radius,float halfHeight, int upAxis) +{ + + + glPushMatrix(); + switch (upAxis) + { + case 0: + glRotatef(-90.0, 0.0, 1.0, 0.0); + glTranslatef(0.0, 0.0, -halfHeight); + break; + case 1: + glRotatef(-90.0, 1.0, 0.0, 0.0); + glTranslatef(0.0, 0.0, -halfHeight); + break; + case 2: + + glTranslatef(0.0, 0.0, -halfHeight); + break; + default: + { + assert(0); + } + + } + + GLUquadricObj *quadObj = gluNewQuadric(); + + //The gluCylinder subroutine draws a cylinder that is oriented along the z axis. + //The base of the cylinder is placed at z = 0; the top of the cylinder is placed at z=height. + //Like a sphere, the cylinder is subdivided around the z axis into slices and along the z axis into stacks. + + gluQuadricDrawStyle(quadObj, (GLenum)GLU_FILL); + gluQuadricNormals(quadObj, (GLenum)GLU_SMOOTH); + + + gluCylinder(quadObj, radius, radius, 2.f*halfHeight, 15, 10); + glPopMatrix(); + gluDeleteQuadric(quadObj); +} + +void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, const btVector3& color,int debugMode) +{ + + + glPushMatrix(); + btglMultMatrix(m); + + if (shape->getShapeType() == UNIFORM_SCALING_SHAPE_PROXYTYPE) + { + const btUniformScalingShape* scalingShape = static_cast(shape); + const btConvexShape* convexShape = scalingShape->getChildShape(); + float scalingFactor = (float)scalingShape->getUniformScalingFactor(); + { + btScalar tmpScaling[4][4]={{scalingFactor,0,0,0}, + {0,scalingFactor,0,0}, + {0,0,scalingFactor,0}, + {0,0,0,1}}; + + drawOpenGL( (btScalar*)tmpScaling,convexShape,color,debugMode); + } + glPopMatrix(); + return; + } + + if (shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE) + { + const btCompoundShape* compoundShape = static_cast(shape); + for (int i=compoundShape->getNumChildShapes()-1;i>=0;i--) + { + btTransform childTrans = compoundShape->getChildTransform(i); + const btCollisionShape* colShape = compoundShape->getChildShape(i); + btScalar childMat[16]; + childTrans.getOpenGLMatrix(childMat); + drawOpenGL(childMat,colShape,color,debugMode); + } + + } else + { + //drawCoordSystem(); + + //glPushMatrix(); + glEnable(GL_COLOR_MATERIAL); + glColor3f(color.x(),color.y(), color.z()); + + + + bool useWireframeFallback = true; + + if (!(debugMode & btIDebugDraw::DBG_DrawWireframe)) + { + switch (shape->getShapeType()) + { + case BOX_SHAPE_PROXYTYPE: + { + const btBoxShape* boxShape = static_cast(shape); + btVector3 halfExtent = boxShape->getHalfExtentsWithMargin(); + glScaled(2*halfExtent[0], 2*halfExtent[1], 2*halfExtent[2]); + glutSolidCube(1.0); + useWireframeFallback = false; + break; + } + case TRIANGLE_SHAPE_PROXYTYPE: + case TETRAHEDRAL_SHAPE_PROXYTYPE: + { + //todo: +// useWireframeFallback = false; + break; + } + case CONVEX_HULL_SHAPE_PROXYTYPE: + break; + case SPHERE_SHAPE_PROXYTYPE: + { + const btSphereShape* sphereShape = static_cast(shape); + float radius = sphereShape->getMargin();//radius doesn't include the margin, so draw with margin + glutSolidSphere(radius,10,10); + useWireframeFallback = false; + break; + } + case CAPSULE_SHAPE_PROXYTYPE: + { + const btCapsuleShape* capsuleShape = static_cast(shape); + float radius = capsuleShape->getRadius(); + float halfHeight = capsuleShape->getHalfHeight(); + int upAxis = 1; + + drawCylinder(radius,halfHeight,upAxis); + + + glPushMatrix(); + glTranslatef(0.0, -halfHeight,0.0); + glutSolidSphere(radius,10,10); + glTranslatef(0.0, 2*halfHeight,0.0); + glutSolidSphere(radius,10,10); + glPopMatrix(); + useWireframeFallback = false; + break; + } + case MULTI_SPHERE_SHAPE_PROXYTYPE: + { + break; + } + case CONE_SHAPE_PROXYTYPE: + { + const btConeShape* coneShape = static_cast(shape); + int upIndex = coneShape->getConeUpIndex(); + float radius = coneShape->getRadius();//+coneShape->getMargin(); + float height = coneShape->getHeight();//+coneShape->getMargin(); + switch (upIndex) + { + case 0: + glRotatef(90.0, 0.0, 1.0, 0.0); + break; + case 1: + glRotatef(-90.0, 1.0, 0.0, 0.0); + break; + case 2: + break; + default: + { + } + }; + + glTranslatef(0.0, 0.0, -0.5*height); + glutSolidCone(radius,height,10,10); + useWireframeFallback = false; + break; + + } + case CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE: + { + useWireframeFallback = false; + break; + } + + case CONVEX_SHAPE_PROXYTYPE: + case CYLINDER_SHAPE_PROXYTYPE: + { + const btCylinderShape* cylinder = static_cast(shape); + int upAxis = cylinder->getUpAxis(); + + + float radius = cylinder->getRadius(); + float halfHeight = cylinder->getHalfExtentsWithMargin()[upAxis]; + + drawCylinder(radius,halfHeight,upAxis); + + break; + } + default: + { + } + + }; + + } + + + + + if (useWireframeFallback) + { + /// for polyhedral shapes + if (shape->isPolyhedral()) + { + btPolyhedralConvexShape* polyshape = (btPolyhedralConvexShape*) shape; + + + glBegin(GL_LINES); + + + int i; + for (i=0;igetNumEdges();i++) + { + btPoint3 a,b; + polyshape->getEdge(i,a,b); + + glVertex3f(a.getX(),a.getY(),a.getZ()); + glVertex3f(b.getX(),b.getY(),b.getZ()); + + + } + glEnd(); + + + if (debugMode==btIDebugDraw::DBG_DrawFeaturesText) + { + glRasterPos3f(0.0, 0.0, 0.0); + //BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),polyshape->getExtraDebugInfo()); + + glColor3f(1.f, 1.f, 1.f); + for (i=0;igetNumVertices();i++) + { + btPoint3 vtx; + polyshape->getVertex(i,vtx); + glRasterPos3f(vtx.x(), vtx.y(), vtx.z()); + char buf[12]; + sprintf(buf," %d",i); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + } + + for (i=0;igetNumPlanes();i++) + { + btVector3 normal; + btPoint3 vtx; + polyshape->getPlane(normal,vtx,i); + btScalar d = vtx.dot(normal); + + glRasterPos3f(normal.x()*d, normal.y()*d, normal.z()*d); + char buf[12]; + sprintf(buf," plane %d",i); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + + } + } + + + } + } + + +#ifdef USE_DISPLAY_LISTS + + if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE||shape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE) + { + GLuint dlist = OGL_get_displaylist_for_shape((btCollisionShape * )shape); + if (dlist) + { + glCallList(dlist); + } + else + { +#else + if (shape->isConcave())//>getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE||shape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE) +// if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) + { + btConcaveShape* concaveMesh = (btConcaveShape*) shape; + //btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + //btVector3 aabbMax(100,100,100);//btScalar(1e30),btScalar(1e30),btScalar(1e30)); + + //todo pass camera, for some culling + btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + btVector3 aabbMin(-btScalar(1e30),-btScalar(1e30),-btScalar(1e30)); + + GlDrawcallback drawCallback; + drawCallback.m_wireframe = (debugMode & btIDebugDraw::DBG_DrawWireframe)!=0; + + concaveMesh->processAllTriangles(&drawCallback,aabbMin,aabbMax); + + } +#endif + +#ifdef USE_DISPLAY_LISTS + } + } +#endif + + if (shape->getShapeType() == CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE) + { + btConvexTriangleMeshShape* convexMesh = (btConvexTriangleMeshShape*) shape; + + //todo: pass camera for some culling + btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + btVector3 aabbMin(-btScalar(1e30),-btScalar(1e30),-btScalar(1e30)); + TriangleGlDrawcallback drawCallback; + convexMesh->getMeshInterface()->InternalProcessAllTriangles(&drawCallback,aabbMin,aabbMax); + + } + + + glDisable(GL_DEPTH_BUFFER_BIT); + glRasterPos3f(0,0,0);//mvtx.x(), vtx.y(), vtx.z()); + if (debugMode&btIDebugDraw::DBG_DrawText) + { + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->getName()); + } + + if (debugMode& btIDebugDraw::DBG_DrawFeaturesText) + { + //BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->getExtraDebugInfo()); + } + glEnable(GL_DEPTH_BUFFER_BIT); + + // glPopMatrix(); + } + glPopMatrix(); + +} diff --git a/src/bullet/Demos/OpenGL/GL_ShapeDrawer.h b/src/bullet/Demos/OpenGL/GL_ShapeDrawer.h new file mode 100644 index 000000000..84315d40b --- /dev/null +++ b/src/bullet/Demos/OpenGL/GL_ShapeDrawer.h @@ -0,0 +1,34 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef GL_SHAPE_DRAWER_H +#define GL_SHAPE_DRAWER_H + +class btCollisionShape; +#include "LinearMath/btVector3.h" + +/// OpenGL shape drawing +class GL_ShapeDrawer +{ + public: + + static void drawOpenGL(btScalar* m, const btCollisionShape* shape, const btVector3& color,int debugMode); + static void drawCoordSystem(); + static void drawCylinder(float radius,float halfHeight, int upAxis); +}; + +void OGL_displaylist_register_shape(btCollisionShape * shape); +void OGL_displaylist_clean(); + +#endif //GL_SHAPE_DRAWER_H diff --git a/src/bullet/Demos/OpenGL/GL_Simplex1to4.cpp b/src/bullet/Demos/OpenGL/GL_Simplex1to4.cpp new file mode 100644 index 000000000..5adf2e485 --- /dev/null +++ b/src/bullet/Demos/OpenGL/GL_Simplex1to4.cpp @@ -0,0 +1,76 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#include "GL_Simplex1to4.h" +#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h" +#include "GL_ShapeDrawer.h" +#ifdef WIN32 +#include +#endif + +//think different +#if defined(__APPLE__) && !defined (VMDMESA) +#include +#include +#else +#include +#endif +#include "GlutStuff.h" +#include "LinearMath/btTransform.h" + +GL_Simplex1to4::GL_Simplex1to4() +:m_simplexSolver(0) +{ +} + +/// +/// Debugging method calcClosest calculates the closest point to the origin, using m_simplexSolver +/// +void GL_Simplex1to4::calcClosest(btScalar* m) +{ + btTransform tr; + tr.setFromOpenGLMatrix(m); + + + + GL_ShapeDrawer::drawCoordSystem(); + + if (m_simplexSolver) + { + m_simplexSolver->reset(); + bool res; + + btVector3 v; + + for (int i=0;iaddVertex(v,v,btPoint3(0.f,0.f,0.f)); + res = m_simplexSolver->closest(v); + } + + //draw v? + glDisable(GL_LIGHTING); + glBegin(GL_LINES); + btglColor3(1.f, 0.f, 0.f); + btglVertex3(0.f, 0.f, 0.f); + btglVertex3(v.x(),v.y(),v.z()); + glEnd(); + + glEnable(GL_LIGHTING); + + + } + +} diff --git a/src/bullet/Demos/OpenGL/GL_Simplex1to4.h b/src/bullet/Demos/OpenGL/GL_Simplex1to4.h new file mode 100644 index 000000000..c75e3573b --- /dev/null +++ b/src/bullet/Demos/OpenGL/GL_Simplex1to4.h @@ -0,0 +1,40 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef GL_SIMPLEX_1TO4_H +#define GL_SIMPLEX_1TO4_H + +#include "BulletCollision/CollisionShapes/btTetrahedronShape.h" + +#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h" + +///GL_Simplex1to4 is a class to debug a Simplex Solver with 1 to 4 points. +///Can be used by GJK. +class GL_Simplex1to4 : public btBU_Simplex1to4 +{ + btSimplexSolverInterface* m_simplexSolver; + + public: + + GL_Simplex1to4(); + + void calcClosest(btScalar* m); + + void setSimplexSolver(btSimplexSolverInterface* simplexSolver) { + m_simplexSolver = simplexSolver; + } + +}; + +#endif //GL_SIMPLEX_1TO4_H diff --git a/src/bullet/Demos/OpenGL/GlutStuff.cpp b/src/bullet/Demos/OpenGL/GlutStuff.cpp new file mode 100644 index 000000000..65a603aea --- /dev/null +++ b/src/bullet/Demos/OpenGL/GlutStuff.cpp @@ -0,0 +1,97 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "DemoApplication.h" + +//glut is C code, this global gDemoApplication links glut to the C++ demo +static DemoApplication* gDemoApplication = 0; + + +#include "GlutStuff.h" + +static void glutKeyboardCallback(unsigned char key, int x, int y) +{ + gDemoApplication->keyboardCallback(key,x,y); +} + +static void glutSpecialKeyboardCallback(int key, int x, int y) +{ + gDemoApplication->specialKeyboard(key,x,y); +} + +static void glutSpecialKeyboardUpCallback(int key, int x, int y) +{ + gDemoApplication->specialKeyboardUp(key,x,y); +} + + +static void glutReshapeCallback(int w, int h) +{ + gDemoApplication->reshape(w,h); +} + +static void glutMoveAndDisplayCallback() +{ + gDemoApplication->moveAndDisplay(); +} + +static void glutMouseFuncCallback(int button, int state, int x, int y) +{ + gDemoApplication->mouseFunc(button,state,x,y); +} + + +static void glutMotionFuncCallback(int x,int y) +{ + gDemoApplication->mouseMotionFunc(x,y); +} + + +static void glutDisplayCallback(void) +{ + gDemoApplication->displayCallback(); +} + + + +int glutmain(int argc, char **argv,int width,int height,const char* title,DemoApplication* demoApp) { + + gDemoApplication = demoApp; + + glutInit(&argc, argv); + glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); + glutInitWindowPosition(0, 0); + glutInitWindowSize(width, height); + glutCreateWindow(title); + + gDemoApplication->myinit(); + + glutKeyboardFunc(glutKeyboardCallback); + glutSpecialFunc(glutSpecialKeyboardCallback); + glutSpecialUpFunc(glutSpecialKeyboardUpCallback); + + glutReshapeFunc(glutReshapeCallback); + //createMenu(); + glutIdleFunc(glutMoveAndDisplayCallback); + glutMouseFunc(glutMouseFuncCallback); + glutMotionFunc(glutMotionFuncCallback); + glutDisplayFunc( glutDisplayCallback ); + + glutMoveAndDisplayCallback(); + + glutMainLoop(); + return 0; +} diff --git a/src/bullet/Demos/OpenGL/GlutStuff.h b/src/bullet/Demos/OpenGL/GlutStuff.h new file mode 100644 index 000000000..1ee2ba7d1 --- /dev/null +++ b/src/bullet/Demos/OpenGL/GlutStuff.h @@ -0,0 +1,34 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef GLUT_STUFF_H +#define GLUT_STUFF_H + +class DemoApplication; + +int glutmain(int argc, char **argv,int width,int height,const char* title,DemoApplication* demoApp); + +#if defined(BT_USE_DOUBLE_PRECISION) +#define btglLoadMatrix glLoadMatrixd +#define btglMultMatrix glMultMatrixd +#define btglColor3 glColor3d +#define btglVertex3 glVertex3d +#else +#define btglLoadMatrix glLoadMatrixf +#define btglMultMatrix glMultMatrixf +#define btglColor3 glColor3f +#define btglVertex3 glVertex3d +#endif + +#endif //GLUT_STUFF_H diff --git a/src/bullet/Demos/OpenGL/Makefile.am b/src/bullet/Demos/OpenGL/Makefile.am new file mode 100644 index 000000000..f2052b9a3 --- /dev/null +++ b/src/bullet/Demos/OpenGL/Makefile.am @@ -0,0 +1,12 @@ +noinst_LIBRARIES = libbulletopenglsupport.a + +libbulletopenglsupport_a_SOURCES = \ + BMF_Api.cpp BMF_BitmapFont.h BMF_Fonts.h \ + DemoApplication.cpp GLDebugDrawer.h GL_Simplex1to4.cpp \ + GlutStuff.h BMF_Api.h BMF_FontData.h \ + BMF_Settings.h DemoApplication.h GL_ShapeDrawer.cpp \ + GL_Simplex1to4.h RenderTexture.cpp BMF_BitmapFont.cpp \ + BMF_font_helv10.cpp DebugCastResult.h GLDebugDrawer.cpp \ + GL_ShapeDrawer.h GlutStuff.cpp RenderTexture.h + +INCLUDES=-I../../src diff --git a/src/bullet/Demos/OpenGL/RenderTexture.cpp b/src/bullet/Demos/OpenGL/RenderTexture.cpp new file mode 100644 index 000000000..c958ae4d7 --- /dev/null +++ b/src/bullet/Demos/OpenGL/RenderTexture.cpp @@ -0,0 +1,73 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "RenderTexture.h" +#include +#include "BMF_FontData.h" + +renderTexture::renderTexture(int width,int height) +:m_height(height),m_width(width) +{ + m_buffer = new unsigned char[m_width*m_height*4]; + + //clear screen + memset(m_buffer,0,m_width*m_height*4); + + //clear screen version 2 + for (int x=0;xchars[c]; + + if (cd.data_offset!=-1) { + unsigned char* bitmap = &fontData->bitmap_data[cd.data_offset]; + for (int y=0;y>=1; + } + } + } + rasterposx+= cd.advance; + } +} + +renderTexture::~renderTexture() +{ + delete [] m_buffer; +} + + + diff --git a/src/bullet/Demos/OpenGL/RenderTexture.h b/src/bullet/Demos/OpenGL/RenderTexture.h new file mode 100644 index 000000000..1ced24773 --- /dev/null +++ b/src/bullet/Demos/OpenGL/RenderTexture.h @@ -0,0 +1,63 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef RENDER_TEXTURE_H +#define RENDER_TEXTURE_H + +#include "LinearMath/btVector3.h" +#include "BMF_FontData.h" + +/// +///renderTexture provides a software-render context (setpixel/printf) +/// +class renderTexture +{ + int m_height; + int m_width; + unsigned char* m_buffer; + +public: + + renderTexture(int width,int height); + ~renderTexture(); + + inline void setPixel(int x,int y,const btVector4& rgba) + { + unsigned char* pixel = &m_buffer[ (x+y*m_width) * 4]; + + pixel[0] = (unsigned char)(255*rgba.getX()); + pixel[1] = (unsigned char)(255*rgba.getY()); + pixel[2] = (unsigned char)(255*rgba.getZ()); + pixel[3] = (unsigned char)(255*rgba.getW()); + } + + inline btVector4 getPixel(int x,int y) + { + unsigned char* pixel = &m_buffer[ (x+y*m_width) * 4]; + return btVector4(pixel[0]*1.f/255.f, + pixel[1]*1.f/255.f, + pixel[2]*1.f/255.f, + pixel[3]*1.f/255.f); + } + + const unsigned char* getBuffer() const { return m_buffer;} + int getWidth() const { return m_width;} + int getHeight() const { return m_height;} + void grapicalPrintf(char* str, BMF_FontData* fontData, int startx = 0,int starty=0); + +}; + +#endif //RENDER_TEXTURE_H + diff --git a/src/bullet/LICENSE b/src/bullet/LICENSE new file mode 100644 index 000000000..ba24a53c2 --- /dev/null +++ b/src/bullet/LICENSE @@ -0,0 +1,19 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +All files in the Bullet/src folder are under this Zlib license. +Optional Extras/GIMPACT and Extras/GIMPACTBullet is also under ZLib license. Other optional external libraries in Extras/Demos have own license,see respective files. + +This means Bullet can freely be used in any software, including commercial and console software. A Playstation 3 optimized version is available through Sony. diff --git a/src/bullet/Makefile.am b/src/bullet/Makefile.am new file mode 100644 index 000000000..72093c850 --- /dev/null +++ b/src/bullet/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=src Demos/OpenGL \ No newline at end of file diff --git a/src/bullet/README b/src/bullet/README new file mode 100644 index 000000000..8f3705388 --- /dev/null +++ b/src/bullet/README @@ -0,0 +1,7 @@ + +Bullet is a 3D Collision Detection and Rigid Body Dynamics Library for games and animation. +Free for commercial use, including Playstation 3, open source under the ZLib License. +Discrete and continuous collision detection, integrated into Blender 3D, and COLLADA 1.4 Physics import. + +See the Bullet_User_Manual.pdf for more info and visit the Bullet Physics Forum at +http://bulletphysics.com diff --git a/src/bullet/VERSION b/src/bullet/VERSION new file mode 100644 index 000000000..43c134489 --- /dev/null +++ b/src/bullet/VERSION @@ -0,0 +1,3 @@ +Bullet Collision Detection and Physics Library version 2.64 +http://bullet.sourceforge.net + diff --git a/src/bullet/src/.deps/Bullet-C-API.Po b/src/bullet/src/.deps/Bullet-C-API.Po new file mode 100644 index 000000000..dc1d245a9 --- /dev/null +++ b/src/bullet/src/.deps/Bullet-C-API.Po @@ -0,0 +1,506 @@ +Bullet-C-API.o Bullet-C-API.o: BulletDynamics/Dynamics/Bullet-C-API.cpp \ + Bullet-C-Api.h btBulletDynamicsCommon.h btBulletCollisionCommon.h \ + BulletCollision/CollisionDispatch/btCollisionWorld.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btTransform.h \ + LinearMath/btVector3.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + LinearMath/btScalar.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h LinearMath/btPoint3.h \ + LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + LinearMath/btPoint3.h LinearMath/btMatrix3x3.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h LinearMath/btMinMax.h \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/CollisionShapes/btCapsuleShape.h \ + BulletCollision/CollisionShapes/btCylinderShape.h \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btConeShape.h \ + BulletCollision/CollisionShapes/btStaticPlaneShape.h \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btConvexHullShape.h \ + LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionShapes/btTriangleMesh.h \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btOptimizedBvh.h \ + BulletCollision/CollisionShapes/btTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h \ + LinearMath/btScalar.h BulletCollision/CollisionShapes/btCompoundShape.h \ + BulletCollision/CollisionShapes/btTetrahedronShape.h \ + BulletCollision/CollisionShapes/btEmptyShape.h \ + BulletCollision/CollisionShapes/btMultiSphereShape.h \ + BulletCollision/CollisionShapes/btUniformScalingShape.h \ + BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h \ + BulletCollision/CollisionDispatch/btCollisionConfiguration.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btAxisSweep3.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h LinearMath/btQuaternion.h \ + LinearMath/btTransform.h LinearMath/btDefaultMotionState.h \ + LinearMath/btQuickprof.h /usr/include/sys/time.h \ + LinearMath/btIDebugDraw.h \ + BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \ + BulletDynamics/Dynamics/btDynamicsWorld.h \ + BulletCollision/CollisionDispatch/btCollisionWorld.h \ + BulletDynamics/ConstraintSolver/btContactSolverInfo.h \ + LinearMath/btAlignedObjectArray.h \ + BulletDynamics/Dynamics/btContinuousDynamicsWorld.h \ + BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \ + BulletDynamics/Dynamics/btSimpleDynamicsWorld.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btPoint3.h \ + LinearMath/btTransform.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \ + LinearMath/btVector3.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h \ + BulletDynamics/Dynamics/btRigidBody.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + LinearMath/btScalar.h \ + BulletDynamics/ConstraintSolver/btHingeConstraint.h \ + BulletDynamics/ConstraintSolver/btConeTwistConstraint.h \ + BulletDynamics/ConstraintSolver/../../LinearMath/btVector3.h \ + BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h \ + BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \ + BulletDynamics/ConstraintSolver/btConstraintSolver.h \ + BulletDynamics/ConstraintSolver/btContactConstraint.h \ + BulletDynamics/ConstraintSolver/btSolverBody.h LinearMath/btMatrix3x3.h \ + LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btSolverConstraint.h \ + BulletDynamics/Vehicle/btRaycastVehicle.h \ + BulletDynamics/Dynamics/btRigidBody.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + BulletDynamics/Vehicle/btVehicleRaycaster.h LinearMath/btVector3.h \ + LinearMath/btAlignedObjectArray.h BulletDynamics/Vehicle/btWheelInfo.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h + +Bullet-C-Api.h: + +btBulletDynamicsCommon.h: + +btBulletCollisionCommon.h: + +BulletCollision/CollisionDispatch/btCollisionWorld.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +LinearMath/btScalar.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +LinearMath/btPoint3.h: + +LinearMath/btMatrix3x3.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btMinMax.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/CollisionShapes/btCapsuleShape.h: + +BulletCollision/CollisionShapes/btCylinderShape.h: + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btConeShape.h: + +BulletCollision/CollisionShapes/btStaticPlaneShape.h: + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionShapes/btConvexHullShape.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionShapes/btTriangleMesh.h: + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btOptimizedBvh.h: + +BulletCollision/CollisionShapes/btTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h: + +LinearMath/btScalar.h: + +BulletCollision/CollisionShapes/btCompoundShape.h: + +BulletCollision/CollisionShapes/btTetrahedronShape.h: + +BulletCollision/CollisionShapes/btEmptyShape.h: + +BulletCollision/CollisionShapes/btMultiSphereShape.h: + +BulletCollision/CollisionShapes/btUniformScalingShape.h: + +BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h: + +BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h: + +BulletCollision/CollisionDispatch/btCollisionConfiguration.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btSimpleBroadphase.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btAxisSweep3.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: + +LinearMath/btQuaternion.h: + +LinearMath/btTransform.h: + +LinearMath/btDefaultMotionState.h: + +LinearMath/btQuickprof.h: + +/usr/include/sys/time.h: + +LinearMath/btIDebugDraw.h: + +BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h: + +BulletDynamics/Dynamics/btDynamicsWorld.h: + +BulletCollision/CollisionDispatch/btCollisionWorld.h: + +BulletDynamics/ConstraintSolver/btContactSolverInfo.h: + +LinearMath/btAlignedObjectArray.h: + +BulletDynamics/Dynamics/btContinuousDynamicsWorld.h: + +BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h: + +BulletDynamics/Dynamics/btSimpleDynamicsWorld.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btPoint3.h: + +LinearMath/btTransform.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h: + +LinearMath/btVector3.h: + +BulletDynamics/ConstraintSolver/btJacobianEntry.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +LinearMath/btScalar.h: + +BulletDynamics/ConstraintSolver/btHingeConstraint.h: + +BulletDynamics/ConstraintSolver/btConeTwistConstraint.h: + +BulletDynamics/ConstraintSolver/../../LinearMath/btVector3.h: + +BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h: + +BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h: + +BulletDynamics/ConstraintSolver/btConstraintSolver.h: + +BulletDynamics/ConstraintSolver/btContactConstraint.h: + +BulletDynamics/ConstraintSolver/btSolverBody.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btSolverConstraint.h: + +BulletDynamics/Vehicle/btRaycastVehicle.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +BulletDynamics/Vehicle/btVehicleRaycaster.h: + +LinearMath/btVector3.h: + +LinearMath/btAlignedObjectArray.h: + +BulletDynamics/Vehicle/btWheelInfo.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/SphereTriangleDetector.Po b/src/bullet/src/.deps/SphereTriangleDetector.Po new file mode 100644 index 000000000..d2507dcda --- /dev/null +++ b/src/bullet/src/.deps/SphereTriangleDetector.Po @@ -0,0 +1,182 @@ +SphereTriangleDetector.o SphereTriangleDetector.o: \ + BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/CollisionDispatch/SphereTriangleDetector.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h LinearMath/btPoint3.h \ + BulletCollision/CollisionShapes/btTriangleShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + LinearMath/btMinMax.h BulletCollision/CollisionShapes/btSphereShape.h + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/CollisionDispatch/SphereTriangleDetector.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +BulletCollision/CollisionShapes/btTriangleShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +LinearMath/btMinMax.h: + +BulletCollision/CollisionShapes/btSphereShape.h: diff --git a/src/bullet/src/.deps/btAlignedAllocator.Po b/src/bullet/src/.deps/btAlignedAllocator.Po new file mode 100644 index 000000000..ee50f21f7 --- /dev/null +++ b/src/bullet/src/.deps/btAlignedAllocator.Po @@ -0,0 +1,110 @@ +btAlignedAllocator.o btAlignedAllocator.o: \ + LinearMath/btAlignedAllocator.cpp LinearMath/btAlignedAllocator.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: diff --git a/src/bullet/src/.deps/btAxisSweep3.Po b/src/bullet/src/.deps/btAxisSweep3.Po new file mode 100644 index 000000000..bd9338811 --- /dev/null +++ b/src/bullet/src/.deps/btAxisSweep3.Po @@ -0,0 +1,174 @@ +btAxisSweep3.o btAxisSweep3.o: \ + BulletCollision/BroadphaseCollision/btAxisSweep3.cpp \ + BulletCollision/BroadphaseCollision/btAxisSweep3.h \ + LinearMath/btPoint3.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btVector3.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h + +BulletCollision/BroadphaseCollision/btAxisSweep3.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btVector3.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: diff --git a/src/bullet/src/.deps/btBoxShape.Po b/src/bullet/src/.deps/btBoxShape.Po new file mode 100644 index 000000000..4784a0cd3 --- /dev/null +++ b/src/bullet/src/.deps/btBoxShape.Po @@ -0,0 +1,161 @@ +btBoxShape.o btBoxShape.o: \ + BulletCollision/CollisionShapes/btBoxShape.cpp \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + LinearMath/btPoint3.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btVector3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h LinearMath/btMinMax.h + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btVector3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btMinMax.h: diff --git a/src/bullet/src/.deps/btBroadphaseProxy.Po b/src/bullet/src/.deps/btBroadphaseProxy.Po new file mode 100644 index 000000000..29829bc95 --- /dev/null +++ b/src/bullet/src/.deps/btBroadphaseProxy.Po @@ -0,0 +1,116 @@ +btBroadphaseProxy.o btBroadphaseProxy.o: \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btAlignedAllocator.h \ + LinearMath/btScalar.h + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: diff --git a/src/bullet/src/.deps/btBvhTriangleMeshShape.Po b/src/bullet/src/.deps/btBvhTriangleMeshShape.Po new file mode 100644 index 000000000..ae61390f7 --- /dev/null +++ b/src/bullet/src/.deps/btBvhTriangleMeshShape.Po @@ -0,0 +1,174 @@ +btBvhTriangleMeshShape.o btBvhTriangleMeshShape.o: \ + BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \ + BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + BulletCollision/CollisionShapes/btOptimizedBvh.h \ + LinearMath/btAlignedAllocator.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionShapes/btOptimizedBvh.h + +BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +BulletCollision/CollisionShapes/btOptimizedBvh.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionShapes/btOptimizedBvh.h: diff --git a/src/bullet/src/.deps/btCapsuleShape.Po b/src/bullet/src/.deps/btCapsuleShape.Po new file mode 100644 index 000000000..28b7c5316 --- /dev/null +++ b/src/bullet/src/.deps/btCapsuleShape.Po @@ -0,0 +1,161 @@ +btCapsuleShape.o btCapsuleShape.o: \ + BulletCollision/CollisionShapes/btCapsuleShape.cpp \ + BulletCollision/CollisionShapes/btCapsuleShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btQuaternion.h + +BulletCollision/CollisionShapes/btCapsuleShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btQuaternion.h: diff --git a/src/bullet/src/.deps/btCollisionAlgorithm.Po b/src/bullet/src/.deps/btCollisionAlgorithm.Po new file mode 100644 index 000000000..dbb5d50b7 --- /dev/null +++ b/src/bullet/src/.deps/btCollisionAlgorithm.Po @@ -0,0 +1,114 @@ +btCollisionAlgorithm.o btCollisionAlgorithm.o: \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: diff --git a/src/bullet/src/.deps/btCollisionDispatcher.Po b/src/bullet/src/.deps/btCollisionDispatcher.Po new file mode 100644 index 000000000..a19014eda --- /dev/null +++ b/src/bullet/src/.deps/btCollisionDispatcher.Po @@ -0,0 +1,252 @@ +btCollisionDispatcher.o btCollisionDispatcher.o: \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + LinearMath/btMinMax.h LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btAlignedAllocator.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h LinearMath/btPoint3.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btPoolAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionConfiguration.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btPoolAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionConfiguration.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: diff --git a/src/bullet/src/.deps/btCollisionObject.Po b/src/bullet/src/.deps/btCollisionObject.Po new file mode 100644 index 000000000..e111e9b9a --- /dev/null +++ b/src/bullet/src/.deps/btCollisionObject.Po @@ -0,0 +1,132 @@ +btCollisionObject.o btCollisionObject.o: \ + BulletCollision/CollisionDispatch/btCollisionObject.cpp \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btCollisionShape.Po b/src/bullet/src/.deps/btCollisionShape.Po new file mode 100644 index 000000000..298614ceb --- /dev/null +++ b/src/bullet/src/.deps/btCollisionShape.Po @@ -0,0 +1,140 @@ +btCollisionShape.o btCollisionShape.o: \ + BulletCollision/CollisionShapes/btCollisionShape.cpp \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btCollisionWorld.Po b/src/bullet/src/.deps/btCollisionWorld.Po new file mode 100644 index 000000000..43c6b492e --- /dev/null +++ b/src/bullet/src/.deps/btCollisionWorld.Po @@ -0,0 +1,329 @@ +btCollisionWorld.o btCollisionWorld.o: \ + BulletCollision/CollisionDispatch/btCollisionWorld.cpp \ + BulletCollision/CollisionDispatch/btCollisionWorld.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btTransform.h \ + LinearMath/btVector3.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + LinearMath/btScalar.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h LinearMath/btPoint3.h \ + LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btCompoundShape.h \ + LinearMath/btAlignedObjectArray.h \ + BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \ + BulletCollision/NarrowPhaseCollision/btConvexCast.h \ + LinearMath/btScalar.h LinearMath/btIDebugDraw.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btPoint3.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + LinearMath/btAabbUtil2.h LinearMath/btQuickprof.h \ + /usr/include/sys/time.h LinearMath/btStackAlloc.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/CollisionDispatch/btCollisionConfiguration.h + +BulletCollision/CollisionDispatch/btCollisionWorld.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +LinearMath/btScalar.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +BulletCollision/NarrowPhaseCollision/btRaycastCallback.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionShapes/btCompoundShape.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h: + +BulletCollision/NarrowPhaseCollision/btConvexCast.h: + +LinearMath/btScalar.h: + +LinearMath/btIDebugDraw.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btPoint3.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +LinearMath/btAabbUtil2.h: + +LinearMath/btQuickprof.h: + +/usr/include/sys/time.h: + +LinearMath/btStackAlloc.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btSimpleBroadphase.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/CollisionDispatch/btCollisionConfiguration.h: diff --git a/src/bullet/src/.deps/btCompoundCollisionAlgorithm.Po b/src/bullet/src/.deps/btCompoundCollisionAlgorithm.Po new file mode 100644 index 000000000..661f35a3c --- /dev/null +++ b/src/bullet/src/.deps/btCompoundCollisionAlgorithm.Po @@ -0,0 +1,213 @@ +btCompoundCollisionAlgorithm.o btCompoundCollisionAlgorithm.o: \ + BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btScalar.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btMinMax.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCompoundShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedObjectArray.h + +BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCompoundShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedObjectArray.h: diff --git a/src/bullet/src/.deps/btCompoundShape.Po b/src/bullet/src/.deps/btCompoundShape.Po new file mode 100644 index 000000000..54d6a15cb --- /dev/null +++ b/src/bullet/src/.deps/btCompoundShape.Po @@ -0,0 +1,156 @@ +btCompoundShape.o btCompoundShape.o: \ + BulletCollision/CollisionShapes/btCompoundShape.cpp \ + BulletCollision/CollisionShapes/btCompoundShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception + +BulletCollision/CollisionShapes/btCompoundShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: diff --git a/src/bullet/src/.deps/btConcaveShape.Po b/src/bullet/src/.deps/btConcaveShape.Po new file mode 100644 index 000000000..a9547d746 --- /dev/null +++ b/src/bullet/src/.deps/btConcaveShape.Po @@ -0,0 +1,146 @@ +btConcaveShape.o btConcaveShape.o: \ + BulletCollision/CollisionShapes/btConcaveShape.cpp \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: diff --git a/src/bullet/src/.deps/btConeShape.Po b/src/bullet/src/.deps/btConeShape.Po new file mode 100644 index 000000000..c5349d687 --- /dev/null +++ b/src/bullet/src/.deps/btConeShape.Po @@ -0,0 +1,155 @@ +btConeShape.o btConeShape.o: \ + BulletCollision/CollisionShapes/btConeShape.cpp \ + BulletCollision/CollisionShapes/btConeShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionShapes/btConeShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btConeTwistConstraint.Po b/src/bullet/src/.deps/btConeTwistConstraint.Po new file mode 100644 index 000000000..fa3055f8d --- /dev/null +++ b/src/bullet/src/.deps/btConeTwistConstraint.Po @@ -0,0 +1,185 @@ +btConeTwistConstraint.o btConeTwistConstraint.o: \ + BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \ + BulletDynamics/ConstraintSolver/btConeTwistConstraint.h \ + BulletDynamics/ConstraintSolver/../../LinearMath/btVector3.h \ + BulletDynamics/ConstraintSolver/../../LinearMath/btQuadWord.h \ + BulletDynamics/ConstraintSolver/../../LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletDynamics/ConstraintSolver/../../LinearMath/btMinMax.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h \ + LinearMath/btVector3.h BulletDynamics/Dynamics/btRigidBody.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btScalar.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception LinearMath/btPoint3.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + LinearMath/btScalar.h LinearMath/btTransformUtil.h \ + LinearMath/btMinMax.h + +BulletDynamics/ConstraintSolver/btConeTwistConstraint.h: + +BulletDynamics/ConstraintSolver/../../LinearMath/btVector3.h: + +BulletDynamics/ConstraintSolver/../../LinearMath/btQuadWord.h: + +BulletDynamics/ConstraintSolver/../../LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletDynamics/ConstraintSolver/../../LinearMath/btMinMax.h: + +BulletDynamics/ConstraintSolver/btJacobianEntry.h: + +LinearMath/btVector3.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +LinearMath/btScalar.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btMinMax.h: diff --git a/src/bullet/src/.deps/btContactConstraint.Po b/src/bullet/src/.deps/btContactConstraint.Po new file mode 100644 index 000000000..c76fa6a9d --- /dev/null +++ b/src/bullet/src/.deps/btContactConstraint.Po @@ -0,0 +1,182 @@ +btContactConstraint.o btContactConstraint.o: \ + BulletDynamics/ConstraintSolver/btContactConstraint.cpp \ + BulletDynamics/ConstraintSolver/btContactConstraint.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btScalar.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception LinearMath/btPoint3.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h \ + BulletDynamics/ConstraintSolver/btContactSolverInfo.h \ + LinearMath/btMinMax.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btVector3.h LinearMath/btTransformUtil.h + +BulletDynamics/ConstraintSolver/btContactConstraint.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btScalar.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btJacobianEntry.h: + +BulletDynamics/ConstraintSolver/btContactSolverInfo.h: + +LinearMath/btMinMax.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btVector3.h: + +LinearMath/btTransformUtil.h: diff --git a/src/bullet/src/.deps/btContinuousConvexCollision.Po b/src/bullet/src/.deps/btContinuousConvexCollision.Po new file mode 100644 index 000000000..fe975c669 --- /dev/null +++ b/src/bullet/src/.deps/btContinuousConvexCollision.Po @@ -0,0 +1,206 @@ +btContinuousConvexCollision.o btContinuousConvexCollision.o: \ + BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \ + BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \ + BulletCollision/NarrowPhaseCollision/btConvexCast.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h LinearMath/btScalar.h \ + LinearMath/btIDebugDraw.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btPoint3.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btMinkowskiSumShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + BulletCollision/NarrowPhaseCollision/btPointCollector.h + +BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h: + +BulletCollision/NarrowPhaseCollision/btConvexCast.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btScalar.h: + +LinearMath/btIDebugDraw.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btPoint3.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btMinkowskiSumShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +BulletCollision/NarrowPhaseCollision/btPointCollector.h: diff --git a/src/bullet/src/.deps/btContinuousDynamicsWorld.Po b/src/bullet/src/.deps/btContinuousDynamicsWorld.Po new file mode 100644 index 000000000..fc8449b86 --- /dev/null +++ b/src/bullet/src/.deps/btContinuousDynamicsWorld.Po @@ -0,0 +1,328 @@ +btContinuousDynamicsWorld.o btContinuousDynamicsWorld.o: \ + BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp \ + BulletDynamics/Dynamics/btContinuousDynamicsWorld.h \ + BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \ + BulletDynamics/Dynamics/btDynamicsWorld.h \ + BulletCollision/CollisionDispatch/btCollisionWorld.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btTransform.h \ + LinearMath/btVector3.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + LinearMath/btScalar.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h LinearMath/btPoint3.h \ + LinearMath/btAlignedObjectArray.h \ + BulletDynamics/ConstraintSolver/btContactSolverInfo.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btQuickprof.h \ + /usr/include/sys/time.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionDispatch/btSimulationIslandManager.h \ + BulletCollision/CollisionDispatch/btUnionFind.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btPoint3.h LinearMath/btTransform.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \ + BulletDynamics/ConstraintSolver/btConstraintSolver.h \ + LinearMath/btScalar.h \ + BulletDynamics/ConstraintSolver/btContactConstraint.h \ + LinearMath/btVector3.h BulletDynamics/ConstraintSolver/btSolverBody.h \ + LinearMath/btMatrix3x3.h BulletDynamics/Dynamics/btRigidBody.h \ + LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btSolverConstraint.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h + +BulletDynamics/Dynamics/btContinuousDynamicsWorld.h: + +BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h: + +BulletDynamics/Dynamics/btDynamicsWorld.h: + +BulletCollision/CollisionDispatch/btCollisionWorld.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +LinearMath/btScalar.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +LinearMath/btAlignedObjectArray.h: + +BulletDynamics/ConstraintSolver/btContactSolverInfo.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btQuickprof.h: + +/usr/include/sys/time.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btSimpleBroadphase.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionDispatch/btSimulationIslandManager.h: + +BulletCollision/CollisionDispatch/btUnionFind.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btPoint3.h: + +LinearMath/btTransform.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h: + +BulletDynamics/ConstraintSolver/btConstraintSolver.h: + +LinearMath/btScalar.h: + +BulletDynamics/ConstraintSolver/btContactConstraint.h: + +LinearMath/btVector3.h: + +BulletDynamics/ConstraintSolver/btSolverBody.h: + +LinearMath/btMatrix3x3.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btSolverConstraint.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: diff --git a/src/bullet/src/.deps/btConvexCast.Po b/src/bullet/src/.deps/btConvexCast.Po new file mode 100644 index 000000000..b6369ad8c --- /dev/null +++ b/src/bullet/src/.deps/btConvexCast.Po @@ -0,0 +1,132 @@ +btConvexCast.o btConvexCast.o: \ + BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \ + BulletCollision/NarrowPhaseCollision/btConvexCast.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h LinearMath/btScalar.h \ + LinearMath/btIDebugDraw.h + +BulletCollision/NarrowPhaseCollision/btConvexCast.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btScalar.h: + +LinearMath/btIDebugDraw.h: diff --git a/src/bullet/src/.deps/btConvexConcaveCollisionAlgorithm.Po b/src/bullet/src/.deps/btConvexConcaveCollisionAlgorithm.Po new file mode 100644 index 000000000..8c683e8c8 --- /dev/null +++ b/src/bullet/src/.deps/btConvexConcaveCollisionAlgorithm.Po @@ -0,0 +1,280 @@ +btConvexConcaveCollisionAlgorithm.o btConvexConcaveCollisionAlgorithm.o: \ + BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btScalar.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btMinMax.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btVector3.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btMultiSphereShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btTriangleShape.h \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + LinearMath/btMinMax.h BulletCollision/CollisionShapes/btSphereShape.h \ + LinearMath/btIDebugDraw.h \ + BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \ + BulletCollision/NarrowPhaseCollision/btConvexCast.h \ + LinearMath/btScalar.h LinearMath/btIDebugDraw.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btPoint3.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h + +BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btVector3.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btMultiSphereShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/NarrowPhaseCollision/btRaycastCallback.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionShapes/btTriangleShape.h: + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +LinearMath/btMinMax.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +LinearMath/btIDebugDraw.h: + +BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h: + +BulletCollision/NarrowPhaseCollision/btConvexCast.h: + +LinearMath/btScalar.h: + +LinearMath/btIDebugDraw.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btPoint3.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: diff --git a/src/bullet/src/.deps/btConvexConvexAlgorithm.Po b/src/bullet/src/.deps/btConvexConvexAlgorithm.Po new file mode 100644 index 000000000..c8d216028 --- /dev/null +++ b/src/bullet/src/.deps/btConvexConvexAlgorithm.Po @@ -0,0 +1,332 @@ +btConvexConvexAlgorithm.o btConvexConvexAlgorithm.o: \ + BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h LinearMath/btPoint3.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h LinearMath/btMinMax.h \ + BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \ + BulletCollision/NarrowPhaseCollision/btConvexCast.h \ + LinearMath/btScalar.h LinearMath/btIDebugDraw.h \ + BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \ + BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \ + BulletCollision/CollisionShapes/btMinkowskiSumShape.h \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btGjkEpa.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h + +BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +LinearMath/btMinMax.h: + +BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h: + +BulletCollision/NarrowPhaseCollision/btConvexCast.h: + +LinearMath/btScalar.h: + +LinearMath/btIDebugDraw.h: + +BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h: + +BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h: + +BulletCollision/CollisionShapes/btMinkowskiSumShape.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btGjkEpa.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h: diff --git a/src/bullet/src/.deps/btConvexHullShape.Po b/src/bullet/src/.deps/btConvexHullShape.Po new file mode 100644 index 000000000..78036069d --- /dev/null +++ b/src/bullet/src/.deps/btConvexHullShape.Po @@ -0,0 +1,175 @@ +btConvexHullShape.o btConvexHullShape.o: \ + BulletCollision/CollisionShapes/btConvexHullShape.cpp \ + BulletCollision/CollisionShapes/btConvexHullShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + LinearMath/btPoint3.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btVector3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btQuaternion.h + +BulletCollision/CollisionShapes/btConvexHullShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btVector3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btQuaternion.h: diff --git a/src/bullet/src/.deps/btConvexInternalShape.Po b/src/bullet/src/.deps/btConvexInternalShape.Po new file mode 100644 index 000000000..285369374 --- /dev/null +++ b/src/bullet/src/.deps/btConvexInternalShape.Po @@ -0,0 +1,152 @@ +btConvexInternalShape.o btConvexInternalShape.o: \ + BulletCollision/CollisionShapes/btConvexInternalShape.cpp \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btConvexShape.Po b/src/bullet/src/.deps/btConvexShape.Po new file mode 100644 index 000000000..fb3e3bc07 --- /dev/null +++ b/src/bullet/src/.deps/btConvexShape.Po @@ -0,0 +1,149 @@ +btConvexShape.o btConvexShape.o: \ + BulletCollision/CollisionShapes/btConvexShape.cpp \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btConvexTriangleMeshShape.Po b/src/bullet/src/.deps/btConvexTriangleMeshShape.Po new file mode 100644 index 000000000..c828d4f8a --- /dev/null +++ b/src/bullet/src/.deps/btConvexTriangleMeshShape.Po @@ -0,0 +1,174 @@ +btConvexTriangleMeshShape.o btConvexTriangleMeshShape.o: \ + BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp \ + BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + LinearMath/btPoint3.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btVector3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + LinearMath/btVector3.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h + +BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btVector3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +LinearMath/btVector3.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: diff --git a/src/bullet/src/.deps/btCylinderShape.Po b/src/bullet/src/.deps/btCylinderShape.Po new file mode 100644 index 000000000..c90c943bd --- /dev/null +++ b/src/bullet/src/.deps/btCylinderShape.Po @@ -0,0 +1,164 @@ +btCylinderShape.o btCylinderShape.o: \ + BulletCollision/CollisionShapes/btCylinderShape.cpp \ + BulletCollision/CollisionShapes/btCylinderShape.h \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + LinearMath/btPoint3.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btVector3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h LinearMath/btMinMax.h + +BulletCollision/CollisionShapes/btCylinderShape.h: + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btVector3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btMinMax.h: diff --git a/src/bullet/src/.deps/btDefaultCollisionConfiguration.Po b/src/bullet/src/.deps/btDefaultCollisionConfiguration.Po new file mode 100644 index 000000000..a6a3816e0 --- /dev/null +++ b/src/bullet/src/.deps/btDefaultCollisionConfiguration.Po @@ -0,0 +1,260 @@ +btDefaultCollisionConfiguration.o btDefaultCollisionConfiguration.o: \ + BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \ + BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h \ + BulletCollision/CollisionDispatch/btCollisionConfiguration.h \ + BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h LinearMath/btPoint3.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h \ + BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btVector3.h \ + BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \ + LinearMath/btVector3.h \ + BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h \ + BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + LinearMath/btStackAlloc.h LinearMath/btPoolAllocator.h + +BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h: + +BulletCollision/CollisionDispatch/btCollisionConfiguration.h: + +BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h: + +BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btVector3.h: + +BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h: + +BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h: + +LinearMath/btVector3.h: + +BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h: + +BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +LinearMath/btStackAlloc.h: + +LinearMath/btPoolAllocator.h: diff --git a/src/bullet/src/.deps/btDiscreteDynamicsWorld.Po b/src/bullet/src/.deps/btDiscreteDynamicsWorld.Po new file mode 100644 index 000000000..7aea7f069 --- /dev/null +++ b/src/bullet/src/.deps/btDiscreteDynamicsWorld.Po @@ -0,0 +1,402 @@ +btDiscreteDynamicsWorld.o btDiscreteDynamicsWorld.o: \ + BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp \ + BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \ + BulletDynamics/Dynamics/btDynamicsWorld.h \ + BulletCollision/CollisionDispatch/btCollisionWorld.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btTransform.h \ + LinearMath/btVector3.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + LinearMath/btScalar.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h LinearMath/btPoint3.h \ + LinearMath/btAlignedObjectArray.h \ + BulletDynamics/ConstraintSolver/btContactSolverInfo.h \ + LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionDispatch/btSimulationIslandManager.h \ + BulletCollision/CollisionDispatch/btUnionFind.h \ + LinearMath/btTransformUtil.h BulletDynamics/Dynamics/btRigidBody.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btPoint3.h \ + LinearMath/btTransform.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \ + BulletDynamics/ConstraintSolver/btConstraintSolver.h \ + LinearMath/btScalar.h \ + BulletDynamics/ConstraintSolver/btContactConstraint.h \ + LinearMath/btVector3.h BulletDynamics/ConstraintSolver/btSolverBody.h \ + LinearMath/btMatrix3x3.h BulletDynamics/Dynamics/btRigidBody.h \ + LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btSolverConstraint.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h LinearMath/btMinMax.h \ + BulletCollision/CollisionShapes/btCapsuleShape.h \ + BulletCollision/CollisionShapes/btCompoundShape.h \ + LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionShapes/btConeShape.h \ + BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btCylinderShape.h \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btMultiSphereShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + LinearMath/btIDebugDraw.h BulletDynamics/Vehicle/btRaycastVehicle.h \ + BulletDynamics/Dynamics/btRigidBody.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + BulletDynamics/Vehicle/btVehicleRaycaster.h LinearMath/btVector3.h \ + LinearMath/btAlignedObjectArray.h BulletDynamics/Vehicle/btWheelInfo.h \ + LinearMath/btTransform.h BulletDynamics/Vehicle/btVehicleRaycaster.h \ + BulletDynamics/Vehicle/btWheelInfo.h LinearMath/btQuickprof.h \ + /usr/include/sys/time.h LinearMath/btMotionState.h + +BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h: + +BulletDynamics/Dynamics/btDynamicsWorld.h: + +BulletCollision/CollisionDispatch/btCollisionWorld.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +LinearMath/btScalar.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +LinearMath/btAlignedObjectArray.h: + +BulletDynamics/ConstraintSolver/btContactSolverInfo.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btSimpleBroadphase.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionDispatch/btSimulationIslandManager.h: + +BulletCollision/CollisionDispatch/btUnionFind.h: + +LinearMath/btTransformUtil.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btPoint3.h: + +LinearMath/btTransform.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h: + +BulletDynamics/ConstraintSolver/btConstraintSolver.h: + +LinearMath/btScalar.h: + +BulletDynamics/ConstraintSolver/btContactConstraint.h: + +LinearMath/btVector3.h: + +BulletDynamics/ConstraintSolver/btSolverBody.h: + +LinearMath/btMatrix3x3.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btSolverConstraint.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btMinMax.h: + +BulletCollision/CollisionShapes/btCapsuleShape.h: + +BulletCollision/CollisionShapes/btCompoundShape.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionShapes/btConeShape.h: + +BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btCylinderShape.h: + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btMultiSphereShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionShapes/btTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +LinearMath/btIDebugDraw.h: + +BulletDynamics/Vehicle/btRaycastVehicle.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +BulletDynamics/Vehicle/btVehicleRaycaster.h: + +LinearMath/btVector3.h: + +LinearMath/btAlignedObjectArray.h: + +BulletDynamics/Vehicle/btWheelInfo.h: + +LinearMath/btTransform.h: + +BulletDynamics/Vehicle/btVehicleRaycaster.h: + +BulletDynamics/Vehicle/btWheelInfo.h: + +LinearMath/btQuickprof.h: + +/usr/include/sys/time.h: + +LinearMath/btMotionState.h: diff --git a/src/bullet/src/.deps/btDispatcher.Po b/src/bullet/src/.deps/btDispatcher.Po new file mode 100644 index 000000000..eb325a54a --- /dev/null +++ b/src/bullet/src/.deps/btDispatcher.Po @@ -0,0 +1,111 @@ +btDispatcher.o btDispatcher.o: \ + BulletCollision/BroadphaseCollision/btDispatcher.cpp \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: diff --git a/src/bullet/src/.deps/btEmptyCollisionAlgorithm.Po b/src/bullet/src/.deps/btEmptyCollisionAlgorithm.Po new file mode 100644 index 000000000..9b00e2650 --- /dev/null +++ b/src/bullet/src/.deps/btEmptyCollisionAlgorithm.Po @@ -0,0 +1,185 @@ +btEmptyCollisionAlgorithm.o btEmptyCollisionAlgorithm.o: \ + BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btScalar.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btMinMax.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btEmptyShape.Po b/src/bullet/src/.deps/btEmptyShape.Po new file mode 100644 index 000000000..f9cf857ec --- /dev/null +++ b/src/bullet/src/.deps/btEmptyShape.Po @@ -0,0 +1,152 @@ +btEmptyShape.o btEmptyShape.o: \ + BulletCollision/CollisionShapes/btEmptyShape.cpp \ + BulletCollision/CollisionShapes/btEmptyShape.h \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h + +BulletCollision/CollisionShapes/btEmptyShape.h: + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: diff --git a/src/bullet/src/.deps/btGeneric6DofConstraint.Po b/src/bullet/src/.deps/btGeneric6DofConstraint.Po new file mode 100644 index 000000000..a62524f0f --- /dev/null +++ b/src/bullet/src/.deps/btGeneric6DofConstraint.Po @@ -0,0 +1,174 @@ +btGeneric6DofConstraint.o btGeneric6DofConstraint.o: \ + BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \ + BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception LinearMath/btPoint3.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + LinearMath/btScalar.h LinearMath/btTransformUtil.h + +BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +BulletDynamics/ConstraintSolver/btJacobianEntry.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +LinearMath/btScalar.h: + +LinearMath/btTransformUtil.h: diff --git a/src/bullet/src/.deps/btGeometryUtil.Po b/src/bullet/src/.deps/btGeometryUtil.Po new file mode 100644 index 000000000..6ba9eb18a --- /dev/null +++ b/src/bullet/src/.deps/btGeometryUtil.Po @@ -0,0 +1,126 @@ +btGeometryUtil.o btGeometryUtil.o: LinearMath/btGeometryUtil.cpp \ + LinearMath/btGeometryUtil.h LinearMath/btVector3.h \ + LinearMath/btQuadWord.h LinearMath/btScalar.h /usr/include/math.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception + +LinearMath/btGeometryUtil.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: diff --git a/src/bullet/src/.deps/btGjkConvexCast.Po b/src/bullet/src/.deps/btGjkConvexCast.Po new file mode 100644 index 000000000..2ded2293c --- /dev/null +++ b/src/bullet/src/.deps/btGjkConvexCast.Po @@ -0,0 +1,195 @@ +btGjkConvexCast.o btGjkConvexCast.o: \ + BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \ + BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + BulletCollision/NarrowPhaseCollision/btConvexCast.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + LinearMath/btScalar.h LinearMath/btIDebugDraw.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btPoint3.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btMinkowskiSumShape.h \ + BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/NarrowPhaseCollision/btPointCollector.h + +BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +BulletCollision/NarrowPhaseCollision/btConvexCast.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btScalar.h: + +LinearMath/btIDebugDraw.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btPoint3.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btMinkowskiSumShape.h: + +BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/NarrowPhaseCollision/btPointCollector.h: diff --git a/src/bullet/src/.deps/btGjkEpa.Po b/src/bullet/src/.deps/btGjkEpa.Po new file mode 100644 index 000000000..486bc3244 --- /dev/null +++ b/src/bullet/src/.deps/btGjkEpa.Po @@ -0,0 +1,158 @@ +btGjkEpa.o btGjkEpa.o: BulletCollision/NarrowPhaseCollision/btGjkEpa.cpp \ + BulletCollision/NarrowPhaseCollision/btGjkEpa.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h /usr/include/string.h \ + LinearMath/btStackAlloc.h LinearMath/btAlignedAllocator.h + +BulletCollision/NarrowPhaseCollision/btGjkEpa.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/string.h: + +LinearMath/btStackAlloc.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btGjkEpaPenetrationDepthSolver.Po b/src/bullet/src/.deps/btGjkEpaPenetrationDepthSolver.Po new file mode 100644 index 000000000..0456a8d94 --- /dev/null +++ b/src/bullet/src/.deps/btGjkEpaPenetrationDepthSolver.Po @@ -0,0 +1,172 @@ +btGjkEpaPenetrationDepthSolver.o btGjkEpaPenetrationDepthSolver.o: \ + BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btVector3.h LinearMath/btPoint3.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/NarrowPhaseCollision/btGjkEpa.h \ + BulletCollision/CollisionShapes/btConvexShape.h + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/NarrowPhaseCollision/btGjkEpa.h: + +BulletCollision/CollisionShapes/btConvexShape.h: diff --git a/src/bullet/src/.deps/btGjkPairDetector.Po b/src/bullet/src/.deps/btGjkPairDetector.Po new file mode 100644 index 000000000..be6156711 --- /dev/null +++ b/src/bullet/src/.deps/btGjkPairDetector.Po @@ -0,0 +1,183 @@ +btGjkPairDetector.o btGjkPairDetector.o: \ + BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \ + BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h LinearMath/btPoint3.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btPoint3.h + +BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btPoint3.h: diff --git a/src/bullet/src/.deps/btHeightfieldTerrainShape.Po b/src/bullet/src/.deps/btHeightfieldTerrainShape.Po new file mode 100644 index 000000000..21ec760db --- /dev/null +++ b/src/bullet/src/.deps/btHeightfieldTerrainShape.Po @@ -0,0 +1,154 @@ +btHeightfieldTerrainShape.o btHeightfieldTerrainShape.o: \ + BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp \ + BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h + +BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h: + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: diff --git a/src/bullet/src/.deps/btHingeConstraint.Po b/src/bullet/src/.deps/btHingeConstraint.Po new file mode 100644 index 000000000..b7a04bfd9 --- /dev/null +++ b/src/bullet/src/.deps/btHingeConstraint.Po @@ -0,0 +1,177 @@ +btHingeConstraint.o btHingeConstraint.o: \ + BulletDynamics/ConstraintSolver/btHingeConstraint.cpp \ + BulletDynamics/ConstraintSolver/btHingeConstraint.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception LinearMath/btPoint3.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + LinearMath/btScalar.h LinearMath/btTransformUtil.h \ + LinearMath/btMinMax.h + +BulletDynamics/ConstraintSolver/btHingeConstraint.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +BulletDynamics/ConstraintSolver/btJacobianEntry.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +LinearMath/btScalar.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btMinMax.h: diff --git a/src/bullet/src/.deps/btManifoldResult.Po b/src/bullet/src/.deps/btManifoldResult.Po new file mode 100644 index 000000000..ffa379902 --- /dev/null +++ b/src/bullet/src/.deps/btManifoldResult.Po @@ -0,0 +1,158 @@ +btManifoldResult.o btManifoldResult.o: \ + BulletCollision/CollisionDispatch/btManifoldResult.cpp \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btTransform.h \ + LinearMath/btVector3.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btMinkowskiPenetrationDepthSolver.Po b/src/bullet/src/.deps/btMinkowskiPenetrationDepthSolver.Po new file mode 100644 index 000000000..498c0d0f3 --- /dev/null +++ b/src/bullet/src/.deps/btMinkowskiPenetrationDepthSolver.Po @@ -0,0 +1,206 @@ +btMinkowskiPenetrationDepthSolver.o btMinkowskiPenetrationDepthSolver.o: \ + BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp \ + BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btPoint3.h \ + LinearMath/btVector3.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/CollisionShapes/btMinkowskiSumShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \ + BulletCollision/NarrowPhaseCollision/btConvexCast.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btScalar.h \ + LinearMath/btIDebugDraw.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btPoint3.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h + +BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/CollisionShapes/btMinkowskiSumShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h: + +BulletCollision/NarrowPhaseCollision/btConvexCast.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btScalar.h: + +LinearMath/btIDebugDraw.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btPoint3.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: diff --git a/src/bullet/src/.deps/btMinkowskiSumShape.Po b/src/bullet/src/.deps/btMinkowskiSumShape.Po new file mode 100644 index 000000000..955990d16 --- /dev/null +++ b/src/bullet/src/.deps/btMinkowskiSumShape.Po @@ -0,0 +1,155 @@ +btMinkowskiSumShape.o btMinkowskiSumShape.o: \ + BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp \ + BulletCollision/CollisionShapes/btMinkowskiSumShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionShapes/btMinkowskiSumShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btMultiSapBroadphase.Po b/src/bullet/src/.deps/btMultiSapBroadphase.Po new file mode 100644 index 000000000..628c33d97 --- /dev/null +++ b/src/bullet/src/.deps/btMultiSapBroadphase.Po @@ -0,0 +1,153 @@ +btMultiSapBroadphase.o btMultiSapBroadphase.o: \ + BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp \ + BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btAlignedAllocator.h \ + LinearMath/btScalar.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btMinMax.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + LinearMath/btPoint3.h LinearMath/btVector3.h \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \ + LinearMath/btAabbUtil2.h + +BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +BulletCollision/BroadphaseCollision/btSimpleBroadphase.h: + +LinearMath/btAabbUtil2.h: diff --git a/src/bullet/src/.deps/btMultiSphereShape.Po b/src/bullet/src/.deps/btMultiSphereShape.Po new file mode 100644 index 000000000..01be057a7 --- /dev/null +++ b/src/bullet/src/.deps/btMultiSphereShape.Po @@ -0,0 +1,161 @@ +btMultiSphereShape.o btMultiSphereShape.o: \ + BulletCollision/CollisionShapes/btMultiSphereShape.cpp \ + BulletCollision/CollisionShapes/btMultiSphereShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btQuaternion.h + +BulletCollision/CollisionShapes/btMultiSphereShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btQuaternion.h: diff --git a/src/bullet/src/.deps/btOptimizedBvh.Po b/src/bullet/src/.deps/btOptimizedBvh.Po new file mode 100644 index 000000000..fb6072f69 --- /dev/null +++ b/src/bullet/src/.deps/btOptimizedBvh.Po @@ -0,0 +1,144 @@ +btOptimizedBvh.o btOptimizedBvh.o: \ + BulletCollision/CollisionShapes/btOptimizedBvh.cpp \ + BulletCollision/CollisionShapes/btOptimizedBvh.h LinearMath/btVector3.h \ + LinearMath/btQuadWord.h LinearMath/btScalar.h /usr/include/math.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + LinearMath/btAlignedAllocator.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btAabbUtil2.h LinearMath/btVector3.h \ + LinearMath/btIDebugDraw.h + +BulletCollision/CollisionShapes/btOptimizedBvh.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btAabbUtil2.h: + +LinearMath/btVector3.h: + +LinearMath/btIDebugDraw.h: diff --git a/src/bullet/src/.deps/btOverlappingPairCache.Po b/src/bullet/src/.deps/btOverlappingPairCache.Po new file mode 100644 index 000000000..ee27a8cd9 --- /dev/null +++ b/src/bullet/src/.deps/btOverlappingPairCache.Po @@ -0,0 +1,174 @@ +btOverlappingPairCache.o btOverlappingPairCache.o: \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btAlignedAllocator.h \ + LinearMath/btScalar.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btMinMax.h LinearMath/btPoint3.h LinearMath/btVector3.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: diff --git a/src/bullet/src/.deps/btPersistentManifold.Po b/src/bullet/src/.deps/btPersistentManifold.Po new file mode 100644 index 000000000..5f1cf8917 --- /dev/null +++ b/src/bullet/src/.deps/btPersistentManifold.Po @@ -0,0 +1,138 @@ +btPersistentManifold.o btPersistentManifold.o: \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btTransform.h \ + LinearMath/btVector3.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btPoint2PointConstraint.Po b/src/bullet/src/.deps/btPoint2PointConstraint.Po new file mode 100644 index 000000000..1ed4755d0 --- /dev/null +++ b/src/bullet/src/.deps/btPoint2PointConstraint.Po @@ -0,0 +1,172 @@ +btPoint2PointConstraint.o btPoint2PointConstraint.o: \ + BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp \ + BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception LinearMath/btPoint3.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + LinearMath/btScalar.h + +BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +BulletDynamics/ConstraintSolver/btJacobianEntry.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +LinearMath/btScalar.h: diff --git a/src/bullet/src/.deps/btPolyhedralConvexShape.Po b/src/bullet/src/.deps/btPolyhedralConvexShape.Po new file mode 100644 index 000000000..28d7c477b --- /dev/null +++ b/src/bullet/src/.deps/btPolyhedralConvexShape.Po @@ -0,0 +1,156 @@ +btPolyhedralConvexShape.o btPolyhedralConvexShape.o: \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + LinearMath/btPoint3.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btVector3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btVector3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btQuickprof.Po b/src/bullet/src/.deps/btQuickprof.Po new file mode 100644 index 000000000..32d3e38d3 --- /dev/null +++ b/src/bullet/src/.deps/btQuickprof.Po @@ -0,0 +1,111 @@ +btQuickprof.o btQuickprof.o: LinearMath/btQuickprof.cpp \ + LinearMath/btQuickprof.h LinearMath/btScalar.h /usr/include/math.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h /usr/include/sys/time.h + +LinearMath/btQuickprof.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +/usr/include/sys/time.h: diff --git a/src/bullet/src/.deps/btRaycastCallback.Po b/src/bullet/src/.deps/btRaycastCallback.Po new file mode 100644 index 000000000..da92a4f59 --- /dev/null +++ b/src/bullet/src/.deps/btRaycastCallback.Po @@ -0,0 +1,120 @@ +btRaycastCallback.o btRaycastCallback.o: \ + BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \ + BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h + +BulletCollision/NarrowPhaseCollision/btRaycastCallback.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: diff --git a/src/bullet/src/.deps/btRaycastVehicle.Po b/src/bullet/src/.deps/btRaycastVehicle.Po new file mode 100644 index 000000000..0e4e303a0 --- /dev/null +++ b/src/bullet/src/.deps/btRaycastVehicle.Po @@ -0,0 +1,266 @@ +btRaycastVehicle.o btRaycastVehicle.o: \ + BulletDynamics/Vehicle/btRaycastVehicle.cpp LinearMath/btVector3.h \ + LinearMath/btQuadWord.h LinearMath/btScalar.h /usr/include/math.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + BulletDynamics/Vehicle/btRaycastVehicle.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception LinearMath/btPoint3.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + LinearMath/btScalar.h BulletDynamics/Vehicle/btVehicleRaycaster.h \ + LinearMath/btAlignedObjectArray.h BulletDynamics/Vehicle/btWheelInfo.h \ + LinearMath/btTransform.h \ + BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \ + LinearMath/btMatrix3x3.h LinearMath/btVector3.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btQuaternion.h \ + BulletDynamics/Dynamics/btDynamicsWorld.h \ + BulletCollision/CollisionDispatch/btCollisionWorld.h \ + LinearMath/btVector3.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h LinearMath/btPoint3.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btMinMax.h \ + BulletDynamics/ConstraintSolver/btContactConstraint.h + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +BulletDynamics/Vehicle/btRaycastVehicle.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +LinearMath/btScalar.h: + +BulletDynamics/Vehicle/btVehicleRaycaster.h: + +LinearMath/btAlignedObjectArray.h: + +BulletDynamics/Vehicle/btWheelInfo.h: + +LinearMath/btTransform.h: + +BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btVector3.h: + +BulletDynamics/ConstraintSolver/btJacobianEntry.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btQuaternion.h: + +BulletDynamics/Dynamics/btDynamicsWorld.h: + +BulletCollision/CollisionDispatch/btCollisionWorld.h: + +LinearMath/btVector3.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btMinMax.h: + +BulletDynamics/ConstraintSolver/btContactConstraint.h: diff --git a/src/bullet/src/.deps/btRigidBody.Po b/src/bullet/src/.deps/btRigidBody.Po new file mode 100644 index 000000000..b1b091a15 --- /dev/null +++ b/src/bullet/src/.deps/btRigidBody.Po @@ -0,0 +1,220 @@ +btRigidBody.o btRigidBody.o: BulletDynamics/Dynamics/btRigidBody.cpp \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + LinearMath/btPoint3.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btMinMax.h LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h LinearMath/btMinMax.h \ + LinearMath/btTransformUtil.h LinearMath/btMotionState.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + LinearMath/btScalar.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btMotionState.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +LinearMath/btScalar.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: diff --git a/src/bullet/src/.deps/btSequentialImpulseConstraintSolver.Po b/src/bullet/src/.deps/btSequentialImpulseConstraintSolver.Po new file mode 100644 index 000000000..28e5ab119 --- /dev/null +++ b/src/bullet/src/.deps/btSequentialImpulseConstraintSolver.Po @@ -0,0 +1,230 @@ +btSequentialImpulseConstraintSolver.o \ + btSequentialImpulseConstraintSolver.o: \ + BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \ + BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \ + BulletDynamics/ConstraintSolver/btConstraintSolver.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletDynamics/ConstraintSolver/btContactConstraint.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + LinearMath/btMinMax.h BulletDynamics/ConstraintSolver/btSolverBody.h \ + LinearMath/btMatrix3x3.h LinearMath/btVector3.h \ + LinearMath/btQuaternion.h BulletDynamics/Dynamics/btRigidBody.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + LinearMath/btPoint3.h LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h \ + LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btSolverConstraint.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \ + BulletDynamics/ConstraintSolver/btContactSolverInfo.h \ + LinearMath/btIDebugDraw.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h LinearMath/btMinMax.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + LinearMath/btScalar.h LinearMath/btStackAlloc.h \ + LinearMath/btQuickprof.h /usr/include/sys/time.h \ + LinearMath/btAlignedObjectArray.h + +BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h: + +BulletDynamics/ConstraintSolver/btConstraintSolver.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletDynamics/ConstraintSolver/btContactConstraint.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +LinearMath/btMinMax.h: + +BulletDynamics/ConstraintSolver/btSolverBody.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuaternion.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btSolverConstraint.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h: + +BulletDynamics/ConstraintSolver/btContactSolverInfo.h: + +LinearMath/btIDebugDraw.h: + +BulletDynamics/ConstraintSolver/btJacobianEntry.h: + +LinearMath/btMinMax.h: + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +LinearMath/btScalar.h: + +LinearMath/btStackAlloc.h: + +LinearMath/btQuickprof.h: + +/usr/include/sys/time.h: + +LinearMath/btAlignedObjectArray.h: diff --git a/src/bullet/src/.deps/btSimpleBroadphase.Po b/src/bullet/src/.deps/btSimpleBroadphase.Po new file mode 100644 index 000000000..7c7237fd3 --- /dev/null +++ b/src/bullet/src/.deps/btSimpleBroadphase.Po @@ -0,0 +1,165 @@ +btSimpleBroadphase.o btSimpleBroadphase.o: \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btAlignedAllocator.h \ + LinearMath/btScalar.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btMinMax.h LinearMath/btPoint3.h LinearMath/btVector3.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + LinearMath/btScalar.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btMatrix3x3.h + +BulletCollision/BroadphaseCollision/btSimpleBroadphase.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +LinearMath/btScalar.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btMatrix3x3.h: diff --git a/src/bullet/src/.deps/btSimpleDynamicsWorld.Po b/src/bullet/src/.deps/btSimpleDynamicsWorld.Po new file mode 100644 index 000000000..8b8bfaf17 --- /dev/null +++ b/src/bullet/src/.deps/btSimpleDynamicsWorld.Po @@ -0,0 +1,283 @@ +btSimpleDynamicsWorld.o btSimpleDynamicsWorld.o: \ + BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp \ + BulletDynamics/Dynamics/btSimpleDynamicsWorld.h \ + BulletDynamics/Dynamics/btDynamicsWorld.h \ + BulletCollision/CollisionDispatch/btCollisionWorld.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btTransform.h \ + LinearMath/btVector3.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + LinearMath/btScalar.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btTransform.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h LinearMath/btPoint3.h \ + LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btPoint3.h LinearMath/btTransform.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \ + BulletDynamics/ConstraintSolver/btConstraintSolver.h \ + LinearMath/btScalar.h \ + BulletDynamics/ConstraintSolver/btContactConstraint.h \ + LinearMath/btVector3.h BulletDynamics/ConstraintSolver/btSolverBody.h \ + LinearMath/btMatrix3x3.h BulletDynamics/Dynamics/btRigidBody.h \ + LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btSolverConstraint.h \ + BulletDynamics/ConstraintSolver/btContactSolverInfo.h + +BulletDynamics/Dynamics/btSimpleDynamicsWorld.h: + +BulletDynamics/Dynamics/btDynamicsWorld.h: + +BulletCollision/CollisionDispatch/btCollisionWorld.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +LinearMath/btScalar.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btTransform.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btSimpleBroadphase.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btPoint3.h: + +LinearMath/btTransform.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h: + +BulletDynamics/ConstraintSolver/btConstraintSolver.h: + +LinearMath/btScalar.h: + +BulletDynamics/ConstraintSolver/btContactConstraint.h: + +LinearMath/btVector3.h: + +BulletDynamics/ConstraintSolver/btSolverBody.h: + +LinearMath/btMatrix3x3.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btSolverConstraint.h: + +BulletDynamics/ConstraintSolver/btContactSolverInfo.h: diff --git a/src/bullet/src/.deps/btSimulationIslandManager.Po b/src/bullet/src/.deps/btSimulationIslandManager.Po new file mode 100644 index 000000000..a2297d2fc --- /dev/null +++ b/src/bullet/src/.deps/btSimulationIslandManager.Po @@ -0,0 +1,261 @@ +btSimulationIslandManager.o btSimulationIslandManager.o: \ + BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/CollisionDispatch/btSimulationIslandManager.h \ + BulletCollision/CollisionDispatch/btUnionFind.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btScalar.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btAlignedObjectArray.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + LinearMath/btScalar.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btMinMax.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionWorld.h \ + LinearMath/btVector3.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btVector3.h LinearMath/btPoint3.h \ + LinearMath/btAlignedObjectArray.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h LinearMath/btQuickprof.h \ + /usr/include/sys/time.h + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/CollisionDispatch/btSimulationIslandManager.h: + +BulletCollision/CollisionDispatch/btUnionFind.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +LinearMath/btScalar.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionWorld.h: + +LinearMath/btVector3.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: + +BulletCollision/BroadphaseCollision/btBroadphaseInterface.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btVector3.h: + +LinearMath/btPoint3.h: + +LinearMath/btAlignedObjectArray.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: + +LinearMath/btQuickprof.h: + +/usr/include/sys/time.h: diff --git a/src/bullet/src/.deps/btSolve2LinearConstraint.Po b/src/bullet/src/.deps/btSolve2LinearConstraint.Po new file mode 100644 index 000000000..522571c22 --- /dev/null +++ b/src/bullet/src/.deps/btSolve2LinearConstraint.Po @@ -0,0 +1,168 @@ +btSolve2LinearConstraint.o btSolve2LinearConstraint.o: \ + BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp \ + BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \ + LinearMath/btMatrix3x3.h LinearMath/btScalar.h /usr/include/math.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btMinMax.h LinearMath/btQuaternion.h LinearMath/btVector3.h \ + BulletDynamics/Dynamics/btRigidBody.h LinearMath/btAlignedObjectArray.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception LinearMath/btPoint3.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h + +BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletDynamics/ConstraintSolver/btJacobianEntry.h: diff --git a/src/bullet/src/.deps/btSphereBoxCollisionAlgorithm.Po b/src/bullet/src/.deps/btSphereBoxCollisionAlgorithm.Po new file mode 100644 index 000000000..1c4db83df --- /dev/null +++ b/src/bullet/src/.deps/btSphereBoxCollisionAlgorithm.Po @@ -0,0 +1,243 @@ +btSphereBoxCollisionAlgorithm.o btSphereBoxCollisionAlgorithm.o: \ + BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btScalar.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btMinMax.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btVector3.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + LinearMath/btMinMax.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btVector3.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btBoxShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +LinearMath/btMinMax.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btSphereShape.Po b/src/bullet/src/.deps/btSphereShape.Po new file mode 100644 index 000000000..9b39c5421 --- /dev/null +++ b/src/bullet/src/.deps/btSphereShape.Po @@ -0,0 +1,161 @@ +btSphereShape.o btSphereShape.o: \ + BulletCollision/CollisionShapes/btSphereShape.cpp \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btQuaternion.h + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btQuaternion.h: diff --git a/src/bullet/src/.deps/btSphereSphereCollisionAlgorithm.Po b/src/bullet/src/.deps/btSphereSphereCollisionAlgorithm.Po new file mode 100644 index 000000000..664b28ed3 --- /dev/null +++ b/src/bullet/src/.deps/btSphereSphereCollisionAlgorithm.Po @@ -0,0 +1,231 @@ +btSphereSphereCollisionAlgorithm.o btSphereSphereCollisionAlgorithm.o: \ + BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btScalar.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btMinMax.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btSphereTriangleCollisionAlgorithm.Po b/src/bullet/src/.deps/btSphereTriangleCollisionAlgorithm.Po new file mode 100644 index 000000000..225273aee --- /dev/null +++ b/src/bullet/src/.deps/btSphereTriangleCollisionAlgorithm.Po @@ -0,0 +1,240 @@ +btSphereTriangleCollisionAlgorithm.o btSphereTriangleCollisionAlgorithm.o: \ + BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btAlignedAllocator.h LinearMath/btScalar.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btMinMax.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btQuaternion.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btTransform.h LinearMath/btAlignedObjectArray.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btMotionState.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/SphereTriangleDetector.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \ + LinearMath/btPoint3.h + +BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h: + +BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btAlignedAllocator.h: + +LinearMath/btScalar.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/BroadphaseCollision/btDispatcher.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/NarrowPhaseCollision/btManifoldPoint.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btManifoldResult.h: + +BulletCollision/NarrowPhaseCollision/btPersistentManifold.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedObjectArray.h: + +BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: + +BulletCollision/CollisionDispatch/btCollisionDispatcher.h: + +BulletCollision/CollisionShapes/btSphereShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btMotionState.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/SphereTriangleDetector.h: + +BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h: + +LinearMath/btPoint3.h: diff --git a/src/bullet/src/.deps/btStaticPlaneShape.Po b/src/bullet/src/.deps/btStaticPlaneShape.Po new file mode 100644 index 000000000..0e735b0ef --- /dev/null +++ b/src/bullet/src/.deps/btStaticPlaneShape.Po @@ -0,0 +1,154 @@ +btStaticPlaneShape.o btStaticPlaneShape.o: \ + BulletCollision/CollisionShapes/btStaticPlaneShape.cpp \ + BulletCollision/CollisionShapes/btStaticPlaneShape.h \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btTransformUtil.h LinearMath/btTransform.h + +BulletCollision/CollisionShapes/btStaticPlaneShape.h: + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btTransformUtil.h: + +LinearMath/btTransform.h: diff --git a/src/bullet/src/.deps/btStridingMeshInterface.Po b/src/bullet/src/.deps/btStridingMeshInterface.Po new file mode 100644 index 000000000..f36f989cb --- /dev/null +++ b/src/bullet/src/.deps/btStridingMeshInterface.Po @@ -0,0 +1,120 @@ +btStridingMeshInterface.o btStridingMeshInterface.o: \ + BulletCollision/CollisionShapes/btStridingMeshInterface.cpp \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: diff --git a/src/bullet/src/.deps/btSubSimplexConvexCast.Po b/src/bullet/src/.deps/btSubSimplexConvexCast.Po new file mode 100644 index 000000000..d07fefb67 --- /dev/null +++ b/src/bullet/src/.deps/btSubSimplexConvexCast.Po @@ -0,0 +1,186 @@ +btSubSimplexConvexCast.o btSubSimplexConvexCast.o: \ + BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \ + BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \ + BulletCollision/NarrowPhaseCollision/btConvexCast.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h LinearMath/btScalar.h \ + LinearMath/btIDebugDraw.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btPoint3.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btMinkowskiSumShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h + +BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h: + +BulletCollision/NarrowPhaseCollision/btConvexCast.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btScalar.h: + +LinearMath/btIDebugDraw.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btPoint3.h: + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btMinkowskiSumShape.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: diff --git a/src/bullet/src/.deps/btTetrahedronShape.Po b/src/bullet/src/.deps/btTetrahedronShape.Po new file mode 100644 index 000000000..02bd7e033 --- /dev/null +++ b/src/bullet/src/.deps/btTetrahedronShape.Po @@ -0,0 +1,159 @@ +btTetrahedronShape.o btTetrahedronShape.o: \ + BulletCollision/CollisionShapes/btTetrahedronShape.cpp \ + BulletCollision/CollisionShapes/btTetrahedronShape.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + LinearMath/btPoint3.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btVector3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionShapes/btTetrahedronShape.h: + +BulletCollision/CollisionShapes/btPolyhedralConvexShape.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/CollisionShapes/btConvexInternalShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btVector3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btTriangleBuffer.Po b/src/bullet/src/.deps/btTriangleBuffer.Po new file mode 100644 index 000000000..c7b14b252 --- /dev/null +++ b/src/bullet/src/.deps/btTriangleBuffer.Po @@ -0,0 +1,130 @@ +btTriangleBuffer.o btTriangleBuffer.o: \ + BulletCollision/CollisionShapes/btTriangleBuffer.cpp \ + BulletCollision/CollisionShapes/btTriangleBuffer.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception + +BulletCollision/CollisionShapes/btTriangleBuffer.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: diff --git a/src/bullet/src/.deps/btTriangleCallback.Po b/src/bullet/src/.deps/btTriangleCallback.Po new file mode 100644 index 000000000..54bcb41a2 --- /dev/null +++ b/src/bullet/src/.deps/btTriangleCallback.Po @@ -0,0 +1,117 @@ +btTriangleCallback.o btTriangleCallback.o: \ + BulletCollision/CollisionShapes/btTriangleCallback.cpp \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: diff --git a/src/bullet/src/.deps/btTriangleIndexVertexArray.Po b/src/bullet/src/.deps/btTriangleIndexVertexArray.Po new file mode 100644 index 000000000..148503805 --- /dev/null +++ b/src/bullet/src/.deps/btTriangleIndexVertexArray.Po @@ -0,0 +1,136 @@ +btTriangleIndexVertexArray.o btTriangleIndexVertexArray.o: \ + BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp \ + BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + LinearMath/btScalar.h + +BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h: + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btScalar.h: diff --git a/src/bullet/src/.deps/btTriangleMesh.Po b/src/bullet/src/.deps/btTriangleMesh.Po new file mode 100644 index 000000000..719fd6063 --- /dev/null +++ b/src/bullet/src/.deps/btTriangleMesh.Po @@ -0,0 +1,133 @@ +btTriangleMesh.o btTriangleMesh.o: \ + BulletCollision/CollisionShapes/btTriangleMesh.cpp \ + BulletCollision/CollisionShapes/btTriangleMesh.h \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception + +BulletCollision/CollisionShapes/btTriangleMesh.h: + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: diff --git a/src/bullet/src/.deps/btTriangleMeshShape.Po b/src/bullet/src/.deps/btTriangleMeshShape.Po new file mode 100644 index 000000000..77906830c --- /dev/null +++ b/src/bullet/src/.deps/btTriangleMeshShape.Po @@ -0,0 +1,160 @@ +btTriangleMeshShape.o btTriangleMeshShape.o: \ + BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \ + BulletCollision/CollisionShapes/btTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + LinearMath/btQuaternion.h LinearMath/btAabbUtil2.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h + +BulletCollision/CollisionShapes/btTriangleMeshShape.h: + +BulletCollision/CollisionShapes/btConcaveShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btTriangleCallback.h: + +BulletCollision/CollisionShapes/btStridingMeshInterface.h: + +LinearMath/btQuaternion.h: + +LinearMath/btAabbUtil2.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: diff --git a/src/bullet/src/.deps/btTypedConstraint.Po b/src/bullet/src/.deps/btTypedConstraint.Po new file mode 100644 index 000000000..e94ab8a99 --- /dev/null +++ b/src/bullet/src/.deps/btTypedConstraint.Po @@ -0,0 +1,164 @@ +btTypedConstraint.o btTypedConstraint.o: \ + BulletDynamics/ConstraintSolver/btTypedConstraint.cpp \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h BulletDynamics/Dynamics/btRigidBody.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btScalar.h \ + LinearMath/btAlignedAllocator.h /usr/include/c++/4.1.0/new \ + /usr/include/c++/4.1.0/exception LinearMath/btPoint3.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btMinMax.h \ + LinearMath/btTransform.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h + +BulletDynamics/ConstraintSolver/btTypedConstraint.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btUniformScalingShape.Po b/src/bullet/src/.deps/btUniformScalingShape.Po new file mode 100644 index 000000000..3d7ce6c0b --- /dev/null +++ b/src/bullet/src/.deps/btUniformScalingShape.Po @@ -0,0 +1,152 @@ +btUniformScalingShape.o btUniformScalingShape.o: \ + BulletCollision/CollisionShapes/btUniformScalingShape.cpp \ + BulletCollision/CollisionShapes/btUniformScalingShape.h \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + LinearMath/btTransform.h LinearMath/btVector3.h LinearMath/btQuadWord.h \ + LinearMath/btScalar.h /usr/include/math.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h LinearMath/btVector3.h \ + LinearMath/btMatrix3x3.h LinearMath/btPoint3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + LinearMath/btAlignedAllocator.h + +BulletCollision/CollisionShapes/btUniformScalingShape.h: + +BulletCollision/CollisionShapes/btConvexShape.h: + +BulletCollision/CollisionShapes/btCollisionShape.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btPoint3.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionShapes/btCollisionMargin.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/.deps/btUnionFind.Po b/src/bullet/src/.deps/btUnionFind.Po new file mode 100644 index 000000000..8c5f6ea09 --- /dev/null +++ b/src/bullet/src/.deps/btUnionFind.Po @@ -0,0 +1,120 @@ +btUnionFind.o btUnionFind.o: \ + BulletCollision/CollisionDispatch/btUnionFind.cpp \ + BulletCollision/CollisionDispatch/btUnionFind.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception + +BulletCollision/CollisionDispatch/btUnionFind.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: diff --git a/src/bullet/src/.deps/btVoronoiSimplexSolver.Po b/src/bullet/src/.deps/btVoronoiSimplexSolver.Po new file mode 100644 index 000000000..6dc461392 --- /dev/null +++ b/src/bullet/src/.deps/btVoronoiSimplexSolver.Po @@ -0,0 +1,150 @@ +btVoronoiSimplexSolver.o btVoronoiSimplexSolver.o: \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + LinearMath/btVector3.h LinearMath/btQuadWord.h LinearMath/btScalar.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btPoint3.h \ + LinearMath/btVector3.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h + +BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h: + +BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btPoint3.h: + +LinearMath/btVector3.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/bits/wchar.h: + +/usr/include/gconv.h: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stdarg.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: diff --git a/src/bullet/src/.deps/btWheelInfo.Po b/src/bullet/src/.deps/btWheelInfo.Po new file mode 100644 index 000000000..7207938b5 --- /dev/null +++ b/src/bullet/src/.deps/btWheelInfo.Po @@ -0,0 +1,164 @@ +btWheelInfo.o btWheelInfo.o: BulletDynamics/Vehicle/btWheelInfo.cpp \ + BulletDynamics/Vehicle/btWheelInfo.h LinearMath/btVector3.h \ + LinearMath/btQuadWord.h LinearMath/btScalar.h /usr/include/math.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/c++/4.1.0/cstdlib \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h \ + /usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h \ + /usr/include/c++/4.1.0/cstddef \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/xlocale.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/c++/4.1.0/cfloat \ + /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h \ + /usr/include/assert.h LinearMath/btMinMax.h LinearMath/btTransform.h \ + LinearMath/btVector3.h LinearMath/btMatrix3x3.h \ + LinearMath/btQuaternion.h BulletDynamics/Dynamics/btRigidBody.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btAlignedAllocator.h \ + /usr/include/c++/4.1.0/new /usr/include/c++/4.1.0/exception \ + LinearMath/btPoint3.h LinearMath/btTransform.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + LinearMath/btScalar.h LinearMath/btAlignedAllocator.h \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + LinearMath/btTransform.h LinearMath/btMotionState.h \ + LinearMath/btTransform.h LinearMath/btAlignedAllocator.h + +BulletDynamics/Vehicle/btWheelInfo.h: + +LinearMath/btVector3.h: + +LinearMath/btQuadWord.h: + +LinearMath/btScalar.h: + +/usr/include/math.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/huge_val.h: + +/usr/include/bits/huge_valf.h: + +/usr/include/bits/huge_vall.h: + +/usr/include/bits/inf.h: + +/usr/include/bits/nan.h: + +/usr/include/bits/mathdef.h: + +/usr/include/bits/mathcalls.h: + +/usr/include/bits/mathinline.h: + +/usr/include/c++/4.1.0/cstdlib: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/c++config.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/os_defines.h: + +/usr/include/c++/4.1.0/x86_64-suse-linux/bits/cpu_defines.h: + +/usr/include/c++/4.1.0/cstddef: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/xlocale.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.1.0/cfloat: + +/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include/float.h: + +/usr/include/assert.h: + +LinearMath/btMinMax.h: + +LinearMath/btTransform.h: + +LinearMath/btVector3.h: + +LinearMath/btMatrix3x3.h: + +LinearMath/btQuaternion.h: + +BulletDynamics/Dynamics/btRigidBody.h: + +LinearMath/btAlignedObjectArray.h: + +LinearMath/btAlignedAllocator.h: + +/usr/include/c++/4.1.0/new: + +/usr/include/c++/4.1.0/exception: + +LinearMath/btPoint3.h: + +LinearMath/btTransform.h: + +BulletCollision/BroadphaseCollision/btBroadphaseProxy.h: + +LinearMath/btScalar.h: + +LinearMath/btAlignedAllocator.h: + +BulletCollision/CollisionDispatch/btCollisionObject.h: + +LinearMath/btTransform.h: + +LinearMath/btMotionState.h: + +LinearMath/btTransform.h: + +LinearMath/btAlignedAllocator.h: diff --git a/src/bullet/src/Bullet-C-Api.h b/src/bullet/src/Bullet-C-Api.h new file mode 100644 index 000000000..a196f6417 --- /dev/null +++ b/src/bullet/src/Bullet-C-Api.h @@ -0,0 +1,171 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +/* + Draft high-level generic physics C-API. For low-level access, use the physics SDK native API's. + Work in progress, functionality will be added on demand. + + If possible, use the richer Bullet C++ API, by including "btBulletDynamicsCommon.h" +*/ + +#ifndef BULLET_C_API_H +#define BULLET_C_API_H + +#define PL_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name + +#ifdef BT_USE_DOUBLE_PRECISION +typedef double plReal; +#else +typedef float plReal; +#endif + +typedef plReal plVector3[3]; +typedef plReal plQuaternion[4]; + +#ifdef __cplusplus +extern "C" { +#endif + +/* Particular physics SDK */ + PL_DECLARE_HANDLE(plPhysicsSdkHandle); + +/* Dynamics world, belonging to some physics SDK */ + PL_DECLARE_HANDLE(plDynamicsWorldHandle); + +/* Rigid Body that can be part of a Dynamics World */ + PL_DECLARE_HANDLE(plRigidBodyHandle); + +/* Collision Shape/Geometry, property of a Rigid Body */ + PL_DECLARE_HANDLE(plCollisionShapeHandle); + +/* Constraint for Rigid Bodies */ + PL_DECLARE_HANDLE(plConstraintHandle); + +/* Triangle Mesh interface */ + PL_DECLARE_HANDLE(plMeshInterfaceHandle); + +/* Broadphase Scene/Proxy Handles */ + PL_DECLARE_HANDLE(plCollisionBroadphaseHandle); + PL_DECLARE_HANDLE(plBroadphaseProxyHandle); + PL_DECLARE_HANDLE(plCollisionWorldHandle); + +/* + Create and Delete a Physics SDK +*/ + + extern plPhysicsSdkHandle plNewBulletSdk(); //this could be also another sdk, like ODE, PhysX etc. + extern void plDeletePhysicsSdk(plPhysicsSdkHandle physicsSdk); + +/* Collision World, not strictly necessary, you can also just create a Dynamics World with Rigid Bodies which internally manages the Collision World with Collision Objects */ + + typedef void(*btBroadphaseCallback)(void* clientData, void* object1,void* object2); + + extern plCollisionBroadphaseHandle plCreateSapBroadphase(btBroadphaseCallback beginCallback,btBroadphaseCallback endCallback); + + extern void plDestroyBroadphase(plCollisionBroadphaseHandle bp); + + extern plBroadphaseProxyHandle plCreateProxy(plCollisionBroadphaseHandle bp, void* clientData, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ); + + extern void plDestroyProxy(plCollisionBroadphaseHandle bp, plBroadphaseProxyHandle proxyHandle); + + extern void plSetBoundingBox(plBroadphaseProxyHandle proxyHandle, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ); + +/* todo: add pair cache support with queries like add/remove/find pair */ + + extern plCollisionWorldHandle plCreateCollisionWorld(plPhysicsSdkHandle physicsSdk); + +/* todo: add/remove objects */ + + +/* Dynamics World */ + + extern plDynamicsWorldHandle plCreateDynamicsWorld(plPhysicsSdkHandle physicsSdk); + + extern void plDeleteDynamicsWorld(plDynamicsWorldHandle world); + + extern void plStepSimulation(plDynamicsWorldHandle, plReal timeStep); + + extern void plAddRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object); + + extern void plRemoveRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object); + + +/* Rigid Body */ + + extern plRigidBodyHandle plCreateRigidBody( void* user_data, float mass, plCollisionShapeHandle cshape ); + + extern void plDeleteRigidBody(plRigidBodyHandle body); + + +/* Collision Shape definition */ + + extern plCollisionShapeHandle plNewSphereShape(plReal radius); + extern plCollisionShapeHandle plNewBoxShape(plReal x, plReal y, plReal z); + extern plCollisionShapeHandle plNewCapsuleShape(plReal radius, plReal height); + extern plCollisionShapeHandle plNewConeShape(plReal radius, plReal height); + extern plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height); + extern plCollisionShapeHandle plNewCompoundShape(); + extern void plAddChildShape(plCollisionShapeHandle compoundShape,plCollisionShapeHandle childShape, plVector3 childPos,plQuaternion childOrn); + + extern void plDeleteShape(plCollisionShapeHandle shape); + + /* Convex Meshes */ + extern plCollisionShapeHandle plNewConvexHullShape(); + extern void plAddVertex(plCollisionShapeHandle convexHull, plReal x,plReal y,plReal z); +/* Concave static triangle meshes */ + extern plMeshInterfaceHandle plNewMeshInterface(); + extern void plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2); + extern plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle); + + extern void plSetScaling(plCollisionShapeHandle shape, plVector3 scaling); + +/* SOLID has Response Callback/Table/Management */ +/* PhysX has Triggers, User Callbacks and filtering */ +/* ODE has the typedef void dNearCallback (void *data, dGeomID o1, dGeomID o2); */ + +/* typedef void plUpdatedPositionCallback(void* userData, plRigidBodyHandle rbHandle, plVector3 pos); */ +/* typedef void plUpdatedOrientationCallback(void* userData, plRigidBodyHandle rbHandle, plQuaternion orientation); */ + + /* get world transform */ + extern void plGetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix); + extern void plGetPosition(plRigidBodyHandle object,plVector3 position); + extern void plGetOrientation(plRigidBodyHandle object,plQuaternion orientation); + + /* set world transform (position/orientation) */ + extern void plSetPosition(plRigidBodyHandle object, const plVector3 position); + extern void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation); + extern void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient); + + typedef struct plRayCastResult { + plRigidBodyHandle m_body; + plCollisionShapeHandle m_shape; + plVector3 m_positionWorld; + plVector3 m_normalWorld; + } plRayCastResult; + + extern int plRayCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plRayCastResult res); + + /* Sweep API */ + + /* extern plRigidBodyHandle plObjectCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal); */ + + /* Continuous Collision Detection API */ + +#ifdef __cplusplus +} +#endif + +#endif //BULLET_C_API_H + diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp b/src/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp new file mode 100644 index 000000000..d7eea33ea --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp @@ -0,0 +1,38 @@ + +//Bullet Continuous Collision Detection and Physics Library +//Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + + +// +// btAxisSweep3 +// +// Copyright (c) 2006 Simon Hobbs +// +// This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +#include "btAxisSweep3.h" + +#include + +btAxisSweep3::btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned short int maxHandles, btOverlappingPairCache* pairCache) +:btAxisSweep3Internal(worldAabbMin,worldAabbMax,0xfffe,0xffff,maxHandles,pairCache) +{ + // 1 handle is reserved as sentinel + btAssert(maxHandles > 1 && maxHandles < 32767); + +} + + +bt32BitAxisSweep3::bt32BitAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned int maxHandles , btOverlappingPairCache* pairCache ) +:btAxisSweep3Internal(worldAabbMin,worldAabbMax,0xfffffffe,0x7fffffff,maxHandles,pairCache) +{ + // 1 handle is reserved as sentinel + btAssert(maxHandles > 1 && maxHandles < 2147483647); +} diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h b/src/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h new file mode 100644 index 000000000..d36df6e66 --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h @@ -0,0 +1,880 @@ +//Bullet Continuous Collision Detection and Physics Library +//Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +// +// btAxisSweep3.h +// +// Copyright (c) 2006 Simon Hobbs +// +// This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. + +#ifndef AXIS_SWEEP_3_H +#define AXIS_SWEEP_3_H + +#include "LinearMath/btPoint3.h" +#include "LinearMath/btVector3.h" +#include "btOverlappingPairCache.h" +#include "btBroadphaseInterface.h" +#include "btBroadphaseProxy.h" +#include "btOverlappingPairCallback.h" + +//#define DEBUG_BROADPHASE 1 + +/// btAxisSweep3Internal is an internal template class that implements sweep and prune. +/// Dont use this class directly, use btAxisSweep3 or bt32BitAxisSweep3 instead. +template +class btAxisSweep3Internal : public btBroadphaseInterface +{ +protected: + + BP_FP_INT_TYPE m_bpHandleMask; + BP_FP_INT_TYPE m_handleSentinel; + +public: + + + class Edge + { + public: + BP_FP_INT_TYPE m_pos; // low bit is min/max + BP_FP_INT_TYPE m_handle; + + BP_FP_INT_TYPE IsMax() const {return m_pos & 1;} + }; + +public: + ATTRIBUTE_ALIGNED16(class) Handle : public btBroadphaseProxy + { + public: + BT_DECLARE_ALIGNED_ALLOCATOR(); + + // indexes into the edge arrays + BP_FP_INT_TYPE m_minEdges[3], m_maxEdges[3]; // 6 * 2 = 12 +// BP_FP_INT_TYPE m_uniqueId; + BP_FP_INT_TYPE m_pad; + + //void* m_pOwner; this is now in btBroadphaseProxy.m_clientObject + + SIMD_FORCE_INLINE void SetNextFree(BP_FP_INT_TYPE next) {m_minEdges[0] = next;} + SIMD_FORCE_INLINE BP_FP_INT_TYPE GetNextFree() const {return m_minEdges[0];} + }; // 24 bytes + 24 for Edge structures = 44 bytes total per entry + + +protected: + btPoint3 m_worldAabbMin; // overall system bounds + btPoint3 m_worldAabbMax; // overall system bounds + + btVector3 m_quantize; // scaling factor for quantization + + BP_FP_INT_TYPE m_numHandles; // number of active handles + BP_FP_INT_TYPE m_maxHandles; // max number of handles + Handle* m_pHandles; // handles pool + BP_FP_INT_TYPE m_firstFreeHandle; // free handles list + + Edge* m_pEdges[3]; // edge arrays for the 3 axes (each array has m_maxHandles * 2 + 2 sentinel entries) + + btOverlappingPairCache* m_pairCache; + + ///btOverlappingPairCallback is an additional optional user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache. + btOverlappingPairCallback* m_userPairCallback; + + bool m_ownsPairCache; + + int m_invalidPair; + + // allocation/deallocation + BP_FP_INT_TYPE allocHandle(); + void freeHandle(BP_FP_INT_TYPE handle); + + + bool testOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB); + +#ifdef DEBUG_BROADPHASE + void debugPrintAxis(int axis,bool checkCardinality=true); +#endif //DEBUG_BROADPHASE + + //Overlap* AddOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB); + //void RemoveOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB); + + void quantize(BP_FP_INT_TYPE* out, const btPoint3& point, int isMax) const; + + void sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps ); + void sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps ); + void sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps ); + void sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps ); + +public: + + btAxisSweep3Internal(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel, BP_FP_INT_TYPE maxHandles = 16384, btOverlappingPairCache* pairCache=0); + + virtual ~btAxisSweep3Internal(); + + + virtual void calculateOverlappingPairs(btDispatcher* dispatcher); + + BP_FP_INT_TYPE addHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher); + void removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher); + void updateHandle(BP_FP_INT_TYPE handle, const btPoint3& aabbMin,const btPoint3& aabbMax,btDispatcher* dispatcher); + SIMD_FORCE_INLINE Handle* getHandle(BP_FP_INT_TYPE index) const {return m_pHandles + index;} + + void processAllOverlappingPairs(btOverlapCallback* callback); + + //Broadphase Interface + virtual btBroadphaseProxy* createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher); + virtual void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher); + virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher); + + bool testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); + + btOverlappingPairCache* getOverlappingPairCache() + { + return m_pairCache; + } + const btOverlappingPairCache* getOverlappingPairCache() const + { + return m_pairCache; + } + + void setOverlappingPairUserCallback(btOverlappingPairCallback* pairCallback) + { + m_userPairCallback = pairCallback; + } + const btOverlappingPairCallback* getOverlappingPairUserCallback() const + { + return m_userPairCallback; + } +}; + +//////////////////////////////////////////////////////////////////// + + + + +#ifdef DEBUG_BROADPHASE +#include + +template +void btAxisSweep3::debugPrintAxis(int axis, bool checkCardinality) +{ + int numEdges = m_pHandles[0].m_maxEdges[axis]; + printf("SAP Axis %d, numEdges=%d\n",axis,numEdges); + + int i; + for (i=0;im_handle); + int handleIndex = pEdge->IsMax()? pHandlePrev->m_maxEdges[axis] : pHandlePrev->m_minEdges[axis]; + char beginOrEnd; + beginOrEnd=pEdge->IsMax()?'E':'B'; + printf(" [%c,h=%d,p=%x,i=%d]\n",beginOrEnd,pEdge->m_handle,pEdge->m_pos,handleIndex); + } + + if (checkCardinality) + assert(numEdges == m_numHandles*2+1); +} +#endif //DEBUG_BROADPHASE + +template +btBroadphaseProxy* btAxisSweep3Internal::createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher) +{ + (void)shapeType; + BP_FP_INT_TYPE handleId = addHandle(aabbMin,aabbMax, userPtr,collisionFilterGroup,collisionFilterMask,dispatcher); + + Handle* handle = getHandle(handleId); + + return handle; +} + + + +template +void btAxisSweep3Internal::destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher) +{ + Handle* handle = static_cast(proxy); + removeHandle(handle->m_uniqueId,dispatcher); +} + +template +void btAxisSweep3Internal::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher) +{ + Handle* handle = static_cast(proxy); + updateHandle(handle->m_uniqueId,aabbMin,aabbMax,dispatcher); + +} + + + + + +template +btAxisSweep3Internal::btAxisSweep3Internal(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel,BP_FP_INT_TYPE maxHandles, btOverlappingPairCache* pairCache ) +:m_bpHandleMask(handleMask), +m_handleSentinel(handleSentinel), +m_pairCache(pairCache), +m_userPairCallback(0), +m_ownsPairCache(false), +m_invalidPair(0) +{ + if (!m_pairCache) + { + void* ptr = btAlignedAlloc(sizeof(btOverlappingPairCache),16); + m_pairCache = new(ptr) btOverlappingPairCache(); + m_ownsPairCache = true; + } + + //assert(bounds.HasVolume()); + + // init bounds + m_worldAabbMin = worldAabbMin; + m_worldAabbMax = worldAabbMax; + + btVector3 aabbSize = m_worldAabbMax - m_worldAabbMin; + + BP_FP_INT_TYPE maxInt = m_handleSentinel; + + m_quantize = btVector3(btScalar(maxInt),btScalar(maxInt),btScalar(maxInt)) / aabbSize; + + // allocate handles buffer and put all handles on free list + void* ptr = btAlignedAlloc(sizeof(Handle)*maxHandles,16); + m_pHandles = new(ptr) Handle[maxHandles]; + m_maxHandles = maxHandles; + m_numHandles = 0; + + // handle 0 is reserved as the null index, and is also used as the sentinel + m_firstFreeHandle = 1; + { + for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < maxHandles; i++) + m_pHandles[i].SetNextFree(i + 1); + m_pHandles[maxHandles - 1].SetNextFree(0); + } + + { + // allocate edge buffers + for (int i = 0; i < 3; i++) + { + void* ptr = btAlignedAlloc(sizeof(Edge)*maxHandles*2,16); + m_pEdges[i] = new(ptr) Edge[maxHandles * 2]; + } + } + //removed overlap management + + // make boundary sentinels + + m_pHandles[0].m_clientObject = 0; + + for (int axis = 0; axis < 3; axis++) + { + m_pHandles[0].m_minEdges[axis] = 0; + m_pHandles[0].m_maxEdges[axis] = 1; + + m_pEdges[axis][0].m_pos = 0; + m_pEdges[axis][0].m_handle = 0; + m_pEdges[axis][1].m_pos = m_handleSentinel; + m_pEdges[axis][1].m_handle = 0; +#ifdef DEBUG_BROADPHASE + debugPrintAxis(axis); +#endif //DEBUG_BROADPHASE + + } + +} + +template +btAxisSweep3Internal::~btAxisSweep3Internal() +{ + + for (int i = 2; i >= 0; i--) + { + btAlignedFree(m_pEdges[i]); + } + btAlignedFree(m_pHandles); + + if (m_ownsPairCache) + { + m_pairCache->~btOverlappingPairCache(); + btAlignedFree(m_pairCache); + } +} + +template +void btAxisSweep3Internal::quantize(BP_FP_INT_TYPE* out, const btPoint3& point, int isMax) const +{ + btPoint3 clampedPoint(point); + + + + clampedPoint.setMax(m_worldAabbMin); + clampedPoint.setMin(m_worldAabbMax); + + btVector3 v = (clampedPoint - m_worldAabbMin) * m_quantize; + out[0] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getX() & m_bpHandleMask) | isMax); + out[1] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getY() & m_bpHandleMask) | isMax); + out[2] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getZ() & m_bpHandleMask) | isMax); + +} + + +template +BP_FP_INT_TYPE btAxisSweep3Internal::allocHandle() +{ + assert(m_firstFreeHandle); + + BP_FP_INT_TYPE handle = m_firstFreeHandle; + m_firstFreeHandle = getHandle(handle)->GetNextFree(); + m_numHandles++; + + return handle; +} + +template +void btAxisSweep3Internal::freeHandle(BP_FP_INT_TYPE handle) +{ + assert(handle > 0 && handle < m_maxHandles); + + getHandle(handle)->SetNextFree(m_firstFreeHandle); + m_firstFreeHandle = handle; + + m_numHandles--; +} + + +template +BP_FP_INT_TYPE btAxisSweep3Internal::addHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher) +{ + // quantize the bounds + BP_FP_INT_TYPE min[3], max[3]; + quantize(min, aabbMin, 0); + quantize(max, aabbMax, 1); + + // allocate a handle + BP_FP_INT_TYPE handle = allocHandle(); + + + Handle* pHandle = getHandle(handle); + + pHandle->m_uniqueId = handle; + //pHandle->m_pOverlaps = 0; + pHandle->m_clientObject = pOwner; + pHandle->m_collisionFilterGroup = collisionFilterGroup; + pHandle->m_collisionFilterMask = collisionFilterMask; + + // compute current limit of edge arrays + BP_FP_INT_TYPE limit = m_numHandles * 2; + + + // insert new edges just inside the max boundary edge + for (BP_FP_INT_TYPE axis = 0; axis < 3; axis++) + { + + m_pHandles[0].m_maxEdges[axis] += 2; + + m_pEdges[axis][limit + 1] = m_pEdges[axis][limit - 1]; + + m_pEdges[axis][limit - 1].m_pos = min[axis]; + m_pEdges[axis][limit - 1].m_handle = handle; + + m_pEdges[axis][limit].m_pos = max[axis]; + m_pEdges[axis][limit].m_handle = handle; + + pHandle->m_minEdges[axis] = limit - 1; + pHandle->m_maxEdges[axis] = limit; + } + + // now sort the new edges to their correct position + sortMinDown(0, pHandle->m_minEdges[0], dispatcher,false); + sortMaxDown(0, pHandle->m_maxEdges[0], dispatcher,false); + sortMinDown(1, pHandle->m_minEdges[1], dispatcher,false); + sortMaxDown(1, pHandle->m_maxEdges[1], dispatcher,false); + sortMinDown(2, pHandle->m_minEdges[2], dispatcher,true); + sortMaxDown(2, pHandle->m_maxEdges[2], dispatcher,true); + + + return handle; +} + + +template +void btAxisSweep3Internal::removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher) +{ + + Handle* pHandle = getHandle(handle); + + //explicitly remove the pairs containing the proxy + //we could do it also in the sortMinUp (passing true) + //todo: compare performance + m_pairCache->removeOverlappingPairsContainingProxy(pHandle,dispatcher); + + + // compute current limit of edge arrays + int limit = m_numHandles * 2; + + int axis; + + for (axis = 0;axis<3;axis++) + { + m_pHandles[0].m_maxEdges[axis] -= 2; + } + + // remove the edges by sorting them up to the end of the list + for ( axis = 0; axis < 3; axis++) + { + Edge* pEdges = m_pEdges[axis]; + BP_FP_INT_TYPE max = pHandle->m_maxEdges[axis]; + pEdges[max].m_pos = m_handleSentinel; + + sortMaxUp(axis,max,dispatcher,false); + + + BP_FP_INT_TYPE i = pHandle->m_minEdges[axis]; + pEdges[i].m_pos = m_handleSentinel; + + + sortMinUp(axis,i,dispatcher,false); + + pEdges[limit-1].m_handle = 0; + pEdges[limit-1].m_pos = m_handleSentinel; + +#ifdef DEBUG_BROADPHASE + debugPrintAxis(axis,false); +#endif //DEBUG_BROADPHASE + + + } + + + // free the handle + freeHandle(handle); + + +} + +extern int gOverlappingPairs; +#include + +template +void btAxisSweep3Internal::calculateOverlappingPairs(btDispatcher* dispatcher) +{ +#ifdef USE_LAZY_REMOVAL + + if (m_ownsPairCache) + { + + btBroadphasePairArray& overlappingPairArray = m_pairCache->getOverlappingPairArray(); + + //perform a sort, to find duplicates and to sort 'invalid' pairs to the end + overlappingPairArray.heapSort(btBroadphasePairSortPredicate()); + + overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair); + m_invalidPair = 0; + + + int i; + + btBroadphasePair previousPair; + previousPair.m_pProxy0 = 0; + previousPair.m_pProxy1 = 0; + previousPair.m_algorithm = 0; + + + for (i=0;iprocessOverlap(pair); + } else + { + needsRemoval = true; + } + } else + { + //remove duplicate + needsRemoval = true; + //should have no algorithm + btAssert(!pair.m_algorithm); + } + + if (needsRemoval) + { + m_pairCache->cleanOverlappingPair(pair,dispatcher); + + // m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1); + // m_overlappingPairArray.pop_back(); + pair.m_pProxy0 = 0; + pair.m_pProxy1 = 0; + m_invalidPair++; + gOverlappingPairs--; + } + + } + + ///if you don't like to skip the invalid pairs in the array, execute following code: + #define CLEAN_INVALID_PAIRS 1 + #ifdef CLEAN_INVALID_PAIRS + + //perform a sort, to sort 'invalid' pairs to the end + overlappingPairArray.heapSort(btBroadphasePairSortPredicate()); + + overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair); + m_invalidPair = 0; + #endif//CLEAN_INVALID_PAIRS + + //printf("overlappingPairArray.size()=%d\n",overlappingPairArray.size()); + } +#endif //USE_LAZY_REMOVAL + + + + +} + + +template +bool btAxisSweep3Internal::testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) +{ + const Handle* pHandleA = static_cast(proxy0); + const Handle* pHandleB = static_cast(proxy1); + + //optimization 1: check the array index (memory address), instead of the m_pos + + for (int axis = 0; axis < 3; axis++) + { + if (pHandleA->m_maxEdges[axis] < pHandleB->m_minEdges[axis] || + pHandleB->m_maxEdges[axis] < pHandleA->m_minEdges[axis]) + { + return false; + } + } + return true; +} + +template +bool btAxisSweep3Internal::testOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB) +{ + //optimization 1: check the array index (memory address), instead of the m_pos + + for (int axis = 0; axis < 3; axis++) + { + if (axis != ignoreAxis) + { + if (pHandleA->m_maxEdges[axis] < pHandleB->m_minEdges[axis] || + pHandleB->m_maxEdges[axis] < pHandleA->m_minEdges[axis]) + { + return false; + } + } + } + + //optimization 2: only 2 axis need to be tested (conflicts with 'delayed removal' optimization) + + /*for (int axis = 0; axis < 3; axis++) + { + if (m_pEdges[axis][pHandleA->m_maxEdges[axis]].m_pos < m_pEdges[axis][pHandleB->m_minEdges[axis]].m_pos || + m_pEdges[axis][pHandleB->m_maxEdges[axis]].m_pos < m_pEdges[axis][pHandleA->m_minEdges[axis]].m_pos) + { + return false; + } + } + */ + + return true; +} + +template +void btAxisSweep3Internal::updateHandle(BP_FP_INT_TYPE handle, const btPoint3& aabbMin,const btPoint3& aabbMax,btDispatcher* dispatcher) +{ +// assert(bounds.IsFinite()); + //assert(bounds.HasVolume()); + + Handle* pHandle = getHandle(handle); + + // quantize the new bounds + BP_FP_INT_TYPE min[3], max[3]; + quantize(min, aabbMin, 0); + quantize(max, aabbMax, 1); + + // update changed edges + for (int axis = 0; axis < 3; axis++) + { + BP_FP_INT_TYPE emin = pHandle->m_minEdges[axis]; + BP_FP_INT_TYPE emax = pHandle->m_maxEdges[axis]; + + int dmin = (int)min[axis] - (int)m_pEdges[axis][emin].m_pos; + int dmax = (int)max[axis] - (int)m_pEdges[axis][emax].m_pos; + + m_pEdges[axis][emin].m_pos = min[axis]; + m_pEdges[axis][emax].m_pos = max[axis]; + + // expand (only adds overlaps) + if (dmin < 0) + sortMinDown(axis, emin,dispatcher,true); + + if (dmax > 0) + sortMaxUp(axis, emax,dispatcher,true); + + // shrink (only removes overlaps) + if (dmin > 0) + sortMinUp(axis, emin,dispatcher,true); + + if (dmax < 0) + sortMaxDown(axis, emax,dispatcher,true); + +#ifdef DEBUG_BROADPHASE + debugPrintAxis(axis); +#endif //DEBUG_BROADPHASE + } + + +} + + + + +// sorting a min edge downwards can only ever *add* overlaps +template +void btAxisSweep3Internal::sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps) +{ + + Edge* pEdge = m_pEdges[axis] + edge; + Edge* pPrev = pEdge - 1; + Handle* pHandleEdge = getHandle(pEdge->m_handle); + + while (pEdge->m_pos < pPrev->m_pos) + { + Handle* pHandlePrev = getHandle(pPrev->m_handle); + + if (pPrev->IsMax()) + { + // if previous edge is a maximum check the bounds and add an overlap if necessary + if (updateOverlaps && testOverlap(axis,pHandleEdge, pHandlePrev)) + { + m_pairCache->addOverlappingPair(pHandleEdge,pHandlePrev); + if (m_userPairCallback) + m_userPairCallback->addOverlappingPair(pHandleEdge,pHandlePrev); + + //AddOverlap(pEdge->m_handle, pPrev->m_handle); + + } + + // update edge reference in other handle + pHandlePrev->m_maxEdges[axis]++; + } + else + pHandlePrev->m_minEdges[axis]++; + + pHandleEdge->m_minEdges[axis]--; + + // swap the edges + Edge swap = *pEdge; + *pEdge = *pPrev; + *pPrev = swap; + + // decrement + pEdge--; + pPrev--; + } + +#ifdef DEBUG_BROADPHASE + debugPrintAxis(axis); +#endif //DEBUG_BROADPHASE + +} + +// sorting a min edge upwards can only ever *remove* overlaps +template +void btAxisSweep3Internal::sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps) +{ + Edge* pEdge = m_pEdges[axis] + edge; + Edge* pNext = pEdge + 1; + Handle* pHandleEdge = getHandle(pEdge->m_handle); + + while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos)) + { + Handle* pHandleNext = getHandle(pNext->m_handle); + + if (pNext->IsMax()) + { +#ifndef USE_LAZY_REMOVAL + // if next edge is maximum remove any overlap between the two handles + if (updateOverlaps) + { + Handle* handle0 = getHandle(pEdge->m_handle); + Handle* handle1 = getHandle(pNext->m_handle); + + m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher); + if (m_userPairCallback) + m_userPairCallback->removeOverlappingPair(handle0,handle1); + + } +#endif //USE_LAZY_REMOVAL + + // update edge reference in other handle + pHandleNext->m_maxEdges[axis]--; + } + else + pHandleNext->m_minEdges[axis]--; + + pHandleEdge->m_minEdges[axis]++; + + // swap the edges + Edge swap = *pEdge; + *pEdge = *pNext; + *pNext = swap; + + // increment + pEdge++; + pNext++; + } + + +} + +// sorting a max edge downwards can only ever *remove* overlaps +template +void btAxisSweep3Internal::sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps) +{ + + Edge* pEdge = m_pEdges[axis] + edge; + Edge* pPrev = pEdge - 1; + Handle* pHandleEdge = getHandle(pEdge->m_handle); + + while (pEdge->m_pos < pPrev->m_pos) + { + Handle* pHandlePrev = getHandle(pPrev->m_handle); + + if (!pPrev->IsMax()) + { + // if previous edge was a minimum remove any overlap between the two handles + if (updateOverlaps) + { + //this is done during the overlappingpairarray iteration/narrowphase collision +#ifndef USE_LAZY_REMOVAL + Handle* handle0 = getHandle(pEdge->m_handle); + Handle* handle1 = getHandle(pPrev->m_handle); + m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher); + if (m_userPairCallback) + m_userPairCallback->removeOverlappingPair(handle0,handle1); + +#endif //USE_LAZY_REMOVAL + + } + + // update edge reference in other handle + pHandlePrev->m_minEdges[axis]++;; + } + else + pHandlePrev->m_maxEdges[axis]++; + + pHandleEdge->m_maxEdges[axis]--; + + // swap the edges + Edge swap = *pEdge; + *pEdge = *pPrev; + *pPrev = swap; + + // decrement + pEdge--; + pPrev--; + } + + +#ifdef DEBUG_BROADPHASE + debugPrintAxis(axis); +#endif //DEBUG_BROADPHASE + +} + +// sorting a max edge upwards can only ever *add* overlaps +template +void btAxisSweep3Internal::sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps) +{ + Edge* pEdge = m_pEdges[axis] + edge; + Edge* pNext = pEdge + 1; + Handle* pHandleEdge = getHandle(pEdge->m_handle); + + while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos)) + { + Handle* pHandleNext = getHandle(pNext->m_handle); + + if (!pNext->IsMax()) + { + // if next edge is a minimum check the bounds and add an overlap if necessary + if (updateOverlaps && testOverlap(axis, pHandleEdge, pHandleNext)) + { + Handle* handle0 = getHandle(pEdge->m_handle); + Handle* handle1 = getHandle(pNext->m_handle); + m_pairCache->addOverlappingPair(handle0,handle1); + if (m_userPairCallback) + m_userPairCallback->addOverlappingPair(handle0,handle1); + } + + // update edge reference in other handle + pHandleNext->m_minEdges[axis]--; + } + else + pHandleNext->m_maxEdges[axis]--; + + pHandleEdge->m_maxEdges[axis]++; + + // swap the edges + Edge swap = *pEdge; + *pEdge = *pNext; + *pNext = swap; + + // increment + pEdge++; + pNext++; + } + +} + + + +//////////////////////////////////////////////////////////////////// + + +/// btAxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase. +/// It uses arrays rather then lists for storage of the 3 axis. Also it operates using 16 bit integer coordinates instead of floats. +/// For large worlds and many objects, use bt32BitAxisSweep3 instead. bt32BitAxisSweep3 has higher precision and allows more then 16384 objects at the cost of more memory and bit of performance. +class btAxisSweep3 : public btAxisSweep3Internal +{ +public: + + btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned short int maxHandles = 16384, btOverlappingPairCache* pairCache = 0); + +}; + +/// bt32BitAxisSweep3 allows higher precision quantization and more objects compared to the btAxisSweep3 sweep and prune. +/// This comes at the cost of more memory per handle, and a bit slower performance. +/// It uses arrays rather then lists for storage of the 3 axis. +class bt32BitAxisSweep3 : public btAxisSweep3Internal +{ +public: + + bt32BitAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned int maxHandles = 1500000, btOverlappingPairCache* pairCache = 0); + +}; + +#endif + diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h b/src/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h new file mode 100644 index 000000000..97ba20743 --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h @@ -0,0 +1,46 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BROADPHASE_INTERFACE_H +#define BROADPHASE_INTERFACE_H + + + +struct btDispatcherInfo; +class btDispatcher; +#include "btBroadphaseProxy.h" +class btOverlappingPairCache; + +#include "LinearMath/btVector3.h" + +///BroadphaseInterface for aabb-overlapping object pairs +class btBroadphaseInterface +{ +public: + virtual ~btBroadphaseInterface() {} + + virtual btBroadphaseProxy* createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher) =0; + virtual void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)=0; + virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher)=0; + + ///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb + virtual void calculateOverlappingPairs(btDispatcher* dispatcher)=0; + + virtual btOverlappingPairCache* getOverlappingPairCache()=0; + virtual const btOverlappingPairCache* getOverlappingPairCache() const =0; + +}; + +#endif //BROADPHASE_INTERFACE_H diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp b/src/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp new file mode 100644 index 000000000..f4d7341f8 --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp @@ -0,0 +1,17 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btBroadphaseProxy.h" + diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h b/src/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h new file mode 100644 index 000000000..f0a462cce --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h @@ -0,0 +1,232 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BROADPHASE_PROXY_H +#define BROADPHASE_PROXY_H + +#include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE +#include "LinearMath/btAlignedAllocator.h" + + +/// btDispatcher uses these types +/// IMPORTANT NOTE:The types are ordered polyhedral, implicit convex and concave +/// to facilitate type checking +enum BroadphaseNativeTypes +{ +// polyhedral convex shapes + BOX_SHAPE_PROXYTYPE, + TRIANGLE_SHAPE_PROXYTYPE, + TETRAHEDRAL_SHAPE_PROXYTYPE, + CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE, + CONVEX_HULL_SHAPE_PROXYTYPE, +//implicit convex shapes +IMPLICIT_CONVEX_SHAPES_START_HERE, + SPHERE_SHAPE_PROXYTYPE, + MULTI_SPHERE_SHAPE_PROXYTYPE, + CAPSULE_SHAPE_PROXYTYPE, + CONE_SHAPE_PROXYTYPE, + CONVEX_SHAPE_PROXYTYPE, + CYLINDER_SHAPE_PROXYTYPE, + UNIFORM_SCALING_SHAPE_PROXYTYPE, + MINKOWSKI_SUM_SHAPE_PROXYTYPE, + MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE, +//concave shapes +CONCAVE_SHAPES_START_HERE, + //keep all the convex shapetype below here, for the check IsConvexShape in broadphase proxy! + TRIANGLE_MESH_SHAPE_PROXYTYPE, + ///used for demo integration FAST/Swift collision library and Bullet + FAST_CONCAVE_MESH_PROXYTYPE, + //terrain + TERRAIN_SHAPE_PROXYTYPE, +///Used for GIMPACT Trimesh integration + GIMPACT_SHAPE_PROXYTYPE, + + EMPTY_SHAPE_PROXYTYPE, + STATIC_PLANE_PROXYTYPE, +CONCAVE_SHAPES_END_HERE, + + COMPOUND_SHAPE_PROXYTYPE, + + MAX_BROADPHASE_COLLISION_TYPES +}; + + +///btBroadphaseProxy +ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy +{ + +BT_DECLARE_ALIGNED_ALLOCATOR(); + + ///optional filtering to cull potential collisions + enum CollisionFilterGroups + { + DefaultFilter = 1, + StaticFilter = 2, + KinematicFilter = 4, + DebrisFilter = 8, + SensorTrigger = 16, + AllFilter = DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger + }; + + //Usually the client btCollisionObject or Rigidbody class + void* m_clientObject; + + ///in the case of btMultiSapBroadphase, we store the collifionFilterGroup/Mask in the m_multiSapParentProxy + union + { + struct + { + short int m_collisionFilterGroup; + short int m_collisionFilterMask; + }; + + void* m_multiSapParentProxy; + + }; + + int m_uniqueId;//m_uniqueId is introduced for paircache. could get rid of this, by calculating the address offset etc. + int m_unusedPadding; //making the structure 16 bytes, better for alignment etc. + + SIMD_FORCE_INLINE int getUid() + { + return m_uniqueId;//(int)this; + } + + //used for memory pools + btBroadphaseProxy() :m_clientObject(0){} + + btBroadphaseProxy(void* userPtr,short int collisionFilterGroup, short int collisionFilterMask) + :m_clientObject(userPtr), + m_collisionFilterGroup(collisionFilterGroup), + m_collisionFilterMask(collisionFilterMask) + { + } + + + + static SIMD_FORCE_INLINE bool isPolyhedral(int proxyType) + { + return (proxyType < IMPLICIT_CONVEX_SHAPES_START_HERE); + } + + static SIMD_FORCE_INLINE bool isConvex(int proxyType) + { + return (proxyType < CONCAVE_SHAPES_START_HERE); + } + + static SIMD_FORCE_INLINE bool isConcave(int proxyType) + { + return ((proxyType > CONCAVE_SHAPES_START_HERE) && + (proxyType < CONCAVE_SHAPES_END_HERE)); + } + static SIMD_FORCE_INLINE bool isCompound(int proxyType) + { + return (proxyType == COMPOUND_SHAPE_PROXYTYPE); + } + static SIMD_FORCE_INLINE bool isInfinite(int proxyType) + { + return (proxyType == STATIC_PLANE_PROXYTYPE); + } + +} +; + +class btCollisionAlgorithm; + +struct btBroadphaseProxy; + + + +/// contains a pair of aabb-overlapping objects +ATTRIBUTE_ALIGNED16(struct) btBroadphasePair +{ + btBroadphasePair () + : + m_pProxy0(0), + m_pProxy1(0), + m_algorithm(0), + m_userInfo(0) + { + } + +BT_DECLARE_ALIGNED_ALLOCATOR(); + + btBroadphasePair(const btBroadphasePair& other) + : m_pProxy0(other.m_pProxy0), + m_pProxy1(other.m_pProxy1), + m_algorithm(other.m_algorithm), + m_userInfo(other.m_userInfo) + { + } + btBroadphasePair(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) + { + + //keep them sorted, so the std::set operations work + if (&proxy0 < &proxy1) + { + m_pProxy0 = &proxy0; + m_pProxy1 = &proxy1; + } + else + { + m_pProxy0 = &proxy1; + m_pProxy1 = &proxy0; + } + + m_algorithm = 0; + m_userInfo = 0; + + } + + btBroadphaseProxy* m_pProxy0; + btBroadphaseProxy* m_pProxy1; + + mutable btCollisionAlgorithm* m_algorithm; + mutable void* m_userInfo; + +}; + +/* +//comparison for set operation, see Solid DT_Encounter +SIMD_FORCE_INLINE bool operator<(const btBroadphasePair& a, const btBroadphasePair& b) +{ + return a.m_pProxy0 < b.m_pProxy0 || + (a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 < b.m_pProxy1); +} +*/ + + + +class btBroadphasePairSortPredicate +{ + public: + + bool operator() ( const btBroadphasePair& a, const btBroadphasePair& b ) + { + return a.m_pProxy0 > b.m_pProxy0 || + (a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 > b.m_pProxy1) || + (a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 == b.m_pProxy1 && a.m_algorithm > b.m_algorithm); + } +}; + + +SIMD_FORCE_INLINE bool operator==(const btBroadphasePair& a, const btBroadphasePair& b) +{ + return (a.m_pProxy0 == b.m_pProxy0) && (a.m_pProxy1 == b.m_pProxy1); +} + + +#endif //BROADPHASE_PROXY_H + diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp b/src/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp new file mode 100644 index 000000000..c95d1be0f --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp @@ -0,0 +1,23 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btCollisionAlgorithm.h" +#include "btDispatcher.h" + +btCollisionAlgorithm::btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci) +{ + m_dispatcher = ci.m_dispatcher1; +} + diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h b/src/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h new file mode 100644 index 000000000..610eab4ce --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h @@ -0,0 +1,77 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COLLISION_ALGORITHM_H +#define COLLISION_ALGORITHM_H + +#include "LinearMath/btScalar.h" + +struct btBroadphaseProxy; +class btDispatcher; +class btManifoldResult; +class btCollisionObject; +struct btDispatcherInfo; +class btPersistentManifold; + + +struct btCollisionAlgorithmConstructionInfo +{ + btCollisionAlgorithmConstructionInfo() + :m_dispatcher1(0), + m_manifold(0) + { + } + btCollisionAlgorithmConstructionInfo(btDispatcher* dispatcher,int temp) + :m_dispatcher1(dispatcher) + { + (void)temp; + } + + btDispatcher* m_dispatcher1; + btPersistentManifold* m_manifold; + + int getDispatcherId(); + +}; + + +///btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatcher. +///It is persistent over frames +class btCollisionAlgorithm +{ + +protected: + + btDispatcher* m_dispatcher; + +protected: + int getDispatcherId(); + +public: + + btCollisionAlgorithm() {}; + + btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci); + + virtual ~btCollisionAlgorithm() {}; + + virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0; + + virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0; + +}; + + +#endif //COLLISION_ALGORITHM_H diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp b/src/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp new file mode 100644 index 000000000..20768225b --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp @@ -0,0 +1,22 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btDispatcher.h" + +btDispatcher::~btDispatcher() +{ + +} + diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.h b/src/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.h new file mode 100644 index 000000000..daea11f77 --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.h @@ -0,0 +1,99 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _DISPATCHER_H +#define _DISPATCHER_H + +#include "LinearMath/btScalar.h" + +class btCollisionAlgorithm; +struct btBroadphaseProxy; +class btRigidBody; +class btCollisionObject; +class btOverlappingPairCache; + + +class btPersistentManifold; +class btStackAlloc; + +struct btDispatcherInfo +{ + enum DispatchFunc + { + DISPATCH_DISCRETE = 1, + DISPATCH_CONTINUOUS + }; + btDispatcherInfo() + :m_timeStep(btScalar(0.)), + m_stepCount(0), + m_dispatchFunc(DISPATCH_DISCRETE), + m_timeOfImpact(btScalar(1.)), + m_useContinuous(false), + m_debugDraw(0), + m_enableSatConvex(false), + m_enableSPU(false), + m_stackAllocator(0) + { + + } + btScalar m_timeStep; + int m_stepCount; + int m_dispatchFunc; + btScalar m_timeOfImpact; + bool m_useContinuous; + class btIDebugDraw* m_debugDraw; + bool m_enableSatConvex; + bool m_enableSPU; + btStackAlloc* m_stackAllocator; + +}; + +/// btDispatcher can be used in combination with broadphase to dispatch overlapping pairs. +/// For example for pairwise collision detection or user callbacks (game logic). +class btDispatcher +{ + + +public: + virtual ~btDispatcher() ; + + virtual btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold=0) = 0; + + virtual btPersistentManifold* getNewManifold(void* body0,void* body1)=0; + + virtual void releaseManifold(btPersistentManifold* manifold)=0; + + virtual void clearManifold(btPersistentManifold* manifold)=0; + + virtual bool needsCollision(btCollisionObject* body0,btCollisionObject* body1) = 0; + + virtual bool needsResponse(btCollisionObject* body0,btCollisionObject* body1)=0; + + virtual void dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher)=0; + + virtual int getNumManifolds() const = 0; + + virtual btPersistentManifold* getManifoldByIndexInternal(int index) = 0; + + virtual btPersistentManifold** getInternalManifoldPointer() = 0; + + virtual void* allocateCollisionAlgorithm(int size) = 0; + + virtual void freeCollisionAlgorithm(void* ptr) = 0; + +}; + + +#endif //_DISPATCHER_H diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp b/src/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp new file mode 100644 index 000000000..a75689c99 --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp @@ -0,0 +1,204 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btMultiSapBroadphase.h" + +#include "btSimpleBroadphase.h" +#include "LinearMath/btAabbUtil2.h" + +/// btSapBroadphaseArray m_sapBroadphases; + +/// btOverlappingPairCache* m_overlappingPairs; +extern int gOverlappingPairs; + +btMultiSapBroadphase::btMultiSapBroadphase(int maxProxies,btOverlappingPairCache* pairCache) +:m_overlappingPairs(pairCache), +m_ownsPairCache(false), +m_invalidPair(0) +{ + if (!m_overlappingPairs) + { + m_ownsPairCache = true; + void* mem = btAlignedAlloc(sizeof(btOverlappingPairCache),16); + m_overlappingPairs = new (mem)btOverlappingPairCache(); + } + + struct btMultiSapOverlapFilterCallback : public btOverlapFilterCallback + { + virtual ~btMultiSapOverlapFilterCallback() + {} + // return true when pairs need collision + virtual bool needBroadphaseCollision(btBroadphaseProxy* childProxy0,btBroadphaseProxy* childProxy1) const + { + btMultiSapBroadphase::btMultiSapProxy* multiSapProxy0 = (btMultiSapBroadphase::btMultiSapProxy*)childProxy0->m_multiSapParentProxy; + btMultiSapBroadphase::btMultiSapProxy* multiSapProxy1 = (btMultiSapBroadphase::btMultiSapProxy*)childProxy1->m_multiSapParentProxy; + + bool collides = (multiSapProxy0->m_collisionFilterGroup & multiSapProxy1->m_collisionFilterMask) != 0; + collides = collides && (multiSapProxy1->m_collisionFilterGroup & multiSapProxy0->m_collisionFilterMask); + + return collides; + } + }; + + void* mem = btAlignedAlloc(sizeof(btMultiSapOverlapFilterCallback),16); + m_filterCallback = new (mem)btMultiSapOverlapFilterCallback(); + + m_overlappingPairs->setOverlapFilterCallback(m_filterCallback); + mem = btAlignedAlloc(sizeof(btSimpleBroadphase),16); + m_simpleBroadphase = new (mem) btSimpleBroadphase(maxProxies,m_overlappingPairs); +} + +btMultiSapBroadphase::~btMultiSapBroadphase() +{ + if (m_ownsPairCache) + { + btAlignedFree(m_overlappingPairs); + } +} + +btBroadphaseProxy* btMultiSapBroadphase::createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher) +{ + void* mem = btAlignedAlloc(sizeof(btMultiSapProxy),16); + btMultiSapProxy* proxy = new (mem)btMultiSapProxy(aabbMin, aabbMax,shapeType,userPtr, collisionFilterGroup,collisionFilterMask); + m_multiSapProxies.push_back(proxy); + + ///we don't pass the userPtr but our multisap proxy. We need to patch this, before processing an actual collision + ///this is needed to be able to calculate the aabb overlap + btBroadphaseProxy* simpleProxy = m_simpleBroadphase->createProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask, dispatcher); + simpleProxy->m_multiSapParentProxy = proxy; + + mem = btAlignedAlloc(sizeof(btChildProxy),16); + btChildProxy* childProxyRef = new btChildProxy(); + childProxyRef->m_proxy = simpleProxy; + childProxyRef->m_childBroadphase = m_simpleBroadphase; + proxy->m_childProxies.push_back(childProxyRef); + + ///this should deal with inserting/removal into child broadphases + setAabb(proxy,aabbMin,aabbMax,dispatcher); + return proxy; +} + +void btMultiSapBroadphase::destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher) +{ + ///not yet + btAssert(0); + +} +void btMultiSapBroadphase::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher) +{ + btMultiSapProxy* multiProxy = static_cast(proxy); + multiProxy->m_aabbMin = aabbMin; + multiProxy->m_aabbMax = aabbMax; + + for (int i=0;im_childProxies.size();i++) + { + btChildProxy* childProxyRef = multiProxy->m_childProxies[i]; + childProxyRef->m_childBroadphase->setAabb(childProxyRef->m_proxy,aabbMin,aabbMax,dispatcher); + } + +} + + ///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb +void btMultiSapBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher) +{ + m_simpleBroadphase->calculateOverlappingPairs(dispatcher); + +#ifndef USE_HASH_PAIRCACHE + + btBroadphasePairArray& overlappingPairArray = m_overlappingPairs->getOverlappingPairArray(); + + //perform a sort, to find duplicates and to sort 'invalid' pairs to the end + overlappingPairArray.heapSort(btBroadphasePairSortPredicate()); + + overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair); + m_invalidPair = 0; + + + btBroadphasePair previousPair; + previousPair.m_pProxy0 = 0; + previousPair.m_pProxy1 = 0; + previousPair.m_algorithm = 0; + + int i; + + for (i=0;iprocessOverlap(pair); + } else + { + needsRemoval = true; + } + } else + { + //remove duplicate + needsRemoval = true; + //should have no algorithm + btAssert(!pair.m_algorithm); + } + + if (needsRemoval) + { + m_overlappingPairs->cleanOverlappingPair(pair,dispatcher); + + // m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1); + // m_overlappingPairArray.pop_back(); + pair.m_pProxy0 = 0; + pair.m_pProxy1 = 0; + m_invalidPair++; + gOverlappingPairs--; + } + + } + +///if you don't like to skip the invalid pairs in the array, execute following code: +#define CLEAN_INVALID_PAIRS 1 +#ifdef CLEAN_INVALID_PAIRS + + //perform a sort, to sort 'invalid' pairs to the end + overlappingPairArray.heapSort(btBroadphasePairSortPredicate()); + + overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair); + m_invalidPair = 0; +#endif//CLEAN_INVALID_PAIRS + +#endif //USE_HASH_PAIRCACHE + +} + + +bool btMultiSapBroadphase::testAabbOverlap(btBroadphaseProxy* childProxy0,btBroadphaseProxy* childProxy1) +{ + btMultiSapProxy* multiSapProxy0 = (btMultiSapProxy*)childProxy0->m_multiSapParentProxy; + btMultiSapProxy* multiSapProxy1 = (btMultiSapProxy*)childProxy1->m_multiSapParentProxy; + + return TestAabbAgainstAabb2(multiSapProxy0->m_aabbMin,multiSapProxy0->m_aabbMax, + multiSapProxy1->m_aabbMin,multiSapProxy1->m_aabbMax); + +} diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h b/src/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h new file mode 100644 index 000000000..1ee609b8d --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h @@ -0,0 +1,119 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef BT_MULTI_SAP_BROADPHASE +#define BT_MULTI_SAP_BROADPHASE + +#include "btBroadphaseInterface.h" +#include "LinearMath/btAlignedObjectArray.h" +#include "btOverlappingPairCache.h" + +class btAxisSweep3; +class btSimpleBroadphase; + + +typedef btAlignedObjectArray btSapBroadphaseArray; + +///multi SAP broadphase +///See http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=328 +///and http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329 +class btMultiSapBroadphase :public btBroadphaseInterface +{ + btSapBroadphaseArray m_sapBroadphases; + + btSimpleBroadphase* m_simpleBroadphase; + + btOverlappingPairCache* m_overlappingPairs; + + bool m_ownsPairCache; + + btOverlapFilterCallback* m_filterCallback; + + int m_invalidPair; + + struct btChildProxy + { + btBroadphaseProxy* m_proxy; + btBroadphaseInterface* m_childBroadphase; + }; + +public: + + struct btMultiSapProxy : public btBroadphaseProxy + { + + ///array with all the entries that this proxy belongs to + btAlignedObjectArray m_childProxies; + btVector3 m_aabbMin; + btVector3 m_aabbMax; + + int m_shapeType; + void* m_userPtr; + short int m_collisionFilterGroup; + short int m_collisionFilterMask; + + btMultiSapProxy(const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask) + :m_aabbMin(aabbMin), + m_aabbMax(aabbMax), + m_shapeType(shapeType), + m_userPtr(userPtr), + m_collisionFilterGroup(collisionFilterGroup), + m_collisionFilterMask(collisionFilterMask) + { + + } + + + }; + +protected: + + btAlignedObjectArray m_multiSapProxies; + +public: + + btMultiSapBroadphase(int maxProxies = 16384,btOverlappingPairCache* pairCache=0); + + btSapBroadphaseArray getBroadphaseArray() + { + return m_sapBroadphases; + } + + const btSapBroadphaseArray getBroadphaseArray() const + { + return m_sapBroadphases; + } + + virtual ~btMultiSapBroadphase(); + + virtual btBroadphaseProxy* createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher); + virtual void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher); + virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher); + + ///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb + virtual void calculateOverlappingPairs(btDispatcher* dispatcher); + + bool testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); + + virtual btOverlappingPairCache* getOverlappingPairCache() + { + return m_overlappingPairs; + } + virtual const btOverlappingPairCache* getOverlappingPairCache() const + { + return m_overlappingPairs; + } +}; + +#endif //BT_MULTI_SAP_BROADPHASE diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp b/src/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp new file mode 100644 index 000000000..ea01656ca --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp @@ -0,0 +1,474 @@ + +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#include "btOverlappingPairCache.h" + +#include "btDispatcher.h" +#include "btCollisionAlgorithm.h" + +int gOverlappingPairs = 0; + +int gRemovePairs =0; +int gAddedPairs =0; +int gFindPairs =0; + +btOverlappingPairCache::btOverlappingPairCache(): + m_overlapFilterCallback(0), + m_blockedForChanges(false) +{ + int initialAllocatedSize= 2; + m_overlappingPairArray.reserve(initialAllocatedSize); +#ifdef USE_HASH_PAIRCACHE + growTables(); +#endif //USE_HASH_PAIRCACHE +} + + +btOverlappingPairCache::~btOverlappingPairCache() +{ + //todo/test: show we erase/delete data, or is it automatic +} + +void btOverlappingPairCache::cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher) +{ + if (pair.m_algorithm) + { + { + pair.m_algorithm->~btCollisionAlgorithm(); + dispatcher->freeCollisionAlgorithm(pair.m_algorithm); + pair.m_algorithm=0; + } + } +} + + +void btOverlappingPairCache::cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher) +{ + + class CleanPairCallback : public btOverlapCallback + { + btBroadphaseProxy* m_cleanProxy; + btOverlappingPairCache* m_pairCache; + btDispatcher* m_dispatcher; + + public: + CleanPairCallback(btBroadphaseProxy* cleanProxy,btOverlappingPairCache* pairCache,btDispatcher* dispatcher) + :m_cleanProxy(cleanProxy), + m_pairCache(pairCache), + m_dispatcher(dispatcher) + { + } + virtual bool processOverlap(btBroadphasePair& pair) + { + if ((pair.m_pProxy0 == m_cleanProxy) || + (pair.m_pProxy1 == m_cleanProxy)) + { + m_pairCache->cleanOverlappingPair(pair,m_dispatcher); + } + return false; + } + + }; + + CleanPairCallback cleanPairs(proxy,this,dispatcher); + + processAllOverlappingPairs(&cleanPairs,dispatcher); + +} + +void btOverlappingPairCache::removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher) +{ + + class RemovePairCallback : public btOverlapCallback + { + btBroadphaseProxy* m_obsoleteProxy; + + public: + RemovePairCallback(btBroadphaseProxy* obsoleteProxy) + :m_obsoleteProxy(obsoleteProxy) + { + } + virtual bool processOverlap(btBroadphasePair& pair) + { + return ((pair.m_pProxy0 == m_obsoleteProxy) || + (pair.m_pProxy1 == m_obsoleteProxy)); + } + + }; + + + RemovePairCallback removeCallback(proxy); + + processAllOverlappingPairs(&removeCallback,dispatcher); +} + + +#ifdef USE_HASH_PAIRCACHE + + + + + + + +btBroadphasePair* btOverlappingPairCache::findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) +{ + gFindPairs++; + + int proxyId1 = proxy0->getUid(); + int proxyId2 = proxy1->getUid(); + + if (proxyId1 > proxyId2) + btSwap(proxyId1, proxyId2); + + int hash = getHash(proxyId1, proxyId2) & (m_overlappingPairArray.capacity()-1); + + int index = m_hashTable[hash]; + while (index != BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == false) + { + index = m_next[index]; + } + + if (index == BT_NULL_PAIR) + { + return NULL; + } + + btAssert(index < m_overlappingPairArray.size()); + + return &m_overlappingPairArray[index]; +} + +#include + +void btOverlappingPairCache::growTables() +{ + + int newCapacity = m_overlappingPairArray.capacity(); + + if (m_hashTable.size() < newCapacity) + { + //grow hashtable and next table + int curHashtableSize = m_hashTable.size(); + + m_hashTable.resize(newCapacity); + m_next.resize(newCapacity); + + + int i; + + for (i= 0; i < newCapacity; ++i) + { + m_hashTable[i] = BT_NULL_PAIR; + } + for (i = 0; i < newCapacity; ++i) + { + m_next[i] = BT_NULL_PAIR; + } + + for(i=0;igetUid(); + int proxyId2 = pair.m_pProxy1->getUid(); + if (proxyId1 > proxyId2) + btSwap(proxyId1, proxyId2); + int hashValue = getHash(proxyId1,proxyId2) & (m_overlappingPairArray.capacity()-1); // New hash value with new mask + m_next[i] = m_hashTable[hashValue]; + m_hashTable[hashValue] = i; + } + + + } +} + +btBroadphasePair* btOverlappingPairCache::internalAddPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) +{ + int proxyId1 = proxy0->getUid(); + int proxyId2 = proxy1->getUid(); + + if (proxyId1 > proxyId2) + btSwap(proxyId1, proxyId2); + + int hash = getHash(proxyId1, proxyId2) & (m_overlappingPairArray.capacity()-1); + + + + btBroadphasePair* pair = internalFindPair(proxy0, proxy1, hash); + if (pair != NULL) + { + return pair; + } + + int count = m_overlappingPairArray.size(); + int oldCapacity = m_overlappingPairArray.capacity(); + void* mem = &m_overlappingPairArray.expand(); + int newCapacity = m_overlappingPairArray.capacity(); + + if (oldCapacity < newCapacity) + { + growTables(); + //hash with new capacity + hash = getHash(proxyId1, proxyId2) & (m_overlappingPairArray.capacity()-1); + } + + pair = new (mem) btBroadphasePair(*proxy0,*proxy1); +// pair->m_pProxy0 = proxy0; +// pair->m_pProxy1 = proxy1; + pair->m_algorithm = 0; + pair->m_userInfo = 0; + + + m_next[count] = m_hashTable[hash]; + m_hashTable[hash] = count; + + return pair; +} + + + +void* btOverlappingPairCache::removeOverlappingPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1,btDispatcher* dispatcher) +{ + gRemovePairs++; + + int proxyId1 = proxy0->getUid(); + int proxyId2 = proxy1->getUid(); + + if (proxyId1 > proxyId2) + btSwap(proxyId1, proxyId2); + + int hash = getHash(proxyId1, proxyId2) & (m_overlappingPairArray.capacity()-1); + + btBroadphasePair* pair = internalFindPair(proxy0, proxy1, hash); + if (pair == NULL) + { + return 0; + } + + cleanOverlappingPair(*pair,dispatcher); + + void* userData = pair->m_userInfo; + + btAssert(pair->m_pProxy0->getUid() == proxyId1); + btAssert(pair->m_pProxy1->getUid() == proxyId2); + + int pairIndex = int(pair - &m_overlappingPairArray[0]); + btAssert(pairIndex < m_overlappingPairArray.size()); + + // Remove the pair from the hash table. + int index = m_hashTable[hash]; + btAssert(index != BT_NULL_PAIR); + + int previous = BT_NULL_PAIR; + while (index != pairIndex) + { + previous = index; + index = m_next[index]; + } + + if (previous != BT_NULL_PAIR) + { + btAssert(m_next[previous] == pairIndex); + m_next[previous] = m_next[pairIndex]; + } + else + { + m_hashTable[hash] = m_next[pairIndex]; + } + + // We now move the last pair into spot of the + // pair being removed. We need to fix the hash + // table indices to support the move. + + int lastPairIndex = m_overlappingPairArray.size() - 1; + + // If the removed pair is the last pair, we are done. + if (lastPairIndex == pairIndex) + { + m_overlappingPairArray.pop_back(); + return userData; + } + + // Remove the last pair from the hash table. + const btBroadphasePair* last = &m_overlappingPairArray[lastPairIndex]; + int lastHash = getHash(last->m_pProxy0->getUid(), last->m_pProxy1->getUid()) & (m_overlappingPairArray.capacity()-1); + + index = m_hashTable[lastHash]; + btAssert(index != BT_NULL_PAIR); + + previous = BT_NULL_PAIR; + while (index != lastPairIndex) + { + previous = index; + index = m_next[index]; + } + + if (previous != BT_NULL_PAIR) + { + btAssert(m_next[previous] == lastPairIndex); + m_next[previous] = m_next[lastPairIndex]; + } + else + { + m_hashTable[lastHash] = m_next[lastPairIndex]; + } + + // Copy the last pair into the remove pair's spot. + m_overlappingPairArray[pairIndex] = m_overlappingPairArray[lastPairIndex]; + + // Insert the last pair into the hash table + m_next[pairIndex] = m_hashTable[lastHash]; + m_hashTable[lastHash] = pairIndex; + + m_overlappingPairArray.pop_back(); + + return userData; +} +#include + +void btOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback,btDispatcher* dispatcher) +{ + + int i; + +// printf("m_overlappingPairArray.size()=%d\n",m_overlappingPairArray.size()); + for (i=0;iprocessOverlap(*pair)) + { + removeOverlappingPair(pair->m_pProxy0,pair->m_pProxy1,dispatcher); + + gOverlappingPairs--; + } else + { + i++; + } + } +} + +#else + + + + +void* btOverlappingPairCache::removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1, btDispatcher* dispatcher ) +{ +#ifndef USE_LAZY_REMOVAL + + btBroadphasePair findPair(*proxy0,*proxy1); + + int findIndex = m_overlappingPairArray.findLinearSearch(findPair); + if (findIndex < m_overlappingPairArray.size()) + { + gOverlappingPairs--; + btBroadphasePair& pair = m_overlappingPairArray[findIndex]; + void* userData = pair.m_userInfo; + cleanOverlappingPair(pair,dispatcher); + + m_overlappingPairArray.swap(findIndex,m_overlappingPairArray.capacity()-1); + m_overlappingPairArray.pop_back(); + return userData; + } +#endif //USE_LAZY_REMOVAL + + return 0; +} + + + + + + + + +btBroadphasePair* btOverlappingPairCache::addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) +{ + //don't add overlap with own + assert(proxy0 != proxy1); + + if (!needsBroadphaseCollision(proxy0,proxy1)) + return 0; + + void* mem = &m_overlappingPairArray.expand(); + btBroadphasePair* pair = new (mem) btBroadphasePair(*proxy0,*proxy1); + gOverlappingPairs++; + return pair; + +} + +///this findPair becomes really slow. Either sort the list to speedup the query, or +///use a different solution. It is mainly used for Removing overlapping pairs. Removal could be delayed. +///we could keep a linked list in each proxy, and store pair in one of the proxies (with lowest memory address) +///Also we can use a 2D bitmap, which can be useful for a future GPU implementation + btBroadphasePair* btOverlappingPairCache::findPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) +{ + if (!needsBroadphaseCollision(proxy0,proxy1)) + return 0; + + btBroadphasePair tmpPair(*proxy0,*proxy1); + int findIndex = m_overlappingPairArray.findLinearSearch(tmpPair); + + if (findIndex < m_overlappingPairArray.size()) + { + //assert(it != m_overlappingPairSet.end()); + btBroadphasePair* pair = &m_overlappingPairArray[findIndex]; + return pair; + } + return 0; +} + + + + + + + + + + +#include + +void btOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback,btDispatcher* dispatcher) +{ + + int i; + + for (i=0;iprocessOverlap(*pair)) + { + cleanOverlappingPair(*pair,dispatcher); + + m_overlappingPairArray.swap(i,m_overlappingPairArray.capacity()-1); + m_overlappingPairArray.pop_back(); + gOverlappingPairs--; + } else + { + i++; + } + } +} + + + +#endif //USE_HASH_PAIRCACHE diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h b/src/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h new file mode 100644 index 000000000..8930dbaa9 --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h @@ -0,0 +1,323 @@ + +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef OVERLAPPING_PAIR_CACHE_H +#define OVERLAPPING_PAIR_CACHE_H + + +#include "btBroadphaseInterface.h" +#include "btBroadphaseProxy.h" +#include "LinearMath/btPoint3.h" +#include "LinearMath/btAlignedObjectArray.h" +class btDispatcher; + +///disable the USE_HASH_PAIRCACHE define to use a pair manager that sorts the pairs to find duplicates/non-overlap +#define USE_HASH_PAIRCACHE 1 + + +struct btOverlapCallback +{ + virtual ~btOverlapCallback() + {} + //return true for deletion of the pair + virtual bool processOverlap(btBroadphasePair& pair) = 0; +}; + +struct btOverlapFilterCallback +{ + virtual ~btOverlapFilterCallback() + {} + // return true when pairs need collision + virtual bool needBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const = 0; +}; + +typedef btAlignedObjectArray btBroadphasePairArray; + +#ifdef USE_HASH_PAIRCACHE + + +/// Hash-space based Pair Cache, thanks to Erin Catto, Box2D, http://www.box2d.org, and Pierre Terdiman, Codercorner, http://codercorner.com + +extern int gRemovePairs; +extern int gAddedPairs; +extern int gFindPairs; + +const int BT_NULL_PAIR=0xffffffff; + +class btOverlappingPairCache +{ + btBroadphasePairArray m_overlappingPairArray; + btOverlapFilterCallback* m_overlapFilterCallback; + bool m_blockedForChanges; + + +public: + btOverlappingPairCache(); + virtual ~btOverlappingPairCache(); + + + void removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher); + + void* removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher); + + SIMD_FORCE_INLINE bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const + { + if (m_overlapFilterCallback) + return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1); + + bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0; + collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask); + + return collides; + } + + // Add a pair and return the new pair. If the pair already exists, + // no new pair is created and the old one is returned. + SIMD_FORCE_INLINE btBroadphasePair* addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) + { + gAddedPairs++; + + if (!needsBroadphaseCollision(proxy0,proxy1)) + return 0; + + return internalAddPair(proxy0,proxy1); + } + + + + void cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher); + + + virtual void processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher); + + btBroadphasePair* getOverlappingPairArrayPtr() + { + return &m_overlappingPairArray[0]; + } + + const btBroadphasePair* getOverlappingPairArrayPtr() const + { + return &m_overlappingPairArray[0]; + } + + btBroadphasePairArray& getOverlappingPairArray() + { + return m_overlappingPairArray; + } + + const btBroadphasePairArray& getOverlappingPairArray() const + { + return m_overlappingPairArray; + } + + void cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher); + + + + btBroadphasePair* findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1); + + int GetCount() const { return m_overlappingPairArray.size(); } +// btBroadphasePair* GetPairs() { return m_pairs; } + + btOverlapFilterCallback* getOverlapFilterCallback() + { + return m_overlapFilterCallback; + } + + void setOverlapFilterCallback(btOverlapFilterCallback* callback) + { + m_overlapFilterCallback = callback; + } + + int getNumOverlappingPairs() const + { + return m_overlappingPairArray.size(); + } +private: + + btBroadphasePair* internalAddPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); + + void growTables(); + + SIMD_FORCE_INLINE bool equalsPair(const btBroadphasePair& pair, int proxyId1, int proxyId2) + { + return pair.m_pProxy0->getUid() == proxyId1 && pair.m_pProxy1->getUid() == proxyId2; + } + + /* + // Thomas Wang's hash, see: http://www.concentric.net/~Ttwang/tech/inthash.htm + // This assumes proxyId1 and proxyId2 are 16-bit. + SIMD_FORCE_INLINE int getHash(int proxyId1, int proxyId2) + { + int key = (proxyId2 << 16) | proxyId1; + key = ~key + (key << 15); + key = key ^ (key >> 12); + key = key + (key << 2); + key = key ^ (key >> 4); + key = key * 2057; + key = key ^ (key >> 16); + return key; + } + */ + + + + SIMD_FORCE_INLINE unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2) + { + int key = ((unsigned int)proxyId1) | (((unsigned int)proxyId1) <<16); + // Thomas Wang's hash + + key += ~(key << 15); + key ^= (key >> 10); + key += (key << 3); + key ^= (key >> 6); + key += ~(key << 11); + key ^= (key >> 16); + return key; + } + + + + + + SIMD_FORCE_INLINE btBroadphasePair* internalFindPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1, int hash) + { + int proxyId1 = proxy0->getUid(); + int proxyId2 = proxy1->getUid(); + if (proxyId1 > proxyId2) + btSwap(proxyId1, proxyId2); + + int index = m_hashTable[hash]; + + while( index != BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == false) + { + index = m_next[index]; + } + + if ( index == BT_NULL_PAIR ) + { + return NULL; + } + + btAssert(index < m_overlappingPairArray.size()); + + return &m_overlappingPairArray[index]; + } + + +public: + + btAlignedObjectArray m_hashTable; + btAlignedObjectArray m_next; + +}; + + + +#else//USE_HASH_PAIRCACHE + +#define USE_LAZY_REMOVAL 1 + +///btOverlappingPairCache maintains the objects with overlapping AABB +///Typically managed by the Broadphase, Axis3Sweep or btSimpleBroadphase +class btOverlappingPairCache +{ + protected: + //avoid brute-force finding all the time + btBroadphasePairArray m_overlappingPairArray; + + //during the dispatch, check that user doesn't destroy/create proxy + bool m_blockedForChanges; + + //if set, use the callback instead of the built in filter in needBroadphaseCollision + btOverlapFilterCallback* m_overlapFilterCallback; + + public: + + btOverlappingPairCache(); + virtual ~btOverlappingPairCache(); + + virtual void processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher); + + void* removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher); + + void cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher); + + btBroadphasePair* addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); + + btBroadphasePair* findPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); + + + void cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher); + + void removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher); + + + inline bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const + { + if (m_overlapFilterCallback) + return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1); + + bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0; + collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask); + + return collides; + } + + btBroadphasePairArray& getOverlappingPairArray() + { + return m_overlappingPairArray; + } + + const btBroadphasePairArray& getOverlappingPairArray() const + { + return m_overlappingPairArray; + } + + + + + btBroadphasePair* getOverlappingPairArrayPtr() + { + return &m_overlappingPairArray[0]; + } + + const btBroadphasePair* getOverlappingPairArrayPtr() const + { + return &m_overlappingPairArray[0]; + } + + int getNumOverlappingPairs() const + { + return m_overlappingPairArray.size(); + } + + btOverlapFilterCallback* getOverlapFilterCallback() + { + return m_overlapFilterCallback; + } + + void setOverlapFilterCallback(btOverlapFilterCallback* callback) + { + m_overlapFilterCallback = callback; + } + +}; +#endif //USE_HASH_PAIRCACHE + +#endif //OVERLAPPING_PAIR_CACHE_H + + diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h b/src/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h new file mode 100644 index 000000000..a174ac6ad --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h @@ -0,0 +1,37 @@ + +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef OVERLAPPING_PAIR_CALLBACK_H +#define OVERLAPPING_PAIR_CALLBACK_H + +///btOverlappingPairCallback provides user callback to keep track of overlap between objects, like a collision sensor +class btOverlappingPairCallback +{ +public: + virtual ~btOverlappingPairCallback() + { + + } + + virtual void addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) = 0; + + virtual void removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) = 0; + + virtual void removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy0) = 0; + +}; + +#endif //OVERLAPPING_PAIR_CALLBACK_H diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp b/src/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp new file mode 100644 index 000000000..e0bb09929 --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp @@ -0,0 +1,312 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btSimpleBroadphase.h" +#include +#include + +#include "LinearMath/btVector3.h" +#include "LinearMath/btTransform.h" +#include "LinearMath/btMatrix3x3.h" +#include + +extern int gOverlappingPairs; + +void btSimpleBroadphase::validate() +{ + for (int i=0;i~btOverlappingPairCache(); + btAlignedFree(m_pairCache); + } +} + + +btBroadphaseProxy* btSimpleBroadphase::createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher) +{ + if (m_numHandles >= m_maxHandles) + { + btAssert(0); + return 0; //should never happen, but don't let the game crash ;-) + } + assert(aabbMin[0]<= aabbMax[0] && aabbMin[1]<= aabbMax[1] && aabbMin[2]<= aabbMax[2]); + + int newHandleIndex = allocHandle(); + btSimpleBroadphaseProxy* proxy = new (&m_pHandles[newHandleIndex])btSimpleBroadphaseProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask); + + return proxy; +} + +class RemovingOverlapCallback : public btOverlapCallback +{ +protected: + virtual bool processOverlap(btBroadphasePair& pair) + { + (void)pair; + btAssert(0); + return false; + } +}; + +class RemovePairContainingProxy +{ + + btBroadphaseProxy* m_targetProxy; + public: + virtual ~RemovePairContainingProxy() + { + } +protected: + virtual bool processOverlap(btBroadphasePair& pair) + { + btSimpleBroadphaseProxy* proxy0 = static_cast(pair.m_pProxy0); + btSimpleBroadphaseProxy* proxy1 = static_cast(pair.m_pProxy1); + + return ((m_targetProxy == proxy0 || m_targetProxy == proxy1)); + }; +}; + +void btSimpleBroadphase::destroyProxy(btBroadphaseProxy* proxyOrg,btDispatcher* dispatcher) +{ + + btSimpleBroadphaseProxy* proxy0 = static_cast(proxyOrg); + freeHandle(proxy0); + + m_pairCache->removeOverlappingPairsContainingProxy(proxyOrg,dispatcher); + + //validate(); + +} + +void btSimpleBroadphase::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher) +{ + btSimpleBroadphaseProxy* sbp = getSimpleProxyFromProxy(proxy); + sbp->m_min = aabbMin; + sbp->m_max = aabbMax; +} + + + + + + + + + +bool btSimpleBroadphase::aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1) +{ + return proxy0->m_min[0] <= proxy1->m_max[0] && proxy1->m_min[0] <= proxy0->m_max[0] && + proxy0->m_min[1] <= proxy1->m_max[1] && proxy1->m_min[1] <= proxy0->m_max[1] && + proxy0->m_min[2] <= proxy1->m_max[2] && proxy1->m_min[2] <= proxy0->m_max[2]; + +} + + + +//then remove non-overlapping ones +class CheckOverlapCallback : public btOverlapCallback +{ +public: + virtual bool processOverlap(btBroadphasePair& pair) + { + return (!btSimpleBroadphase::aabbOverlap(static_cast(pair.m_pProxy0),static_cast(pair.m_pProxy1))); + } +}; + +void btSimpleBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher) +{ + //first check for new overlapping pairs + int i,j; + + if (m_firstAllocatedHandle >= 0) + { + + btSimpleBroadphaseProxy* proxy0 = &m_pHandles[m_firstAllocatedHandle]; + + for (i=0;ifindPair(proxy0,proxy1)) + { + m_pairCache->addOverlappingPair(proxy0,proxy1); + } + } else + { + #ifdef USE_HASH_PAIRCACHE + if ( m_pairCache->findPair(proxy0,proxy1)) + { + m_pairCache->removeOverlappingPair(proxy0,proxy1,dispatcher); + } + #endif //USE_HASH_PAIRCACHE + + } + } + proxy1 = &m_pHandles[proxy1->GetNextAllocated()]; + + } + proxy0 = &m_pHandles[proxy0->GetNextAllocated()]; + + } + + #ifndef USE_HASH_PAIRCACHE + + if (m_ownsPairCache) + { + + btBroadphasePairArray& overlappingPairArray = m_pairCache->getOverlappingPairArray(); + + //perform a sort, to find duplicates and to sort 'invalid' pairs to the end + overlappingPairArray.heapSort(btBroadphasePairSortPredicate()); + + overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair); + m_invalidPair = 0; + + + btBroadphasePair previousPair; + previousPair.m_pProxy0 = 0; + previousPair.m_pProxy1 = 0; + previousPair.m_algorithm = 0; + + + for (i=0;iprocessOverlap(pair); + } else + { + needsRemoval = true; + } + } else + { + //remove duplicate + needsRemoval = true; + //should have no algorithm + btAssert(!pair.m_algorithm); + } + + if (needsRemoval) + { + m_pairCache->cleanOverlappingPair(pair,dispatcher); + + // m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1); + // m_overlappingPairArray.pop_back(); + pair.m_pProxy0 = 0; + pair.m_pProxy1 = 0; + m_invalidPair++; + gOverlappingPairs--; + } + + } + + ///if you don't like to skip the invalid pairs in the array, execute following code: + #define CLEAN_INVALID_PAIRS 1 + #ifdef CLEAN_INVALID_PAIRS + + //perform a sort, to sort 'invalid' pairs to the end + overlappingPairArray.heapSort(btBroadphasePairSortPredicate()); + + overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair); + m_invalidPair = 0; + #endif//CLEAN_INVALID_PAIRS + + } + #endif //USE_HASH_PAIRCACHE + } +} + + +bool btSimpleBroadphase::testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) +{ + btSimpleBroadphaseProxy* p0 = getSimpleProxyFromProxy(proxy0); + btSimpleBroadphaseProxy* p1 = getSimpleProxyFromProxy(proxy1); + return aabbOverlap(p0,p1); +} + + + diff --git a/src/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h b/src/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h new file mode 100644 index 000000000..09367a79d --- /dev/null +++ b/src/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h @@ -0,0 +1,147 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SIMPLE_BROADPHASE_H +#define SIMPLE_BROADPHASE_H + + +#include "btOverlappingPairCache.h" + + +struct btSimpleBroadphaseProxy : public btBroadphaseProxy +{ + btVector3 m_min; + btVector3 m_max; + int m_nextFree; + int m_nextAllocated; +// int m_handleId; + + + btSimpleBroadphaseProxy() {}; + + btSimpleBroadphaseProxy(const btPoint3& minpt,const btPoint3& maxpt,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask) + :btBroadphaseProxy(userPtr,collisionFilterGroup,collisionFilterMask), + m_min(minpt),m_max(maxpt) + { + (void)shapeType; + } + + + SIMD_FORCE_INLINE void SetNextFree(int next) {m_nextFree = next;} + SIMD_FORCE_INLINE int GetNextFree() const {return m_nextFree;} + + SIMD_FORCE_INLINE void SetNextAllocated(int next) {m_nextAllocated = next;} + SIMD_FORCE_INLINE int GetNextAllocated() const {return m_nextAllocated;} + + +}; + +///SimpleBroadphase is a brute force aabb culling broadphase based on O(n^2) aabb checks +///btSimpleBroadphase is just a unit-test implementation to verify and test other broadphases. +///So please don't use this class, but use bt32BitAxisSweep3 or btAxisSweep3 instead! +class btSimpleBroadphase : public btBroadphaseInterface +{ + +protected: + + int m_numHandles; // number of active handles + int m_maxHandles; // max number of handles + btSimpleBroadphaseProxy* m_pHandles; // handles pool + int m_firstFreeHandle; // free handles list + int m_firstAllocatedHandle; + + int allocHandle() + { + + int freeHandle = m_firstFreeHandle; + m_firstFreeHandle = m_pHandles[freeHandle].GetNextFree(); + + m_pHandles[freeHandle].SetNextAllocated(m_firstAllocatedHandle); + m_firstAllocatedHandle = freeHandle; + + m_numHandles++; + + return freeHandle; + } + + void freeHandle(btSimpleBroadphaseProxy* proxy) + { + int handle = int(proxy-m_pHandles); + btAssert(handle >= 0 && handle < m_maxHandles); + + proxy->SetNextFree(m_firstFreeHandle); + m_firstFreeHandle = handle; + + m_firstAllocatedHandle = proxy->GetNextAllocated(); + proxy->SetNextAllocated(-1); + + m_numHandles--; + } + + + btOverlappingPairCache* m_pairCache; + bool m_ownsPairCache; + + int m_invalidPair; + + + + inline btSimpleBroadphaseProxy* getSimpleProxyFromProxy(btBroadphaseProxy* proxy) + { + btSimpleBroadphaseProxy* proxy0 = static_cast(proxy); + return proxy0; + } + + + void validate(); + +protected: + + + + +public: + btSimpleBroadphase(int maxProxies=16384,btOverlappingPairCache* overlappingPairCache=0); + virtual ~btSimpleBroadphase(); + + + static bool aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1); + + + virtual btBroadphaseProxy* createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher); + + virtual void calculateOverlappingPairs(btDispatcher* dispatcher); + + virtual void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher); + virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher); + + btOverlappingPairCache* getOverlappingPairCache() + { + return m_pairCache; + } + const btOverlappingPairCache* getOverlappingPairCache() const + { + return m_pairCache; + } + + bool testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); + + +}; + + + +#endif //SIMPLE_BROADPHASE_H + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp new file mode 100644 index 000000000..b322c9fd6 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp @@ -0,0 +1,200 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "LinearMath/btScalar.h" +#include "SphereTriangleDetector.h" +#include "BulletCollision/CollisionShapes/btTriangleShape.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" + + +SphereTriangleDetector::SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle) +:m_sphere(sphere), +m_triangle(triangle) +{ + +} + +void SphereTriangleDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) +{ + + (void)debugDraw; + const btTransform& transformA = input.m_transformA; + const btTransform& transformB = input.m_transformB; + + btVector3 point,normal; + btScalar timeOfImpact = btScalar(1.); + btScalar depth = btScalar(0.); +// output.m_distance = btScalar(1e30); + //move sphere into triangle space + btTransform sphereInTr = transformB.inverseTimes(transformA); + + if (collide(sphereInTr.getOrigin(),point,normal,depth,timeOfImpact)) + { + output.addContactPoint(transformB.getBasis()*normal,transformB*point,depth); + } + +} + +#define MAX_OVERLAP btScalar(0.) + + + +// See also geometrictools.com +// Basic idea: D = |p - (lo + t0*lv)| where t0 = lv . (p - lo) / lv . lv +btScalar SegmentSqrDistance(const btVector3& from, const btVector3& to,const btVector3 &p, btVector3 &nearest) { + btVector3 diff = p - from; + btVector3 v = to - from; + btScalar t = v.dot(diff); + + if (t > 0) { + btScalar dotVV = v.dot(v); + if (t < dotVV) { + t /= dotVV; + diff -= t*v; + } else { + t = 1; + diff -= v; + } + } else + t = 0; + + nearest = from + t*v; + return diff.dot(diff); +} + +bool SphereTriangleDetector::facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal) { + btVector3 lp(p); + btVector3 lnormal(normal); + + return pointInTriangle(vertices, lnormal, &lp); +} + +///combined discrete/continuous sphere-triangle +bool SphereTriangleDetector::collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact) +{ + + const btVector3* vertices = &m_triangle->getVertexPtr(0); + const btVector3& c = sphereCenter; + btScalar r = m_sphere->getRadius(); + + btVector3 delta (0,0,0); + + btVector3 normal = (vertices[1]-vertices[0]).cross(vertices[2]-vertices[0]); + normal.normalize(); + btVector3 p1ToCentre = c - vertices[0]; + btScalar distanceFromPlane = p1ToCentre.dot(normal); + + if (distanceFromPlane < btScalar(0.)) + { + //triangle facing the other way + + distanceFromPlane *= btScalar(-1.); + normal *= btScalar(-1.); + } + + ///todo: move this gContactBreakingThreshold into a proper structure + extern btScalar gContactBreakingThreshold; + + btScalar contactMargin = gContactBreakingThreshold; + bool isInsideContactPlane = distanceFromPlane < r + contactMargin; + bool isInsideShellPlane = distanceFromPlane < r; + + btScalar deltaDotNormal = delta.dot(normal); + if (!isInsideShellPlane && deltaDotNormal >= btScalar(0.0)) + return false; + + // Check for contact / intersection + bool hasContact = false; + btVector3 contactPoint; + if (isInsideContactPlane) { + if (facecontains(c,vertices,normal)) { + // Inside the contact wedge - touches a point on the shell plane + hasContact = true; + contactPoint = c - normal*distanceFromPlane; + } else { + // Could be inside one of the contact capsules + btScalar contactCapsuleRadiusSqr = (r + contactMargin) * (r + contactMargin); + btVector3 nearestOnEdge; + for (int i = 0; i < m_triangle->getNumEdges(); i++) { + + btPoint3 pa; + btPoint3 pb; + + m_triangle->getEdge(i,pa,pb); + + btScalar distanceSqr = SegmentSqrDistance(pa,pb,c, nearestOnEdge); + if (distanceSqr < contactCapsuleRadiusSqr) { + // Yep, we're inside a capsule + hasContact = true; + contactPoint = nearestOnEdge; + } + + } + } + } + + if (hasContact) { + btVector3 contactToCentre = c - contactPoint; + btScalar distanceSqr = contactToCentre.length2(); + if (distanceSqr < (r - MAX_OVERLAP)*(r - MAX_OVERLAP)) { + btScalar distance = btSqrt(distanceSqr); + resultNormal = contactToCentre; + resultNormal.normalize(); + point = contactPoint; + depth = -(r-distance); + return true; + } + + if (delta.dot(contactToCentre) >= btScalar(0.0)) + return false; + + // Moving towards the contact point -> collision + point = contactPoint; + timeOfImpact = btScalar(0.0); + return true; + } + + return false; +} + + +bool SphereTriangleDetector::pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p ) +{ + const btVector3* p1 = &vertices[0]; + const btVector3* p2 = &vertices[1]; + const btVector3* p3 = &vertices[2]; + + btVector3 edge1( *p2 - *p1 ); + btVector3 edge2( *p3 - *p2 ); + btVector3 edge3( *p1 - *p3 ); + + btVector3 p1_to_p( *p - *p1 ); + btVector3 p2_to_p( *p - *p2 ); + btVector3 p3_to_p( *p - *p3 ); + + btVector3 edge1_normal( edge1.cross(normal)); + btVector3 edge2_normal( edge2.cross(normal)); + btVector3 edge3_normal( edge3.cross(normal)); + + btScalar r1, r2, r3; + r1 = edge1_normal.dot( p1_to_p ); + r2 = edge2_normal.dot( p2_to_p ); + r3 = edge3_normal.dot( p3_to_p ); + if ( ( r1 > 0 && r2 > 0 && r3 > 0 ) || + ( r1 <= 0 && r2 <= 0 && r3 <= 0 ) ) + return true; + return false; + +} diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h b/src/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h new file mode 100644 index 000000000..0c817b221 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h @@ -0,0 +1,49 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SPHERE_TRIANGLE_DETECTOR_H +#define SPHERE_TRIANGLE_DETECTOR_H + +#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h" +#include "LinearMath/btPoint3.h" + + +class btSphereShape; +class btTriangleShape; + + + +/// sphere-triangle to match the btDiscreteCollisionDetectorInterface +struct SphereTriangleDetector : public btDiscreteCollisionDetectorInterface +{ + virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw); + + SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle); + + virtual ~SphereTriangleDetector() {}; + +private: + + bool collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact); + bool pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p ); + bool facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal); + + btSphereShape* m_sphere; + btTriangleShape* m_triangle; + + +}; +#endif //SPHERE_TRIANGLE_DETECTOR_H + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h new file mode 100644 index 000000000..fad770ac2 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h @@ -0,0 +1,47 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_COLLISION_CONFIGURATION +#define BT_COLLISION_CONFIGURATION +struct btCollisionAlgorithmCreateFunc; + +class btStackAlloc; +class btPoolAllocator; + +///btCollisionConfiguration allows to configure Bullet collision detection +///stack allocator size, default collision algorithms and persistent manifold pool size +///todo: describe the meaning +class btCollisionConfiguration +{ + +public: + + virtual ~btCollisionConfiguration() + { + } + + ///memory pools + virtual btPoolAllocator* getPersistentManifoldPool() = 0; + + virtual btPoolAllocator* getCollisionAlgorithmPool() = 0; + + virtual btStackAlloc* getStackAllocator() = 0; + + virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1) =0; + +}; + +#endif //BT_COLLISION_CONFIGURATION + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h new file mode 100644 index 000000000..c6728918d --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h @@ -0,0 +1,46 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COLLISION_CREATE_FUNC +#define COLLISION_CREATE_FUNC + +#include "LinearMath/btAlignedObjectArray.h" +typedef btAlignedObjectArray btCollisionObjectArray; +class btCollisionAlgorithm; +class btCollisionObject; + +struct btCollisionAlgorithmConstructionInfo; + +///Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm +struct btCollisionAlgorithmCreateFunc +{ + bool m_swapped; + + btCollisionAlgorithmCreateFunc() + :m_swapped(false) + { + } + virtual ~btCollisionAlgorithmCreateFunc(){}; + + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& , btCollisionObject* body0,btCollisionObject* body1) + { + + (void)body0; + (void)body1; + return 0; + } +}; +#endif //COLLISION_CREATE_FUNC + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp new file mode 100644 index 000000000..644caf267 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp @@ -0,0 +1,287 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#include "btCollisionDispatcher.h" + + +#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" + +#include "BulletCollision/CollisionShapes/btCollisionShape.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" +#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h" +#include "LinearMath/btPoolAllocator.h" +#include "BulletCollision/CollisionDispatch/btCollisionConfiguration.h" + +int gNumManifold = 0; + +#include + + + +btCollisionDispatcher::btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration): + m_count(0), + m_useIslands(true), + m_collisionConfiguration(collisionConfiguration) +{ + int i; + + setNearCallback(defaultNearCallback); + + m_collisionAlgorithmPoolAllocator = collisionConfiguration->getCollisionAlgorithmPool(); + + m_persistentManifoldPoolAllocator = collisionConfiguration->getPersistentManifoldPool(); + + for (i=0;igetCollisionAlgorithmCreateFunc(i,j); + assert(m_doubleDispatch[i][j]); + } + } + + +}; + + +void btCollisionDispatcher::registerCollisionCreateFunc(int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc *createFunc) +{ + m_doubleDispatch[proxyType0][proxyType1] = createFunc; +} + +btCollisionDispatcher::~btCollisionDispatcher() +{ +} + +btPersistentManifold* btCollisionDispatcher::getNewManifold(void* b0,void* b1) +{ + gNumManifold++; + + //btAssert(gNumManifold < 65535); + + + btCollisionObject* body0 = (btCollisionObject*)b0; + btCollisionObject* body1 = (btCollisionObject*)b1; + + void* mem = 0; + + if (m_persistentManifoldPoolAllocator->getFreeCount()) + { + mem = m_persistentManifoldPoolAllocator->allocate(sizeof(btPersistentManifold)); + } else + { + mem = btAlignedAlloc(sizeof(btPersistentManifold),16); + + } + btPersistentManifold* manifold = new(mem) btPersistentManifold (body0,body1,0); + manifold->m_index1a = m_manifoldsPtr.size(); + m_manifoldsPtr.push_back(manifold); + + return manifold; +} + +void btCollisionDispatcher::clearManifold(btPersistentManifold* manifold) +{ + manifold->clearManifold(); +} + + +void btCollisionDispatcher::releaseManifold(btPersistentManifold* manifold) +{ + + gNumManifold--; + + //printf("releaseManifold: gNumManifold %d\n",gNumManifold); + clearManifold(manifold); + + int findIndex = manifold->m_index1a; + btAssert(findIndex < m_manifoldsPtr.size()); + m_manifoldsPtr.swap(findIndex,m_manifoldsPtr.size()-1); + m_manifoldsPtr[findIndex]->m_index1a = findIndex; + m_manifoldsPtr.pop_back(); + + manifold->~btPersistentManifold(); + if (m_persistentManifoldPoolAllocator->validPtr(manifold)) + { + m_persistentManifoldPoolAllocator->free(manifold); + } else + { + btAlignedFree(manifold); + } + +} + + + +btCollisionAlgorithm* btCollisionDispatcher::findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold) +{ + + btCollisionAlgorithmConstructionInfo ci; + + ci.m_dispatcher1 = this; + ci.m_manifold = sharedManifold; + btCollisionAlgorithm* algo = m_doubleDispatch[body0->getCollisionShape()->getShapeType()][body1->getCollisionShape()->getShapeType()]->CreateCollisionAlgorithm(ci,body0,body1); + + return algo; +} + + + + + +bool btCollisionDispatcher::needsResponse(btCollisionObject* body0,btCollisionObject* body1) +{ + //here you can do filtering + bool hasResponse = + (body0->hasContactResponse() && body1->hasContactResponse()); + //no response between two static/kinematic bodies: + hasResponse = hasResponse && + ((!body0->isStaticOrKinematicObject()) ||(! body1->isStaticOrKinematicObject())); + return hasResponse; +} + +bool btCollisionDispatcher::needsCollision(btCollisionObject* body0,btCollisionObject* body1) +{ + assert(body0); + assert(body1); + + bool needsCollision = true; + + //broadphase filtering already deals with this + if ((body0->isStaticObject() || body0->isKinematicObject()) && + (body1->isStaticObject() || body1->isKinematicObject())) + { + printf("warning btCollisionDispatcher::needsCollision: static-static collision!\n"); + } + + if ((!body0->isActive()) && (!body1->isActive())) + needsCollision = false; + else if (!body0->checkCollideWith(body1)) + needsCollision = false; + + return needsCollision ; + +} + + + +///interface for iterating all overlapping collision pairs, no matter how those pairs are stored (array, set, map etc) +///this is useful for the collision dispatcher. +class btCollisionPairCallback : public btOverlapCallback +{ + btDispatcherInfo& m_dispatchInfo; + btCollisionDispatcher* m_dispatcher; + +public: + + btCollisionPairCallback(btDispatcherInfo& dispatchInfo,btCollisionDispatcher* dispatcher) + :m_dispatchInfo(dispatchInfo), + m_dispatcher(dispatcher) + { + } + + btCollisionPairCallback& operator=(btCollisionPairCallback& other) + { + m_dispatchInfo = other.m_dispatchInfo; + m_dispatcher = other.m_dispatcher; + return *this; + } + + virtual ~btCollisionPairCallback() {} + + + virtual bool processOverlap(btBroadphasePair& pair) + { + (*m_dispatcher->getNearCallback())(pair,*m_dispatcher,m_dispatchInfo); + + return false; + } +}; + + +void btCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) +{ + //m_blockedForChanges = true; + + btCollisionPairCallback collisionCallback(dispatchInfo,this); + + pairCache->processAllOverlappingPairs(&collisionCallback,dispatcher); + + //m_blockedForChanges = false; + +} + + + + +//by default, Bullet will use this near callback +void btCollisionDispatcher::defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, btDispatcherInfo& dispatchInfo) +{ + btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject; + btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject; + + if (dispatcher.needsCollision(colObj0,colObj1)) + { + //dispatcher will keep algorithms persistent in the collision pair + if (!collisionPair.m_algorithm) + { + collisionPair.m_algorithm = dispatcher.findAlgorithm(colObj0,colObj1); + } + + if (collisionPair.m_algorithm) + { + btManifoldResult contactPointResult(colObj0,colObj1); + + if (dispatchInfo.m_dispatchFunc == btDispatcherInfo::DISPATCH_DISCRETE) + { + //discrete collision detection query + collisionPair.m_algorithm->processCollision(colObj0,colObj1,dispatchInfo,&contactPointResult); + } else + { + //continuous collision detection query, time of impact (toi) + btScalar toi = collisionPair.m_algorithm->calculateTimeOfImpact(colObj0,colObj1,dispatchInfo,&contactPointResult); + if (dispatchInfo.m_timeOfImpact > toi) + dispatchInfo.m_timeOfImpact = toi; + + } + } + } + +} + + +void* btCollisionDispatcher::allocateCollisionAlgorithm(int size) +{ + if (m_collisionAlgorithmPoolAllocator->getFreeCount()) + { + return m_collisionAlgorithmPoolAllocator->allocate(size); + } + + //warn user for overflow? + return btAlignedAlloc(size,16); +} + +void btCollisionDispatcher::freeCollisionAlgorithm(void* ptr) +{ + if (m_collisionAlgorithmPoolAllocator->validPtr(ptr)) + { + m_collisionAlgorithmPoolAllocator->free(ptr); + } else + { + btAlignedFree(ptr); + } +} diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h new file mode 100644 index 000000000..45aaa1bd9 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h @@ -0,0 +1,145 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COLLISION__DISPATCHER_H +#define COLLISION__DISPATCHER_H + +#include "BulletCollision/BroadphaseCollision/btDispatcher.h" +#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" + +#include "BulletCollision/CollisionDispatch/btManifoldResult.h" + +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "LinearMath/btAlignedObjectArray.h" + +class btIDebugDraw; +class btOverlappingPairCache; +class btPoolAllocator; +class btCollisionConfiguration; + +#include "btCollisionCreateFunc.h" + +#define USE_DISPATCH_REGISTRY_ARRAY 1 + +class btCollisionDispatcher; +///user can override this nearcallback for collision filtering and more finegrained control over collision detection +typedef void (*btNearCallback)(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, btDispatcherInfo& dispatchInfo); + + +///btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs. +///Time of Impact, Closest Points and Penetration Depth. +class btCollisionDispatcher : public btDispatcher +{ + int m_count; + + btAlignedObjectArray m_manifoldsPtr; + + bool m_useIslands; + + btManifoldResult m_defaultManifoldResult; + + btNearCallback m_nearCallback; + + btPoolAllocator* m_collisionAlgorithmPoolAllocator; + + btPoolAllocator* m_persistentManifoldPoolAllocator; + + btCollisionAlgorithmCreateFunc* m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]; + + + btCollisionConfiguration* m_collisionConfiguration; + + +public: + + ///registerCollisionCreateFunc allows registration of custom/alternative collision create functions + void registerCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc); + + int getNumManifolds() const + { + return int( m_manifoldsPtr.size()); + } + + btPersistentManifold** getInternalManifoldPointer() + { + return &m_manifoldsPtr[0]; + } + + btPersistentManifold* getManifoldByIndexInternal(int index) + { + return m_manifoldsPtr[index]; + } + + const btPersistentManifold* getManifoldByIndexInternal(int index) const + { + return m_manifoldsPtr[index]; + } + + btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration); + + virtual ~btCollisionDispatcher(); + + virtual btPersistentManifold* getNewManifold(void* b0,void* b1); + + virtual void releaseManifold(btPersistentManifold* manifold); + + + virtual void clearManifold(btPersistentManifold* manifold); + + + btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold = 0); + + virtual bool needsCollision(btCollisionObject* body0,btCollisionObject* body1); + + virtual bool needsResponse(btCollisionObject* body0,btCollisionObject* body1); + + virtual void dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher); + + void setNearCallback(btNearCallback nearCallback) + { + m_nearCallback = nearCallback; + } + + btNearCallback getNearCallback() const + { + return m_nearCallback; + } + + //by default, Bullet will use this near callback + static void defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, btDispatcherInfo& dispatchInfo); + + virtual void* allocateCollisionAlgorithm(int size); + + virtual void freeCollisionAlgorithm(void* ptr); + + btCollisionConfiguration* getCollisionConfiguration() + { + return m_collisionConfiguration; + } + + const btCollisionConfiguration* getCollisionConfiguration() const + { + return m_collisionConfiguration; + } + + void setCollisionConfiguration(btCollisionConfiguration* config) + { + m_collisionConfiguration = config; + } + +}; + +#endif //COLLISION__DISPATCHER_H + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp new file mode 100644 index 000000000..6b72a131c --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp @@ -0,0 +1,62 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btCollisionObject.h" + +btCollisionObject::btCollisionObject() + : m_broadphaseHandle(0), + m_collisionShape(0), + m_collisionFlags(0), + m_islandTag1(-1), + m_companionId(-1), + m_activationState1(1), + m_deactivationTime(btScalar(0.)), + m_userObjectPointer(0), + m_internalOwner(0), + m_hitFraction(btScalar(1.)), + m_ccdSweptSphereRadius(btScalar(0.)), + m_ccdSquareMotionThreshold(btScalar(0.)), + m_checkCollideWith(false) +{ + +} + +btCollisionObject::~btCollisionObject() +{ +} + +void btCollisionObject::setActivationState(int newState) +{ + if ( (m_activationState1 != DISABLE_DEACTIVATION) && (m_activationState1 != DISABLE_SIMULATION)) + m_activationState1 = newState; +} + +void btCollisionObject::forceActivationState(int newState) +{ + m_activationState1 = newState; +} + +void btCollisionObject::activate(bool forceActivation) +{ + if (forceActivation || !(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OBJECT))) + { + setActivationState(ACTIVE_TAG); + m_deactivationTime = btScalar(0.); + } +} + + + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h new file mode 100644 index 000000000..7c1ddbf1e --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h @@ -0,0 +1,349 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COLLISION_OBJECT_H +#define COLLISION_OBJECT_H + +#include "LinearMath/btTransform.h" + +//island management, m_activationState1 +#define ACTIVE_TAG 1 +#define ISLAND_SLEEPING 2 +#define WANTS_DEACTIVATION 3 +#define DISABLE_DEACTIVATION 4 +#define DISABLE_SIMULATION 5 + +struct btBroadphaseProxy; +class btCollisionShape; +#include "LinearMath/btMotionState.h" +#include "LinearMath/btAlignedAllocator.h" + + + +/// btCollisionObject can be used to manage collision detection objects. +/// btCollisionObject maintains all information that is needed for a collision detection: Shape, Transform and AABB proxy. +/// They can be added to the btCollisionWorld. +ATTRIBUTE_ALIGNED16(class) btCollisionObject +{ + +protected: + + btTransform m_worldTransform; + + ///m_interpolationWorldTransform is used for CCD and interpolation + ///it can be either previous or future (predicted) transform + btTransform m_interpolationWorldTransform; + //those two are experimental: just added for bullet time effect, so you can still apply impulses (directly modifying velocities) + //without destroying the continuous interpolated motion (which uses this interpolation velocities) + btVector3 m_interpolationLinearVelocity; + btVector3 m_interpolationAngularVelocity; + btBroadphaseProxy* m_broadphaseHandle; + btCollisionShape* m_collisionShape; + + int m_collisionFlags; + + int m_islandTag1; + int m_companionId; + + int m_activationState1; + btScalar m_deactivationTime; + + btScalar m_friction; + btScalar m_restitution; + + ///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer + void* m_userObjectPointer; + + ///m_internalOwner is reserved to point to Bullet's btRigidBody. Don't use this, use m_userObjectPointer instead. + void* m_internalOwner; + + ///time of impact calculation + btScalar m_hitFraction; + + ///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: + btScalar m_ccdSweptSphereRadius; + + /// Don't do continuous collision detection if square motion (in one step) is less then m_ccdSquareMotionThreshold + btScalar m_ccdSquareMotionThreshold; + + /// If some object should have elaborate collision filtering by sub-classes + bool m_checkCollideWith; + + char m_pad[7]; + + virtual bool checkCollideWithOverride(btCollisionObject* co) + { + return true; + } + +public: + + BT_DECLARE_ALIGNED_ALLOCATOR(); + + enum CollisionFlags + { + CF_STATIC_OBJECT= 1, + CF_KINEMATIC_OBJECT= 2, + CF_NO_CONTACT_RESPONSE = 4, + CF_CUSTOM_MATERIAL_CALLBACK = 8//this allows per-triangle material (friction/restitution) + }; + + + SIMD_FORCE_INLINE bool mergesSimulationIslands() const + { + ///static objects, kinematic and object without contact response don't merge islands + return ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE) )==0); + } + + + SIMD_FORCE_INLINE bool isStaticObject() const { + return (m_collisionFlags & CF_STATIC_OBJECT) != 0; + } + + SIMD_FORCE_INLINE bool isKinematicObject() const + { + return (m_collisionFlags & CF_KINEMATIC_OBJECT) != 0; + } + + SIMD_FORCE_INLINE bool isStaticOrKinematicObject() const + { + return (m_collisionFlags & (CF_KINEMATIC_OBJECT | CF_STATIC_OBJECT)) != 0 ; + } + + SIMD_FORCE_INLINE bool hasContactResponse() const { + return (m_collisionFlags & CF_NO_CONTACT_RESPONSE)==0; + } + + + btCollisionObject(); + + virtual ~btCollisionObject(); + + void setCollisionShape(btCollisionShape* collisionShape) + { + m_collisionShape = collisionShape; + } + + SIMD_FORCE_INLINE const btCollisionShape* getCollisionShape() const + { + return m_collisionShape; + } + + SIMD_FORCE_INLINE btCollisionShape* getCollisionShape() + { + return m_collisionShape; + } + + + + + int getActivationState() const { return m_activationState1;} + + void setActivationState(int newState); + + void setDeactivationTime(btScalar time) + { + m_deactivationTime = time; + } + btScalar getDeactivationTime() const + { + return m_deactivationTime; + } + + void forceActivationState(int newState); + + void activate(bool forceActivation = false); + + inline bool isActive() const + { + return ((getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION)); + } + + void setRestitution(btScalar rest) + { + m_restitution = rest; + } + btScalar getRestitution() const + { + return m_restitution; + } + void setFriction(btScalar frict) + { + m_friction = frict; + } + btScalar getFriction() const + { + return m_friction; + } + + ///reserved for Bullet internal usage + void* getInternalOwner() + { + return m_internalOwner; + } + + const void* getInternalOwner() const + { + return m_internalOwner; + } + + btTransform& getWorldTransform() + { + return m_worldTransform; + } + + const btTransform& getWorldTransform() const + { + return m_worldTransform; + } + + void setWorldTransform(const btTransform& worldTrans) + { + m_worldTransform = worldTrans; + } + + + btBroadphaseProxy* getBroadphaseHandle() + { + return m_broadphaseHandle; + } + + const btBroadphaseProxy* getBroadphaseHandle() const + { + return m_broadphaseHandle; + } + + void setBroadphaseHandle(btBroadphaseProxy* handle) + { + m_broadphaseHandle = handle; + } + + + const btTransform& getInterpolationWorldTransform() const + { + return m_interpolationWorldTransform; + } + + btTransform& getInterpolationWorldTransform() + { + return m_interpolationWorldTransform; + } + + void setInterpolationWorldTransform(const btTransform& trans) + { + m_interpolationWorldTransform = trans; + } + + + const btVector3& getInterpolationLinearVelocity() const + { + return m_interpolationLinearVelocity; + } + + const btVector3& getInterpolationAngularVelocity() const + { + return m_interpolationAngularVelocity; + } + + const int getIslandTag() const + { + return m_islandTag1; + } + + void setIslandTag(int tag) + { + m_islandTag1 = tag; + } + + const int getCompanionId() const + { + return m_companionId; + } + + void setCompanionId(int id) + { + m_companionId = id; + } + + const btScalar getHitFraction() const + { + return m_hitFraction; + } + + void setHitFraction(btScalar hitFraction) + { + m_hitFraction = hitFraction; + } + + + const int getCollisionFlags() const + { + return m_collisionFlags; + } + + void setCollisionFlags(int flags) + { + m_collisionFlags = flags; + } + + ///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: + btScalar getCcdSweptSphereRadius() const + { + return m_ccdSweptSphereRadius; + } + + ///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: + void setCcdSweptSphereRadius(btScalar radius) + { + m_ccdSweptSphereRadius = radius; + } + + btScalar getCcdSquareMotionThreshold() const + { + return m_ccdSquareMotionThreshold; + } + + + /// Don't do continuous collision detection if square motion (in one step) is less then m_ccdSquareMotionThreshold + void setCcdSquareMotionThreshold(btScalar ccdSquareMotionThreshold) + { + m_ccdSquareMotionThreshold = ccdSquareMotionThreshold; + } + + ///users can point to their objects, userPointer is not used by Bullet + void* getUserPointer() const + { + return m_userObjectPointer; + } + + ///users can point to their objects, userPointer is not used by Bullet + void setUserPointer(void* userPointer) + { + m_userObjectPointer = userPointer; + } + + inline bool checkCollideWith(btCollisionObject* co) + { + if (m_checkCollideWith) + return checkCollideWithOverride(co); + + return true; + } + + +} +; + +#endif //COLLISION_OBJECT_H diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp new file mode 100644 index 000000000..b4828508b --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp @@ -0,0 +1,370 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btCollisionWorld.h" +#include "btCollisionDispatcher.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" +#include "BulletCollision/CollisionShapes/btCollisionShape.h" +#include "BulletCollision/CollisionShapes/btConvexShape.h" + +#include "BulletCollision/CollisionShapes/btSphereShape.h" //for raycasting +#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h" //for raycasting +#include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h" +#include "BulletCollision/CollisionShapes/btCompoundShape.h" +#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h" +#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h" +#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h" + +#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h" +#include "LinearMath/btAabbUtil2.h" +#include "LinearMath/btQuickprof.h" +#include "LinearMath/btStackAlloc.h" + +//When the user doesn't provide dispatcher or broadphase, create basic versions (and delete them in destructor) +#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" +#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h" +#include "BulletCollision/CollisionDispatch/btCollisionConfiguration.h" + + +btCollisionWorld::btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache, btCollisionConfiguration* collisionConfiguration) +:m_dispatcher1(dispatcher), +m_broadphasePairCache(pairCache) +{ + m_stackAlloc = collisionConfiguration->getStackAllocator(); + m_dispatchInfo.m_stackAllocator = m_stackAlloc; +} + + +btCollisionWorld::~btCollisionWorld() +{ + + //clean up remaining objects + int i; + for (i=0;igetBroadphaseHandle(); + if (bp) + { + // + // only clear the cached algorithms + // + getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bp,m_dispatcher1); + getBroadphase()->destroyProxy(bp,m_dispatcher1); + } + } + + +} + + + + + + + + + + +void btCollisionWorld::addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup,short int collisionFilterMask) +{ + + //check that the object isn't already added + btAssert( m_collisionObjects.findLinearSearch(collisionObject) == m_collisionObjects.size()); + + m_collisionObjects.push_back(collisionObject); + + //calculate new AABB + btTransform trans = collisionObject->getWorldTransform(); + + btVector3 minAabb; + btVector3 maxAabb; + collisionObject->getCollisionShape()->getAabb(trans,minAabb,maxAabb); + + int type = collisionObject->getCollisionShape()->getShapeType(); + collisionObject->setBroadphaseHandle( getBroadphase()->createProxy( + minAabb, + maxAabb, + type, + collisionObject, + collisionFilterGroup, + collisionFilterMask, + m_dispatcher1 + )) ; + + + + + +} + + + + +void btCollisionWorld::performDiscreteCollisionDetection() +{ + btDispatcherInfo& dispatchInfo = getDispatchInfo(); + + BEGIN_PROFILE("perform Broadphase Collision Detection"); + + + //update aabb (of all moved objects) + + btVector3 aabbMin,aabbMax; + for (int i=0;igetCollisionShape()->getAabb(m_collisionObjects[i]->getWorldTransform(),aabbMin,aabbMax); + m_broadphasePairCache->setAabb(m_collisionObjects[i]->getBroadphaseHandle(),aabbMin,aabbMax,m_dispatcher1); + } + + m_broadphasePairCache->calculateOverlappingPairs(m_dispatcher1); + + END_PROFILE("perform Broadphase Collision Detection"); + + BEGIN_PROFILE("performDiscreteCollisionDetection"); + + btDispatcher* dispatcher = getDispatcher(); + if (dispatcher) + dispatcher->dispatchAllCollisionPairs(m_broadphasePairCache->getOverlappingPairCache(),dispatchInfo,m_dispatcher1); + + END_PROFILE("performDiscreteCollisionDetection"); + +} + + + +void btCollisionWorld::removeCollisionObject(btCollisionObject* collisionObject) +{ + + + //bool removeFromBroadphase = false; + + { + + btBroadphaseProxy* bp = collisionObject->getBroadphaseHandle(); + if (bp) + { + // + // only clear the cached algorithms + // + getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bp,m_dispatcher1); + getBroadphase()->destroyProxy(bp,m_dispatcher1); + collisionObject->setBroadphaseHandle(0); + } + } + + + //swapremove + m_collisionObjects.remove(collisionObject); + +} + + + +void btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans, + btCollisionObject* collisionObject, + const btCollisionShape* collisionShape, + const btTransform& colObjWorldTransform, + RayResultCallback& resultCallback,short int collisionFilterMask) +{ + + btSphereShape pointShape(btScalar(0.0)); + pointShape.setMargin(0.f); + + objectQuerySingle(&pointShape,rayFromTrans,rayToTrans, + collisionObject, + collisionShape, + colObjWorldTransform, + resultCallback,collisionFilterMask); +} + +void btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const btTransform& rayFromTrans,const btTransform& rayToTrans, + btCollisionObject* collisionObject, + const btCollisionShape* collisionShape, + const btTransform& colObjWorldTransform, + RayResultCallback& resultCallback,short int collisionFilterMask) +{ + + + if (collisionShape->isConvex()) + { + btConvexCast::CastResult castResult; + castResult.m_fraction = btScalar(1.);//?? + + btConvexShape* convexShape = (btConvexShape*) collisionShape; + btVoronoiSimplexSolver simplexSolver; +#define USE_SUBSIMPLEX_CONVEX_CAST 1 +#ifdef USE_SUBSIMPLEX_CONVEX_CAST + btSubsimplexConvexCast convexCaster(castShape,convexShape,&simplexSolver); +#else + //btGjkConvexCast convexCaster(castShape,convexShape,&simplexSolver); + //btContinuousConvexCollision convexCaster(castShape,convexShape,&simplexSolver,0); +#endif //#USE_SUBSIMPLEX_CONVEX_CAST + + if (convexCaster.calcTimeOfImpact(rayFromTrans,rayToTrans,colObjWorldTransform,colObjWorldTransform,castResult)) + { + //add hit + if (castResult.m_normal.length2() > btScalar(0.0001)) + { + + if (castResult.m_fraction < resultCallback.m_closestHitFraction) + { +#ifdef USE_SUBSIMPLEX_CONVEX_CAST + //rotate normal into worldspace + castResult.m_normal = rayFromTrans.getBasis() * castResult.m_normal; +#endif //USE_SUBSIMPLEX_CONVEX_CAST + + castResult.m_normal.normalize(); + btCollisionWorld::LocalRayResult localRayResult + ( + collisionObject, + 0, + castResult.m_normal, + castResult.m_fraction + ); + + bool normalInWorldSpace = true; + resultCallback.AddSingleResult(localRayResult, normalInWorldSpace); + + } + } + } + } + else + { + + if (collisionShape->isConcave()) + { + + btTriangleMeshShape* triangleMesh = (btTriangleMeshShape*)collisionShape; + + btTransform worldTocollisionObject = colObjWorldTransform.inverse(); + + btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.getOrigin(); + btVector3 rayToLocal = worldTocollisionObject * rayToTrans.getOrigin(); + + //ConvexCast::CastResult + + struct BridgeTriangleRaycastCallback : public btTriangleRaycastCallback + { + btCollisionWorld::RayResultCallback* m_resultCallback; + btCollisionObject* m_collisionObject; + btTriangleMeshShape* m_triangleMesh; + + BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to, + btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape* triangleMesh): + btTriangleRaycastCallback(from,to), + m_resultCallback(resultCallback), + m_collisionObject(collisionObject), + m_triangleMesh(triangleMesh) + { + } + + + virtual btScalar reportHit(const btVector3& hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex ) + { + btCollisionWorld::LocalShapeInfo shapeInfo; + shapeInfo.m_shapePart = partId; + shapeInfo.m_triangleIndex = triangleIndex; + + btCollisionWorld::LocalRayResult rayResult + (m_collisionObject, + &shapeInfo, + hitNormalLocal, + hitFraction); + + bool normalInWorldSpace = false; + return m_resultCallback->AddSingleResult(rayResult,normalInWorldSpace); + + + } + + }; + + + BridgeTriangleRaycastCallback rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,triangleMesh); + rcb.m_hitFraction = resultCallback.m_closestHitFraction; + + btVector3 rayAabbMinLocal = rayFromLocal; + rayAabbMinLocal.setMin(rayToLocal); + btVector3 rayAabbMaxLocal = rayFromLocal; + rayAabbMaxLocal.setMax(rayToLocal); + + triangleMesh->processAllTriangles(&rcb,rayAabbMinLocal,rayAabbMaxLocal); + + } else + { + //todo: use AABB tree or other BVH acceleration structure! + if (collisionShape->isCompound()) + { + const btCompoundShape* compoundShape = static_cast(collisionShape); + int i=0; + for (i=0;igetNumChildShapes();i++) + { + btTransform childTrans = compoundShape->getChildTransform(i); + const btCollisionShape* childCollisionShape = compoundShape->getChildShape(i); + btTransform childWorldTrans = colObjWorldTransform * childTrans; + objectQuerySingle(castShape, rayFromTrans,rayToTrans, + collisionObject, + childCollisionShape, + childWorldTrans, + resultCallback, collisionFilterMask); + + } + + + } + } + } +} + +void btCollisionWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback,short int collisionFilterMask) +{ + + + btTransform rayFromTrans,rayToTrans; + rayFromTrans.setIdentity(); + rayFromTrans.setOrigin(rayFromWorld); + rayToTrans.setIdentity(); + + rayToTrans.setOrigin(rayToWorld); + + /// go over all objects, and if the ray intersects their aabb, do a ray-shape query using convexCaster (CCD) + + int i; + for (i=0;igetBroadphaseHandle()->m_collisionFilterGroup & collisionFilterMask) { + //RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject(); + btVector3 collisionObjectAabbMin,collisionObjectAabbMax; + collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax); + + btScalar hitLambda = btScalar(1.); //could use resultCallback.m_closestHitFraction, but needs testing + btVector3 hitNormal; + if (btRayAabb(rayFromWorld,rayToWorld,collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,hitNormal)) + { + rayTestSingle(rayFromTrans,rayToTrans, + collisionObject, + collisionObject->getCollisionShape(), + collisionObject->getWorldTransform(), + resultCallback); + } + } + } + +} diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h new file mode 100644 index 000000000..bda03cced --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h @@ -0,0 +1,259 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +/** + * @mainpage Bullet Documentation + * + * @section intro_sec Introduction + * Bullet Collision Detection & Physics SDK + * + * Bullet is a Collision Detection and Rigid Body Dynamics Library. The Library is Open Source and free for commercial use, under the ZLib license ( http://opensource.org/licenses/zlib-license.php ). + * + * There is the Physics Forum for Feedback and bteral Collision Detection and Physics discussions. + * Please visit http://www.continuousphysics.com/Bullet/phpBB2/index.php + * + * @section install_sec Installation + * + * @subsection step1 Step 1: Download + * You can download the Bullet Physics Library from our website: http://www.continuousphysics.com/Bullet/ + * @subsection step2 Step 2: Building + * Bullet comes with autogenerated Project Files for Microsoft Visual Studio 6, 7, 7.1 and 8. + * The main Workspace/Solution is located in Bullet/msvc/8/wksbullet.sln (replace 8 with your version). + * + * Under other platforms, like Linux or Mac OS-X, Bullet can be build using either using cmake, http://www.cmake.org, or jam, http://www.perforce.com/jam/jam.html . cmake can autogenerate Xcode, KDevelop, MSVC and other build systems. just run cmake . in the root of Bullet. + * Jam is a build system that can build the library, demos and also autogenerate the MSVC Project Files. + * So if you are not using MSVC, you can run configure and jam . + * If you don't have jam installed, you can make jam from the included jam-2.5 sources, or download jam from ftp://ftp.perforce.com/pub/jam/ + * + * @subsection step3 Step 3: Testing demos + * Try to run and experiment with CcdPhysicsDemo executable as a starting point. + * Bullet can be used in several ways, as Full Rigid Body simulation, as Collision Detector Library or Low Level / Snippets like the GJK Closest Point calculation. + * The Dependencies can be seen in this documentation under Directories + * + * @subsection step4 Step 4: Integrating in your application, Full Rigid Body Simulation + * Check out CcdPhysicsDemo how to create a btDynamicsWorld, btRigidBody and btCollisionShape, Stepping the simulation and synchronizing your graphics object transform. + * PLEASE NOTE THE CcdPhysicsEnvironment and CcdPhysicsController is obsolete and will be removed. It has been replaced by classes derived frmo btDynamicsWorld and btRididBody + * @subsection step5 Step 5 : Integrate the Collision Detection Library (without Dynamics and other Extras) + * Bullet Collision Detection can also be used without the Dynamics/Extras. + * Check out btCollisionWorld and btCollisionObject, and the CollisionInterfaceDemo. Also in Extras/test_BulletOde.cpp there is a sample Collision Detection integration with Open Dynamics Engine, ODE, http://www.ode.org + * @subsection step6 Step 6 : Use Snippets like the GJK Closest Point calculation. + * Bullet has been designed in a modular way keeping dependencies to a minimum. The ConvexHullDistance demo demonstrates direct use of btGjkPairDetector. + * + * @section copyright Copyright + * Copyright (C) 2005-2007 Erwin Coumans, some contributions Copyright Gino van den Bergen, Christer Ericson, Simon Hobbs, Ricardo Padrela, F Richter(res), Stephane Redon + * Special thanks to all visitors of the Bullet Physics forum, and in particular above contributors, Dave Eberle, Dirk Gregorius, Erin Catto, Dave Eberle, Adam Moravanszky, + * Pierre Terdiman, Kenny Erleben, Russell Smith, Oliver Strunk, Jan Paul van Waveren, Marten Svanfeldt. + * + */ + + + +#ifndef COLLISION_WORLD_H +#define COLLISION_WORLD_H + +class btStackAlloc; +class btCollisionShape; +class btConvexShape; +class btBroadphaseInterface; +#include "LinearMath/btVector3.h" +#include "LinearMath/btTransform.h" +#include "btCollisionObject.h" +#include "btCollisionDispatcher.h" //for definition of btCollisionObjectArray +#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h" +#include "LinearMath/btAlignedObjectArray.h" + +///CollisionWorld is interface and container for the collision detection +class btCollisionWorld +{ + + +protected: + + btAlignedObjectArray m_collisionObjects; + + btDispatcher* m_dispatcher1; + + btDispatcherInfo m_dispatchInfo; + + btStackAlloc* m_stackAlloc; + + btBroadphaseInterface* m_broadphasePairCache; + +public: + + //this constructor doesn't own the dispatcher and paircache/broadphase + btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphasePairCache, btCollisionConfiguration* collisionConfiguration); + + virtual ~btCollisionWorld(); + + + btBroadphaseInterface* getBroadphase() + { + return m_broadphasePairCache; + } + + btOverlappingPairCache* getPairCache() + { + return m_broadphasePairCache->getOverlappingPairCache(); + } + + + btDispatcher* getDispatcher() + { + return m_dispatcher1; + } + + ///LocalShapeInfo gives extra information for complex shapes + ///Currently, only btTriangleMeshShape is available, so it just contains triangleIndex and subpart + struct LocalShapeInfo + { + int m_shapePart; + int m_triangleIndex; + + //const btCollisionShape* m_shapeTemp; + //const btTransform* m_shapeLocalTransform; + }; + + struct LocalRayResult + { + LocalRayResult(btCollisionObject* collisionObject, + LocalShapeInfo* localShapeInfo, + const btVector3& hitNormalLocal, + btScalar hitFraction) + :m_collisionObject(collisionObject), + m_localShapeInfo(localShapeInfo), + m_hitNormalLocal(hitNormalLocal), + m_hitFraction(hitFraction) + { + } + + btCollisionObject* m_collisionObject; + LocalShapeInfo* m_localShapeInfo; + btVector3 m_hitNormalLocal; + btScalar m_hitFraction; + + }; + + ///RayResultCallback is used to report new raycast results + struct RayResultCallback + { + virtual ~RayResultCallback() + { + } + btScalar m_closestHitFraction; + bool HasHit() + { + return (m_closestHitFraction < btScalar(1.)); + } + + RayResultCallback() + :m_closestHitFraction(btScalar(1.)) + { + } + virtual btScalar AddSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace) = 0; + }; + + struct ClosestRayResultCallback : public RayResultCallback + { + ClosestRayResultCallback(const btVector3& rayFromWorld,const btVector3& rayToWorld) + :m_rayFromWorld(rayFromWorld), + m_rayToWorld(rayToWorld), + m_collisionObject(0) + { + } + + btVector3 m_rayFromWorld;//used to calculate hitPointWorld from hitFraction + btVector3 m_rayToWorld; + + btVector3 m_hitNormalWorld; + btVector3 m_hitPointWorld; + btCollisionObject* m_collisionObject; + + virtual btScalar AddSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace) + { + +//caller already does the filter on the m_closestHitFraction + assert(rayResult.m_hitFraction <= m_closestHitFraction); + + m_closestHitFraction = rayResult.m_hitFraction; + m_collisionObject = rayResult.m_collisionObject; + if (normalInWorldSpace) + { + m_hitNormalWorld = rayResult.m_hitNormalLocal; + } else + { + ///need to transform normal into worldspace + m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal; + } + m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction); + return rayResult.m_hitFraction; + } + }; + + + + + int getNumCollisionObjects() const + { + return int(m_collisionObjects.size()); + } + + /// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback + /// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback. + void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback, short int collisionFilterMask=-1); + + /// rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest. + /// In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape. + /// This allows more customization. + static void rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans, + btCollisionObject* collisionObject, + const btCollisionShape* collisionShape, + const btTransform& colObjWorldTransform, + RayResultCallback& resultCallback, short int collisionFilterMask=-1); + + /// objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest. + static void objectQuerySingle(const btConvexShape* castShape, const btTransform& rayFromTrans,const btTransform& rayToTrans, + btCollisionObject* collisionObject, + const btCollisionShape* collisionShape, + const btTransform& colObjWorldTransform, + RayResultCallback& resultCallback, short int collisionFilterMask=-1); + + void addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=1,short int collisionFilterMask=1); + + btCollisionObjectArray& getCollisionObjectArray() + { + return m_collisionObjects; + } + + const btCollisionObjectArray& getCollisionObjectArray() const + { + return m_collisionObjects; + } + + + void removeCollisionObject(btCollisionObject* collisionObject); + + virtual void performDiscreteCollisionDetection(); + + btDispatcherInfo& getDispatchInfo() + { + return m_dispatchInfo; + } + +}; + + +#endif //COLLISION_WORLD_H diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp new file mode 100644 index 000000000..7c0c7a3b0 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp @@ -0,0 +1,142 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" +#include "BulletCollision/CollisionShapes/btCompoundShape.h" + + +btCompoundCollisionAlgorithm::btCompoundCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped) +:btCollisionAlgorithm(ci), +m_isSwapped(isSwapped) +{ + btCollisionObject* colObj = m_isSwapped? body1 : body0; + btCollisionObject* otherObj = m_isSwapped? body0 : body1; + assert (colObj->getCollisionShape()->isCompound()); + + btCompoundShape* compoundShape = static_cast(colObj->getCollisionShape()); + int numChildren = compoundShape->getNumChildShapes(); + int i; + + m_childCollisionAlgorithms.resize(numChildren); + for (i=0;igetChildShape(i); + btCollisionShape* orgShape = colObj->getCollisionShape(); + colObj->setCollisionShape( childShape ); + m_childCollisionAlgorithms[i] = ci.m_dispatcher1->findAlgorithm(colObj,otherObj); + colObj->setCollisionShape( orgShape ); + } +} + + +btCompoundCollisionAlgorithm::~btCompoundCollisionAlgorithm() +{ + int numChildren = m_childCollisionAlgorithms.size(); + int i; + for (i=0;i~btCollisionAlgorithm(); + m_dispatcher->freeCollisionAlgorithm(m_childCollisionAlgorithms[i]); + } +} + +void btCompoundCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + btCollisionObject* colObj = m_isSwapped? body1 : body0; + btCollisionObject* otherObj = m_isSwapped? body0 : body1; + + assert (colObj->getCollisionShape()->isCompound()); + btCompoundShape* compoundShape = static_cast(colObj->getCollisionShape()); + + //We will use the OptimizedBVH, AABB tree to cull potential child-overlaps + //If both proxies are Compound, we will deal with that directly, by performing sequential/parallel tree traversals + //given Proxy0 and Proxy1, if both have a tree, Tree0 and Tree1, this means: + //determine overlapping nodes of Proxy1 using Proxy0 AABB against Tree1 + //then use each overlapping node AABB against Tree0 + //and vise versa. + + int numChildren = m_childCollisionAlgorithms.size(); + int i; + for (i=0;igetChildShape(i); + + //backup + btTransform orgTrans = colObj->getWorldTransform(); + btCollisionShape* orgShape = colObj->getCollisionShape(); + + const btTransform& childTrans = compoundShape->getChildTransform(i); + //btTransform newChildWorldTrans = orgTrans*childTrans ; + colObj->setWorldTransform( orgTrans*childTrans ); + //the contactpoint is still projected back using the original inverted worldtrans + colObj->setCollisionShape( childShape ); + m_childCollisionAlgorithms[i]->processCollision(colObj,otherObj,dispatchInfo,resultOut); + //revert back + colObj->setCollisionShape( orgShape); + colObj->setWorldTransform( orgTrans ); + } +} + +btScalar btCompoundCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + + btCollisionObject* colObj = m_isSwapped? body1 : body0; + btCollisionObject* otherObj = m_isSwapped? body0 : body1; + + assert (colObj->getCollisionShape()->isCompound()); + + btCompoundShape* compoundShape = static_cast(colObj->getCollisionShape()); + + //We will use the OptimizedBVH, AABB tree to cull potential child-overlaps + //If both proxies are Compound, we will deal with that directly, by performing sequential/parallel tree traversals + //given Proxy0 and Proxy1, if both have a tree, Tree0 and Tree1, this means: + //determine overlapping nodes of Proxy1 using Proxy0 AABB against Tree1 + //then use each overlapping node AABB against Tree0 + //and vise versa. + + btScalar hitFraction = btScalar(1.); + + int numChildren = m_childCollisionAlgorithms.size(); + int i; + for (i=0;igetChildShape(i); + + //backup + btTransform orgTrans = colObj->getWorldTransform(); + btCollisionShape* orgShape = colObj->getCollisionShape(); + + const btTransform& childTrans = compoundShape->getChildTransform(i); + //btTransform newChildWorldTrans = orgTrans*childTrans ; + colObj->setWorldTransform( orgTrans*childTrans ); + + colObj->setCollisionShape( childShape ); + btScalar frac = m_childCollisionAlgorithms[i]->calculateTimeOfImpact(colObj,otherObj,dispatchInfo,resultOut); + if (fracsetCollisionShape( orgShape); + colObj->setWorldTransform( orgTrans); + } + return hitFraction; + +} + + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h b/src/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h new file mode 100644 index 000000000..a381d8b3c --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h @@ -0,0 +1,67 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COMPOUND_COLLISION_ALGORITHM_H +#define COMPOUND_COLLISION_ALGORITHM_H + +#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" +#include "BulletCollision/BroadphaseCollision/btDispatcher.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h" + +#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" +class btDispatcher; +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "btCollisionCreateFunc.h" +#include "LinearMath/btAlignedObjectArray.h" +class btDispatcher; + +/// btCompoundCollisionAlgorithm supports collision between CompoundCollisionShapes and other collision shapes +/// Place holder, not fully implemented yet +class btCompoundCollisionAlgorithm : public btCollisionAlgorithm +{ + btAlignedObjectArray m_childCollisionAlgorithms; + bool m_isSwapped; + +public: + + btCompoundCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped); + + virtual ~btCompoundCollisionAlgorithm(); + + virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + struct CreateFunc :public btCollisionAlgorithmCreateFunc + { + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + { + void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm)); + return new(mem) btCompoundCollisionAlgorithm(ci,body0,body1,false); + } + }; + + struct SwappedCreateFunc :public btCollisionAlgorithmCreateFunc + { + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + { + void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm)); + return new(mem) btCompoundCollisionAlgorithm(ci,body0,body1,true); + } + }; + +}; + +#endif //COMPOUND_COLLISION_ALGORITHM_H diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp new file mode 100644 index 000000000..559b633fe --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp @@ -0,0 +1,314 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btConvexConcaveCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" +#include "BulletCollision/CollisionShapes/btMultiSphereShape.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "BulletCollision/CollisionShapes/btConcaveShape.h" +#include "BulletCollision/CollisionDispatch/btManifoldResult.h" +#include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h" +#include "BulletCollision/CollisionShapes/btTriangleShape.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" +#include "LinearMath/btIDebugDraw.h" +#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h" + +btConvexConcaveCollisionAlgorithm::btConvexConcaveCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1,bool isSwapped) +: btCollisionAlgorithm(ci), +m_isSwapped(isSwapped), +m_btConvexTriangleCallback(ci.m_dispatcher1,body0,body1,isSwapped) +{ +} + +btConvexConcaveCollisionAlgorithm::~btConvexConcaveCollisionAlgorithm() +{ +} + + + +btConvexTriangleCallback::btConvexTriangleCallback(btDispatcher* dispatcher,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped): + m_dispatcher(dispatcher), + m_dispatchInfoPtr(0) +{ + m_convexBody = isSwapped? body1:body0; + m_triBody = isSwapped? body0:body1; + + // + // create the manifold from the dispatcher 'manifold pool' + // + m_manifoldPtr = m_dispatcher->getNewManifold(m_convexBody,m_triBody); + + clearCache(); +} + +btConvexTriangleCallback::~btConvexTriangleCallback() +{ + clearCache(); + m_dispatcher->releaseManifold( m_manifoldPtr ); + +} + + +void btConvexTriangleCallback::clearCache() +{ + m_dispatcher->clearManifold(m_manifoldPtr); +}; + + + +void btConvexTriangleCallback::processTriangle(btVector3* triangle,int partId, int triangleIndex) +{ + + //just for debugging purposes + //printf("triangle %d",m_triangleCount++); + + + //aabb filter is already applied! + + btCollisionAlgorithmConstructionInfo ci; + ci.m_dispatcher1 = m_dispatcher; + + btCollisionObject* ob = static_cast(m_triBody); + + + + ///debug drawing of the overlapping triangles + if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && m_dispatchInfoPtr->m_debugDraw->getDebugMode() > 0) + { + btVector3 color(255,255,0); + btTransform& tr = ob->getWorldTransform(); + m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[0]),tr(triangle[1]),color); + m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[1]),tr(triangle[2]),color); + m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[2]),tr(triangle[0]),color); + + //btVector3 center = triangle[0] + triangle[1]+triangle[2]; + //center *= btScalar(0.333333); + //m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[0]),tr(center),color); + //m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[1]),tr(center),color); + //m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[2]),tr(center),color); + + } + + + //btCollisionObject* colObj = static_cast(m_convexProxy->m_clientObject); + + if (m_convexBody->getCollisionShape()->isConvex()) + { + btTriangleShape tm(triangle[0],triangle[1],triangle[2]); + tm.setMargin(m_collisionMarginTriangle); + + + btCollisionShape* tmpShape = ob->getCollisionShape(); + ob->setCollisionShape( &tm ); + + + btCollisionAlgorithm* colAlgo = ci.m_dispatcher1->findAlgorithm(m_convexBody,m_triBody,m_manifoldPtr); + ///this should use the btDispatcher, so the actual registered algorithm is used + // btConvexConvexAlgorithm cvxcvxalgo(m_manifoldPtr,ci,m_convexBody,m_triBody); + + m_resultOut->setShapeIdentifiers(-1,-1,partId,triangleIndex); + // cvxcvxalgo.setShapeIdentifiers(-1,-1,partId,triangleIndex); +// cvxcvxalgo.processCollision(m_convexBody,m_triBody,*m_dispatchInfoPtr,m_resultOut); + colAlgo->processCollision(m_convexBody,m_triBody,*m_dispatchInfoPtr,m_resultOut); + colAlgo->~btCollisionAlgorithm(); + ci.m_dispatcher1->freeCollisionAlgorithm(colAlgo); + ob->setCollisionShape( tmpShape ); + + } + + + +} + + + +void btConvexTriangleCallback::setTimeStepAndCounters(btScalar collisionMarginTriangle,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + m_dispatchInfoPtr = &dispatchInfo; + m_collisionMarginTriangle = collisionMarginTriangle; + m_resultOut = resultOut; + + //recalc aabbs + btTransform convexInTriangleSpace; + convexInTriangleSpace = m_triBody->getWorldTransform().inverse() * m_convexBody->getWorldTransform(); + btCollisionShape* convexShape = static_cast(m_convexBody->getCollisionShape()); + //CollisionShape* triangleShape = static_cast(triBody->m_collisionShape); + convexShape->getAabb(convexInTriangleSpace,m_aabbMin,m_aabbMax); + btScalar extraMargin = collisionMarginTriangle; + btVector3 extra(extraMargin,extraMargin,extraMargin); + + m_aabbMax += extra; + m_aabbMin -= extra; + +} + +void btConvexConcaveCollisionAlgorithm::clearCache() +{ + m_btConvexTriangleCallback.clearCache(); + +} + +void btConvexConcaveCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + + + btCollisionObject* convexBody = m_isSwapped ? body1 : body0; + btCollisionObject* triBody = m_isSwapped ? body0 : body1; + + if (triBody->getCollisionShape()->isConcave()) + { + + + btCollisionObject* triOb = triBody; + btConcaveShape* concaveShape = static_cast( triOb->getCollisionShape()); + + if (convexBody->getCollisionShape()->isConvex()) + { + btScalar collisionMarginTriangle = concaveShape->getMargin(); + + resultOut->setPersistentManifold(m_btConvexTriangleCallback.m_manifoldPtr); + m_btConvexTriangleCallback.setTimeStepAndCounters(collisionMarginTriangle,dispatchInfo,resultOut); + + //Disable persistency. previously, some older algorithm calculated all contacts in one go, so you can clear it here. + //m_dispatcher->clearManifold(m_btConvexTriangleCallback.m_manifoldPtr); + + m_btConvexTriangleCallback.m_manifoldPtr->setBodies(convexBody,triBody); + + concaveShape->processAllTriangles( &m_btConvexTriangleCallback,m_btConvexTriangleCallback.getAabbMin(),m_btConvexTriangleCallback.getAabbMax()); + + resultOut->refreshContactPoints(); + + } + + } + +} + + +btScalar btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + (void)resultOut; + (void)dispatchInfo; + btCollisionObject* convexbody = m_isSwapped ? body1 : body0; + btCollisionObject* triBody = m_isSwapped ? body0 : body1; + + + //quick approximation using raycast, todo: hook up to the continuous collision detection (one of the btConvexCast) + + //only perform CCD above a certain threshold, this prevents blocking on the long run + //because object in a blocked ccd state (hitfraction<1) get their linear velocity halved each frame... + btScalar squareMot0 = (convexbody->getInterpolationWorldTransform().getOrigin() - convexbody->getWorldTransform().getOrigin()).length2(); + if (squareMot0 < convexbody->getCcdSquareMotionThreshold()) + { + return btScalar(1.); + } + + //const btVector3& from = convexbody->m_worldTransform.getOrigin(); + //btVector3 to = convexbody->m_interpolationWorldTransform.getOrigin(); + //todo: only do if the motion exceeds the 'radius' + + btTransform triInv = triBody->getWorldTransform().inverse(); + btTransform convexFromLocal = triInv * convexbody->getWorldTransform(); + btTransform convexToLocal = triInv * convexbody->getInterpolationWorldTransform(); + + struct LocalTriangleSphereCastCallback : public btTriangleCallback + { + btTransform m_ccdSphereFromTrans; + btTransform m_ccdSphereToTrans; + btTransform m_meshTransform; + + btScalar m_ccdSphereRadius; + btScalar m_hitFraction; + + + LocalTriangleSphereCastCallback(const btTransform& from,const btTransform& to,btScalar ccdSphereRadius,btScalar hitFraction) + :m_ccdSphereFromTrans(from), + m_ccdSphereToTrans(to), + m_ccdSphereRadius(ccdSphereRadius), + m_hitFraction(hitFraction) + { + } + + + virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) + { + (void)partId; + (void)triangleIndex; + //do a swept sphere for now + btTransform ident; + ident.setIdentity(); + btConvexCast::CastResult castResult; + castResult.m_fraction = m_hitFraction; + btSphereShape pointShape(m_ccdSphereRadius); + btTriangleShape triShape(triangle[0],triangle[1],triangle[2]); + btVoronoiSimplexSolver simplexSolver; + btSubsimplexConvexCast convexCaster(&pointShape,&triShape,&simplexSolver); + //GjkConvexCast convexCaster(&pointShape,convexShape,&simplexSolver); + //ContinuousConvexCollision convexCaster(&pointShape,convexShape,&simplexSolver,0); + //local space? + + if (convexCaster.calcTimeOfImpact(m_ccdSphereFromTrans,m_ccdSphereToTrans, + ident,ident,castResult)) + { + if (m_hitFraction > castResult.m_fraction) + m_hitFraction = castResult.m_fraction; + } + + } + + }; + + + + + + if (triBody->getCollisionShape()->isConcave()) + { + btVector3 rayAabbMin = convexFromLocal.getOrigin(); + rayAabbMin.setMin(convexToLocal.getOrigin()); + btVector3 rayAabbMax = convexFromLocal.getOrigin(); + rayAabbMax.setMax(convexToLocal.getOrigin()); + btScalar ccdRadius0 = convexbody->getCcdSweptSphereRadius(); + rayAabbMin -= btVector3(ccdRadius0,ccdRadius0,ccdRadius0); + rayAabbMax += btVector3(ccdRadius0,ccdRadius0,ccdRadius0); + + btScalar curHitFraction = btScalar(1.); //is this available? + LocalTriangleSphereCastCallback raycastCallback(convexFromLocal,convexToLocal, + convexbody->getCcdSweptSphereRadius(),curHitFraction); + + raycastCallback.m_hitFraction = convexbody->getHitFraction(); + + btCollisionObject* concavebody = triBody; + + btConcaveShape* triangleMesh = (btConcaveShape*) concavebody->getCollisionShape(); + + if (triangleMesh) + { + triangleMesh->processAllTriangles(&raycastCallback,rayAabbMin,rayAabbMax); + } + + + + if (raycastCallback.m_hitFraction < convexbody->getHitFraction()) + { + convexbody->setHitFraction( raycastCallback.m_hitFraction); + return raycastCallback.m_hitFraction; + } + } + + return btScalar(1.); + +} diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h b/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h new file mode 100644 index 000000000..da33e9889 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h @@ -0,0 +1,113 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONVEX_CONCAVE_COLLISION_ALGORITHM_H +#define CONVEX_CONCAVE_COLLISION_ALGORITHM_H + +#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" +#include "BulletCollision/BroadphaseCollision/btDispatcher.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h" +#include "BulletCollision/CollisionShapes/btTriangleCallback.h" +#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" +class btDispatcher; +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "btCollisionCreateFunc.h" + +///For each triangle in the concave mesh that overlaps with the AABB of a convex (m_convexProxy), processTriangle is called. +class btConvexTriangleCallback : public btTriangleCallback +{ + btCollisionObject* m_convexBody; + btCollisionObject* m_triBody; + + btVector3 m_aabbMin; + btVector3 m_aabbMax ; + + btManifoldResult* m_resultOut; + + btDispatcher* m_dispatcher; + const btDispatcherInfo* m_dispatchInfoPtr; + btScalar m_collisionMarginTriangle; + +public: +int m_triangleCount; + + btPersistentManifold* m_manifoldPtr; + + btConvexTriangleCallback(btDispatcher* dispatcher,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped); + + void setTimeStepAndCounters(btScalar collisionMarginTriangle,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + virtual ~btConvexTriangleCallback(); + + virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex); + + void clearCache(); + + SIMD_FORCE_INLINE const btVector3& getAabbMin() const + { + return m_aabbMin; + } + SIMD_FORCE_INLINE const btVector3& getAabbMax() const + { + return m_aabbMax; + } + +}; + + + + +/// btConvexConcaveCollisionAlgorithm supports collision between convex shapes and (concave) trianges meshes. +class btConvexConcaveCollisionAlgorithm : public btCollisionAlgorithm +{ + + bool m_isSwapped; + + btConvexTriangleCallback m_btConvexTriangleCallback; + + +public: + + btConvexConcaveCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped); + + virtual ~btConvexConcaveCollisionAlgorithm(); + + virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + void clearCache(); + + struct CreateFunc :public btCollisionAlgorithmCreateFunc + { + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + { + void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConcaveCollisionAlgorithm)); + return new(mem) btConvexConcaveCollisionAlgorithm(ci,body0,body1,false); + } + }; + + struct SwappedCreateFunc :public btCollisionAlgorithmCreateFunc + { + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + { + void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConcaveCollisionAlgorithm)); + return new(mem) btConvexConcaveCollisionAlgorithm(ci,body0,body1,true); + } + }; + +}; + +#endif //CONVEX_CONCAVE_COLLISION_ALGORITHM_H diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp new file mode 100644 index 000000000..d1692cdac --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -0,0 +1,249 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btConvexConvexAlgorithm.h" + +#include +#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" +#include "BulletCollision/CollisionShapes/btConvexShape.h" +#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" +#include "BulletCollision/CollisionShapes/btBoxShape.h" +#include "BulletCollision/CollisionDispatch/btManifoldResult.h" + +#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h" +#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h" +#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h" +#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h" + + + +#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h" +#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" + +#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h" + +#include "BulletCollision/NarrowPhaseCollision/btGjkEpa.h" +#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h" + + + + + + + + + +btConvexConvexAlgorithm::CreateFunc::CreateFunc(btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver) +{ + m_simplexSolver = simplexSolver; + m_pdSolver = pdSolver; +} + +btConvexConvexAlgorithm::CreateFunc::~CreateFunc() +{ +} + +btConvexConvexAlgorithm::btConvexConvexAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver) +: btCollisionAlgorithm(ci), +m_gjkPairDetector(0,0,simplexSolver,pdSolver), +m_ownManifold (false), +m_manifoldPtr(mf), +m_lowLevelOfDetail(false) +{ + (void)body0; + (void)body1; + + +} + + + + +btConvexConvexAlgorithm::~btConvexConvexAlgorithm() +{ + if (m_ownManifold) + { + if (m_manifoldPtr) + m_dispatcher->releaseManifold(m_manifoldPtr); + } +} + +void btConvexConvexAlgorithm ::setLowLevelOfDetail(bool useLowLevel) +{ + m_lowLevelOfDetail = useLowLevel; +} + + + + + +// +// Convex-Convex collision algorithm +// +void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + + if (!m_manifoldPtr) + { + //swapped? + m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1); + m_ownManifold = true; + } + resultOut->setPersistentManifold(m_manifoldPtr); + +#ifdef USE_BT_GJKEPA + btConvexShape* shape0(static_cast(body0->getCollisionShape())); + btConvexShape* shape1(static_cast(body1->getCollisionShape())); + const btScalar radialmargin(0/*shape0->getMargin()+shape1->getMargin()*/); + btGjkEpaSolver::sResults results; + if(btGjkEpaSolver::Collide( shape0,body0->getWorldTransform(), + shape1,body1->getWorldTransform(), + radialmargin,results)) + { + dispatchInfo.m_debugDraw->drawLine(results.witnesses[1],results.witnesses[1]+results.normal,btVector3(255,0,0)); + resultOut->addContactPoint(results.normal,results.witnesses[1],-results.depth); + } +#else + + btConvexShape* min0 = static_cast(body0->getCollisionShape()); + btConvexShape* min1 = static_cast(body1->getCollisionShape()); + + btGjkPairDetector::ClosestPointInput input; + + //TODO: if (dispatchInfo.m_useContinuous) + m_gjkPairDetector.setMinkowskiA(min0); + m_gjkPairDetector.setMinkowskiB(min1); + input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold(); + input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared; + input.m_stackAlloc = dispatchInfo.m_stackAllocator; + +// input.m_maximumDistanceSquared = btScalar(1e30); + + input.m_transformA = body0->getWorldTransform(); + input.m_transformB = body1->getWorldTransform(); + + m_gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw); +#endif + + if (m_ownManifold) + { + resultOut->refreshContactPoints(); + } + +} + + + +bool disableCcd = false; +btScalar btConvexConvexAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + (void)resultOut; + (void)dispatchInfo; + ///Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold + + ///Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold + ///col0->m_worldTransform, + btScalar resultFraction = btScalar(1.); + + + btScalar squareMot0 = (col0->getInterpolationWorldTransform().getOrigin() - col0->getWorldTransform().getOrigin()).length2(); + btScalar squareMot1 = (col1->getInterpolationWorldTransform().getOrigin() - col1->getWorldTransform().getOrigin()).length2(); + + if (squareMot0 < col0->getCcdSquareMotionThreshold() && + squareMot1 < col1->getCcdSquareMotionThreshold()) + return resultFraction; + + if (disableCcd) + return btScalar(1.); + + + //An adhoc way of testing the Continuous Collision Detection algorithms + //One object is approximated as a sphere, to simplify things + //Starting in penetration should report no time of impact + //For proper CCD, better accuracy and handling of 'allowed' penetration should be added + //also the mainloop of the physics should have a kind of toi queue (something like Brian Mirtich's application of Timewarp for Rigidbodies) + + + /// Convex0 against sphere for Convex1 + { + btConvexShape* convex0 = static_cast(col0->getCollisionShape()); + + btSphereShape sphere1(col1->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation + btConvexCast::CastResult result; + btVoronoiSimplexSolver voronoiSimplex; + //SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex); + ///Simplification, one object is simplified as a sphere + btGjkConvexCast ccd1( convex0 ,&sphere1,&voronoiSimplex); + //ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0); + if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(), + col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result)) + { + + //store result.m_fraction in both bodies + + if (col0->getHitFraction()> result.m_fraction) + col0->setHitFraction( result.m_fraction ); + + if (col1->getHitFraction() > result.m_fraction) + col1->setHitFraction( result.m_fraction); + + if (resultFraction > result.m_fraction) + resultFraction = result.m_fraction; + + } + + + + + } + + /// Sphere (for convex0) against Convex1 + { + btConvexShape* convex1 = static_cast(col1->getCollisionShape()); + + btSphereShape sphere0(col0->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation + btConvexCast::CastResult result; + btVoronoiSimplexSolver voronoiSimplex; + //SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex); + ///Simplification, one object is simplified as a sphere + btGjkConvexCast ccd1(&sphere0,convex1,&voronoiSimplex); + //ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0); + if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(), + col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result)) + { + + //store result.m_fraction in both bodies + + if (col0->getHitFraction() > result.m_fraction) + col0->setHitFraction( result.m_fraction); + + if (col1->getHitFraction() > result.m_fraction) + col1->setHitFraction( result.m_fraction); + + if (resultFraction > result.m_fraction) + resultFraction = result.m_fraction; + + } + } + + return resultFraction; + +} + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h b/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h new file mode 100644 index 000000000..ca58bce25 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h @@ -0,0 +1,77 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONVEX_CONVEX_ALGORITHM_H +#define CONVEX_CONVEX_ALGORITHM_H + +#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" +#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h" +#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h" +#include "btCollisionCreateFunc.h" +#include "btCollisionDispatcher.h" + +class btConvexPenetrationDepthSolver; + +///ConvexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations. +class btConvexConvexAlgorithm : public btCollisionAlgorithm +{ + btGjkPairDetector m_gjkPairDetector; +public: + + bool m_ownManifold; + btPersistentManifold* m_manifoldPtr; + bool m_lowLevelOfDetail; + + +public: + + btConvexConvexAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver); + + virtual ~btConvexConvexAlgorithm(); + + virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + void setLowLevelOfDetail(bool useLowLevel); + + + const btPersistentManifold* getManifold() + { + return m_manifoldPtr; + } + + struct CreateFunc :public btCollisionAlgorithmCreateFunc + { + btConvexPenetrationDepthSolver* m_pdSolver; + btSimplexSolverInterface* m_simplexSolver; + + CreateFunc(btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver); + + virtual ~CreateFunc(); + + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + { + void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConvexAlgorithm)); + return new(mem) btConvexConvexAlgorithm(ci.m_manifold,ci,body0,body1,m_simplexSolver,m_pdSolver); + } + }; + + +}; + +#endif //CONVEX_CONVEX_ALGORITHM_H diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp new file mode 100644 index 000000000..661270b9b --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp @@ -0,0 +1,237 @@ + +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btDefaultCollisionConfiguration.h" + +#include "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h" +#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h" +#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h" + + + +#include "LinearMath/btStackAlloc.h" +#include "LinearMath/btPoolAllocator.h" + + + +#define DEFAULT_MAX_OVERLAPPING_PAIRS 65535 +#define DEFAULT_STACK_ALLOCATOR_SIZE (5*1024*1024) + + +btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(btStackAlloc* stackAlloc,btPoolAllocator* persistentManifoldPool,btPoolAllocator* collisionAlgorithmPool) +{ + + void* mem = btAlignedAlloc(sizeof(btVoronoiSimplexSolver),16); + m_simplexSolver = new (mem)btVoronoiSimplexSolver(); + mem = btAlignedAlloc(sizeof(btGjkEpaPenetrationDepthSolver),16); + m_pdSolver = new (mem)btGjkEpaPenetrationDepthSolver; + + //default CreationFunctions, filling the m_doubleDispatch table + mem = btAlignedAlloc(sizeof(btConvexConvexAlgorithm::CreateFunc),16); + m_convexConvexCreateFunc = new(mem) btConvexConvexAlgorithm::CreateFunc(m_simplexSolver,m_pdSolver); + mem = btAlignedAlloc(sizeof(btConvexConcaveCollisionAlgorithm::CreateFunc),16); + m_convexConcaveCreateFunc = new (mem)btConvexConcaveCollisionAlgorithm::CreateFunc; + mem = btAlignedAlloc(sizeof(btConvexConcaveCollisionAlgorithm::CreateFunc),16); + m_swappedConvexConcaveCreateFunc = new (mem)btConvexConcaveCollisionAlgorithm::SwappedCreateFunc; + mem = btAlignedAlloc(sizeof(btCompoundCollisionAlgorithm::CreateFunc),16); + m_compoundCreateFunc = new (mem)btCompoundCollisionAlgorithm::CreateFunc; + mem = btAlignedAlloc(sizeof(btCompoundCollisionAlgorithm::SwappedCreateFunc),16); + m_swappedCompoundCreateFunc = new (mem)btCompoundCollisionAlgorithm::SwappedCreateFunc; + mem = btAlignedAlloc(sizeof(btEmptyAlgorithm::CreateFunc),16); + m_emptyCreateFunc = new(mem) btEmptyAlgorithm::CreateFunc; + + mem = btAlignedAlloc(sizeof(btSphereSphereCollisionAlgorithm::CreateFunc),16); + m_sphereSphereCF = new(mem) btSphereSphereCollisionAlgorithm::CreateFunc; + mem = btAlignedAlloc(sizeof(btSphereBoxCollisionAlgorithm::CreateFunc),16); + m_sphereBoxCF = new(mem) btSphereBoxCollisionAlgorithm::CreateFunc; + mem = btAlignedAlloc(sizeof(btSphereBoxCollisionAlgorithm::CreateFunc),16); + m_boxSphereCF = new (mem)btSphereBoxCollisionAlgorithm::CreateFunc; + m_boxSphereCF->m_swapped = true; + mem = btAlignedAlloc(sizeof(btSphereTriangleCollisionAlgorithm::CreateFunc),16); + m_sphereTriangleCF = new (mem)btSphereTriangleCollisionAlgorithm::CreateFunc; + mem = btAlignedAlloc(sizeof(btSphereTriangleCollisionAlgorithm::CreateFunc),16); + m_triangleSphereCF = new (mem)btSphereTriangleCollisionAlgorithm::CreateFunc; + m_triangleSphereCF->m_swapped = true; + + + ///calculate maximum element size, big enough to fit any collision algorithm in the memory pool + int maxSize = sizeof(btConvexConvexAlgorithm); + int maxSize2 = sizeof(btConvexConcaveCollisionAlgorithm); + int maxSize3 = sizeof(btCompoundCollisionAlgorithm); + int maxSize4 = sizeof(btEmptyAlgorithm); + + int collisionAlgorithmMaxElementSize = btMax(maxSize,maxSize2); + collisionAlgorithmMaxElementSize = btMax(collisionAlgorithmMaxElementSize,maxSize3); + collisionAlgorithmMaxElementSize = btMax(collisionAlgorithmMaxElementSize,maxSize4); + + if (stackAlloc) + { + m_ownsStackAllocator = false; + this->m_stackAlloc = stackAlloc; + } else + { + m_ownsStackAllocator = true; + void* mem = btAlignedAlloc(sizeof(btStackAlloc),16); + m_stackAlloc = new(mem)btStackAlloc(DEFAULT_STACK_ALLOCATOR_SIZE); + } + + if (persistentManifoldPool) + { + m_ownsPersistentManifoldPool = false; + m_persistentManifoldPool = persistentManifoldPool; + } else + { + m_ownsPersistentManifoldPool = true; + void* mem = btAlignedAlloc(sizeof(btPoolAllocator),16); + m_persistentManifoldPool = new (mem) btPoolAllocator(sizeof(btPersistentManifold),DEFAULT_MAX_OVERLAPPING_PAIRS); + } + + if (collisionAlgorithmPool) + { + m_ownsCollisionAlgorithmPool = false; + m_collisionAlgorithmPool = collisionAlgorithmPool; + } else + { + m_ownsCollisionAlgorithmPool = true; + void* mem = btAlignedAlloc(sizeof(btPoolAllocator),16); + m_collisionAlgorithmPool = new(mem) btPoolAllocator(collisionAlgorithmMaxElementSize,DEFAULT_MAX_OVERLAPPING_PAIRS); + } + + +} + +btDefaultCollisionConfiguration::~btDefaultCollisionConfiguration() +{ + if (m_ownsStackAllocator) + { + m_stackAlloc->destroy(); + m_stackAlloc->~btStackAlloc(); + btAlignedFree(m_stackAlloc); + } + if (m_ownsCollisionAlgorithmPool) + { + m_collisionAlgorithmPool->~btPoolAllocator(); + btAlignedFree(m_collisionAlgorithmPool); + } + if (m_ownsPersistentManifoldPool) + { + m_persistentManifoldPool->~btPoolAllocator(); + btAlignedFree(m_persistentManifoldPool); + } + + m_convexConvexCreateFunc->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_convexConvexCreateFunc); + + m_convexConcaveCreateFunc->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_convexConcaveCreateFunc); + m_swappedConvexConcaveCreateFunc->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_swappedConvexConcaveCreateFunc); + + m_compoundCreateFunc->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_compoundCreateFunc); + + m_swappedCompoundCreateFunc->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_swappedCompoundCreateFunc); + + m_emptyCreateFunc->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_emptyCreateFunc); + + m_sphereSphereCF->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_sphereSphereCF); + + m_sphereBoxCF->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_sphereBoxCF); + m_boxSphereCF->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_boxSphereCF); + m_sphereTriangleCF->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_sphereTriangleCF); + m_triangleSphereCF->~btCollisionAlgorithmCreateFunc(); + btAlignedFree( m_triangleSphereCF); + + m_simplexSolver->~btVoronoiSimplexSolver(); + btAlignedFree(m_simplexSolver); + m_pdSolver->~btGjkEpaPenetrationDepthSolver(); + btAlignedFree(m_pdSolver); + + +} + + +btCollisionAlgorithmCreateFunc* btDefaultCollisionConfiguration::getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1) +{ + + + if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==SPHERE_SHAPE_PROXYTYPE)) + { + return m_sphereSphereCF; + } + + if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==BOX_SHAPE_PROXYTYPE)) + { + return m_sphereBoxCF; + } + + if ((proxyType0 == BOX_SHAPE_PROXYTYPE ) && (proxyType1==SPHERE_SHAPE_PROXYTYPE)) + { + return m_boxSphereCF; + } + + if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE ) && (proxyType1==TRIANGLE_SHAPE_PROXYTYPE)) + { + return m_sphereTriangleCF; + } + + if ((proxyType0 == TRIANGLE_SHAPE_PROXYTYPE ) && (proxyType1==SPHERE_SHAPE_PROXYTYPE)) + { + return m_triangleSphereCF; + } + + + if (btBroadphaseProxy::isConvex(proxyType0) && btBroadphaseProxy::isConvex(proxyType1)) + { + return m_convexConvexCreateFunc; + } + + if (btBroadphaseProxy::isConvex(proxyType0) && btBroadphaseProxy::isConcave(proxyType1)) + { + return m_convexConcaveCreateFunc; + } + + if (btBroadphaseProxy::isConvex(proxyType1) && btBroadphaseProxy::isConcave(proxyType0)) + { + return m_swappedConvexConcaveCreateFunc; + } + + if (btBroadphaseProxy::isCompound(proxyType0)) + { + return m_compoundCreateFunc; + } else + { + if (btBroadphaseProxy::isCompound(proxyType1)) + { + return m_swappedCompoundCreateFunc; + } + } + + //failed to find an algorithm + return m_emptyCreateFunc; +} diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h b/src/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h new file mode 100644 index 000000000..2e99f1db1 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h @@ -0,0 +1,87 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_DEFAULT_COLLISION_CONFIGURATION +#define BT_DEFAULT_COLLISION_CONFIGURATION + +#include "btCollisionConfiguration.h" +class btVoronoiSimplexSolver; +class btGjkEpaPenetrationDepthSolver; + + +///btCollisionConfiguration allows to configure Bullet collision detection +///stack allocator, pool memory allocators +///todo: describe the meaning +class btDefaultCollisionConfiguration : public btCollisionConfiguration +{ + + int m_persistentManifoldPoolSize; + + btStackAlloc* m_stackAlloc; + bool m_ownsStackAllocator; + + btPoolAllocator* m_persistentManifoldPool; + bool m_ownsPersistentManifoldPool; + + btPoolAllocator* m_collisionAlgorithmPool; + bool m_ownsCollisionAlgorithmPool; + + //default simplex/penetration depth solvers + btVoronoiSimplexSolver* m_simplexSolver; + btGjkEpaPenetrationDepthSolver* m_pdSolver; + + //default CreationFunctions, filling the m_doubleDispatch table + btCollisionAlgorithmCreateFunc* m_convexConvexCreateFunc; + btCollisionAlgorithmCreateFunc* m_convexConcaveCreateFunc; + btCollisionAlgorithmCreateFunc* m_swappedConvexConcaveCreateFunc; + btCollisionAlgorithmCreateFunc* m_compoundCreateFunc; + btCollisionAlgorithmCreateFunc* m_swappedCompoundCreateFunc; + btCollisionAlgorithmCreateFunc* m_emptyCreateFunc; + btCollisionAlgorithmCreateFunc* m_sphereSphereCF; + btCollisionAlgorithmCreateFunc* m_sphereBoxCF; + btCollisionAlgorithmCreateFunc* m_boxSphereCF; + btCollisionAlgorithmCreateFunc* m_sphereTriangleCF; + btCollisionAlgorithmCreateFunc* m_triangleSphereCF; + +public: + + btDefaultCollisionConfiguration(btStackAlloc* stackAlloc=0,btPoolAllocator* persistentManifoldPool=0,btPoolAllocator* collisionAlgorithmPool=0); + + virtual ~btDefaultCollisionConfiguration(); + + ///memory pools + virtual btPoolAllocator* getPersistentManifoldPool() + { + return m_persistentManifoldPool; + } + + virtual btPoolAllocator* getCollisionAlgorithmPool() + { + return m_collisionAlgorithmPool; + } + + virtual btStackAlloc* getStackAllocator() + { + return m_stackAlloc; + } + + + btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1); + + +}; + +#endif //BT_DEFAULT_COLLISION_CONFIGURATION + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp new file mode 100644 index 000000000..936054387 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp @@ -0,0 +1,34 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btEmptyCollisionAlgorithm.h" + + + +btEmptyAlgorithm::btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& ci) + : btCollisionAlgorithm(ci) +{ +} + +void btEmptyAlgorithm::processCollision (btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* ) +{ +} + +btScalar btEmptyAlgorithm::calculateTimeOfImpact(btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* ) +{ + return btScalar(1.); +} + + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h b/src/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h new file mode 100644 index 000000000..89e708078 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h @@ -0,0 +1,50 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef EMPTY_ALGORITH +#define EMPTY_ALGORITH +#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" +#include "btCollisionCreateFunc.h" +#include "btCollisionDispatcher.h" + +#define ATTRIBUTE_ALIGNED(a) + +///EmptyAlgorithm is a stub for unsupported collision pairs. +///The dispatcher can dispatch a persistent btEmptyAlgorithm to avoid a search every frame. +class btEmptyAlgorithm : public btCollisionAlgorithm +{ + +public: + + btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& ci); + + virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + struct CreateFunc :public btCollisionAlgorithmCreateFunc + { + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + { + (void)body0; + (void)body1; + void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btEmptyAlgorithm)); + return new(mem) btEmptyAlgorithm(ci); + } + }; + +} ATTRIBUTE_ALIGNED(16); + +#endif //EMPTY_ALGORITH diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp new file mode 100644 index 000000000..61c4c231d --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp @@ -0,0 +1,114 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btManifoldResult.h" +#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" + + +///This is to allow MaterialCombiner/Custom Friction/Restitution values +ContactAddedCallback gContactAddedCallback=0; + +///User can override this material combiner by implementing gContactAddedCallback and setting body0->m_collisionFlags |= btCollisionObject::customMaterialCallback; +inline btScalar calculateCombinedFriction(const btCollisionObject* body0,const btCollisionObject* body1) +{ + btScalar friction = body0->getFriction() * body1->getFriction(); + + const btScalar MAX_FRICTION = btScalar(10.); + if (friction < -MAX_FRICTION) + friction = -MAX_FRICTION; + if (friction > MAX_FRICTION) + friction = MAX_FRICTION; + return friction; + +} + +inline btScalar calculateCombinedRestitution(const btCollisionObject* body0,const btCollisionObject* body1) +{ + return body0->getRestitution() * body1->getRestitution(); +} + + + +btManifoldResult::btManifoldResult(btCollisionObject* body0,btCollisionObject* body1) + :m_manifoldPtr(0), + m_body0(body0), + m_body1(body1) +{ + m_rootTransA = body0->getWorldTransform(); + m_rootTransB = body1->getWorldTransform(); +} + + +void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth) +{ + assert(m_manifoldPtr); + //order in manifold needs to match + + if (depth > m_manifoldPtr->getContactBreakingThreshold()) + return; + + bool isSwapped = m_manifoldPtr->getBody0() != m_body0; + + btVector3 pointA = pointInWorld + normalOnBInWorld * depth; + + btVector3 localA; + btVector3 localB; + + if (isSwapped) + { + localA = m_rootTransB.invXform(pointA ); + localB = m_rootTransA.invXform(pointInWorld); + } else + { + localA = m_rootTransA.invXform(pointA ); + localB = m_rootTransB.invXform(pointInWorld); + } + + btManifoldPoint newPt(localA,localB,normalOnBInWorld,depth); + newPt.m_positionWorldOnA = pointA; + newPt.m_positionWorldOnB = pointInWorld; + + int insertIndex = m_manifoldPtr->getCacheEntry(newPt); + + newPt.m_combinedFriction = calculateCombinedFriction(m_body0,m_body1); + newPt.m_combinedRestitution = calculateCombinedRestitution(m_body0,m_body1); + + + ///todo, check this for any side effects + if (insertIndex >= 0) + { + //const btManifoldPoint& oldPoint = m_manifoldPtr->getContactPoint(insertIndex); + m_manifoldPtr->replaceContactPoint(newPt,insertIndex); + } else + { + m_manifoldPtr->AddManifoldPoint(newPt); + } + + //User can override friction and/or restitution + if (gContactAddedCallback && + //and if either of the two bodies requires custom material + ((m_body0->getCollisionFlags() & btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK) || + (m_body1->getCollisionFlags() & btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK))) + { + //experimental feature info, for per-triangle material etc. + btCollisionObject* obj0 = isSwapped? m_body1 : m_body0; + btCollisionObject* obj1 = isSwapped? m_body0 : m_body1; + (*gContactAddedCallback)(newPt,obj0,m_partId0,m_index0,obj1,m_partId1,m_index1); + } + +} + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.h b/src/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.h new file mode 100644 index 000000000..5aac9a46f --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.h @@ -0,0 +1,102 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef MANIFOLD_RESULT_H +#define MANIFOLD_RESULT_H + +class btCollisionObject; +#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" +class btManifoldPoint; + +#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h" + +#include "LinearMath/btTransform.h" + +typedef bool (*ContactAddedCallback)(btManifoldPoint& cp, const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1); +extern ContactAddedCallback gContactAddedCallback; + + + +///btManifoldResult is a helper class to manage contact results. +class btManifoldResult : public btDiscreteCollisionDetectorInterface::Result +{ + btPersistentManifold* m_manifoldPtr; + + //we need this for compounds + btTransform m_rootTransA; + btTransform m_rootTransB; + + btCollisionObject* m_body0; + btCollisionObject* m_body1; + int m_partId0; + int m_partId1; + int m_index0; + int m_index1; +public: + + btManifoldResult() + { + } + + btManifoldResult(btCollisionObject* body0,btCollisionObject* body1); + + virtual ~btManifoldResult() {}; + + void setPersistentManifold(btPersistentManifold* manifoldPtr) + { + m_manifoldPtr = manifoldPtr; + } + + const btPersistentManifold* getPersistentManifold() const + { + return m_manifoldPtr; + } + btPersistentManifold* getPersistentManifold() + { + return m_manifoldPtr; + } + + virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1) + { + m_partId0=partId0; + m_partId1=partId1; + m_index0=index0; + m_index1=index1; + } + + virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth); + + SIMD_FORCE_INLINE void refreshContactPoints() + { + btAssert(m_manifoldPtr); + if (!m_manifoldPtr->getNumContacts()) + return; + + bool isSwapped = m_manifoldPtr->getBody0() != m_body0; + + if (isSwapped) + { + m_manifoldPtr->refreshContactPoints(m_rootTransB,m_rootTransA); + } else + { + m_manifoldPtr->refreshContactPoints(m_rootTransA,m_rootTransB); + } + } + + +}; + +#endif //MANIFOLD_RESULT_H diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp new file mode 100644 index 000000000..0cc3ac599 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp @@ -0,0 +1,359 @@ + + +#include "LinearMath/btScalar.h" +#include "btSimulationIslandManager.h" +#include "BulletCollision/BroadphaseCollision/btDispatcher.h" +#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" +#include "BulletCollision/CollisionDispatch/btCollisionWorld.h" + +#include +#include "LinearMath/btQuickprof.h" + +btSimulationIslandManager::btSimulationIslandManager() +{ +} + +btSimulationIslandManager::~btSimulationIslandManager() +{ +} + + +void btSimulationIslandManager::initUnionFind(int n) +{ + m_unionFind.reset(n); +} + + +void btSimulationIslandManager::findUnions(btDispatcher* dispatcher,btCollisionWorld* colWorld) +{ + + { + btBroadphasePair* pairPtr = colWorld->getPairCache()->getOverlappingPairArrayPtr(); + + for (int i=0;igetPairCache()->getNumOverlappingPairs();i++) + { + const btBroadphasePair& collisionPair = pairPtr[i]; + btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject; + btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject; + + if (((colObj0) && ((colObj0)->mergesSimulationIslands())) && + ((colObj1) && ((colObj1)->mergesSimulationIslands()))) + { + + m_unionFind.unite((colObj0)->getIslandTag(), + (colObj1)->getIslandTag()); + } + } + } +} + + +void btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher) +{ + + initUnionFind( int (colWorld->getCollisionObjectArray().size())); + + // put the index into m_controllers into m_tag + { + + int index = 0; + int i; + for (i=0;igetCollisionObjectArray().size(); i++) + { + btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; + collisionObject->setIslandTag(index); + collisionObject->setCompanionId(-1); + collisionObject->setHitFraction(btScalar(1.)); + index++; + + } + } + // do the union find + + findUnions(dispatcher,colWorld); + + + +} + + + + +void btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld) +{ + // put the islandId ('find' value) into m_tag + { + + + int index = 0; + int i; + for (i=0;igetCollisionObjectArray().size();i++) + { + btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; + if (collisionObject->mergesSimulationIslands()) + { + collisionObject->setIslandTag( m_unionFind.find(index) ); + collisionObject->setCompanionId(-1); + } else + { + collisionObject->setIslandTag(-1); + collisionObject->setCompanionId(-2); + } + index++; + } + } +} + +inline int getIslandId(const btPersistentManifold* lhs) +{ + int islandId; + const btCollisionObject* rcolObj0 = static_cast(lhs->getBody0()); + const btCollisionObject* rcolObj1 = static_cast(lhs->getBody1()); + islandId= rcolObj0->getIslandTag()>=0?rcolObj0->getIslandTag():rcolObj1->getIslandTag(); + return islandId; + +} + + + +/// function object that routes calls to operator< +class btPersistentManifoldSortPredicate +{ + public: + + SIMD_FORCE_INLINE bool operator() ( const btPersistentManifold* lhs, const btPersistentManifold* rhs ) + { + return getIslandId(lhs) < getIslandId(rhs); + } +}; + + + + + +// +// todo: this is random access, it can be walked 'cache friendly'! +// +void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,btCollisionObjectArray& collisionObjects, IslandCallback* callback) +{ + + BEGIN_PROFILE("islandUnionFindAndHeapSort"); + + //we are going to sort the unionfind array, and store the element id in the size + //afterwards, we clean unionfind, to make sure no-one uses it anymore + + getUnionFind().sortIslands(); + int numElem = getUnionFind().getNumElements(); + + int endIslandIndex=1; + int startIslandIndex; + + + //update the sleeping state for bodies, if all are sleeping + for ( startIslandIndex=0;startIslandIndexgetIslandTag() != islandId) && (colObj0->getIslandTag() != -1)) + { + printf("error in island management\n"); + } + + assert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); + if (colObj0->getIslandTag() == islandId) + { + if (colObj0->getActivationState()== ACTIVE_TAG) + { + allSleeping = false; + } + if (colObj0->getActivationState()== DISABLE_DEACTIVATION) + { + allSleeping = false; + } + } + } + + + if (allSleeping) + { + int idx; + for (idx=startIslandIndex;idxgetIslandTag() != islandId) && (colObj0->getIslandTag() != -1)) + { + printf("error in island management\n"); + } + + assert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); + + if (colObj0->getIslandTag() == islandId) + { + colObj0->setActivationState( ISLAND_SLEEPING ); + } + } + } else + { + + int idx; + for (idx=startIslandIndex;idxgetIslandTag() != islandId) && (colObj0->getIslandTag() != -1)) + { + printf("error in island management\n"); + } + + assert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); + + if (colObj0->getIslandTag() == islandId) + { + if ( colObj0->getActivationState() == ISLAND_SLEEPING) + { + colObj0->setActivationState( WANTS_DEACTIVATION); + } + } + } + } + } + + + int i; + int maxNumManifolds = dispatcher->getNumManifolds(); + +#define SPLIT_ISLANDS 1 +#ifdef SPLIT_ISLANDS + + +#endif //SPLIT_ISLANDS + + + for (i=0;igetManifoldByIndexInternal(i); + + btCollisionObject* colObj0 = static_cast(manifold->getBody0()); + btCollisionObject* colObj1 = static_cast(manifold->getBody1()); + + //todo: check sleeping conditions! + if (((colObj0) && colObj0->getActivationState() != ISLAND_SLEEPING) || + ((colObj1) && colObj1->getActivationState() != ISLAND_SLEEPING)) + { + + //kinematic objects don't merge islands, but wake up all connected objects + if (colObj0->isKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING) + { + colObj1->activate(); + } + if (colObj1->isKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING) + { + colObj0->activate(); + } +#ifdef SPLIT_ISLANDS + // //filtering for response + if (dispatcher->needsResponse(colObj0,colObj1)) + m_islandmanifold.push_back(manifold); +#endif //SPLIT_ISLANDS + } + } + +#ifndef SPLIT_ISLANDS + btPersistentManifold** manifold = dispatcher->getInternalManifoldPointer(); + + callback->ProcessIsland(&collisionObjects[0],collisionObjects.size(),manifold,maxNumManifolds, -1); +#else + // Sort manifolds, based on islands + // Sort the vector using predicate and std::sort + //std::sort(islandmanifold.begin(), islandmanifold.end(), btPersistentManifoldSortPredicate); + + int numManifolds = int (m_islandmanifold.size()); + + //we should do radix sort, it it much faster (O(n) instead of O (n log2(n)) + m_islandmanifold.heapSort(btPersistentManifoldSortPredicate()); + + //now process all active islands (sets of manifolds for now) + + int startManifoldIndex = 0; + int endManifoldIndex = 1; + + //int islandId; + + END_PROFILE("islandUnionFindAndHeapSort"); + + + +// printf("Start Islands\n"); + + //traverse the simulation islands, and call the solver, unless all objects are sleeping/deactivated + for ( startIslandIndex=0;startIslandIndexisActive()) + islandSleeping = true; + } + + + //find the accompanying contact manifold for this islandId + int numIslandManifolds = 0; + btPersistentManifold** startManifold = 0; + + if (startManifoldIndexProcessIsland(&m_islandBodies[0],m_islandBodies.size(),startManifold,numIslandManifolds, islandId); +// printf("Island callback of size:%d bodies, %d manifolds\n",islandBodies.size(),numIslandManifolds); + } + + if (numIslandManifolds) + { + startManifoldIndex = endManifoldIndex; + } + + m_islandBodies.resize(0); + } +#endif //SPLIT_ISLANDS + + m_islandmanifold.resize(0); +} diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h b/src/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h new file mode 100644 index 000000000..0dffd3e2a --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h @@ -0,0 +1,69 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SIMULATION_ISLAND_MANAGER_H +#define SIMULATION_ISLAND_MANAGER_H + +#include "BulletCollision/CollisionDispatch/btUnionFind.h" +#include "btCollisionCreateFunc.h" +#include "LinearMath/btAlignedObjectArray.h" + + +class btCollisionObject; +class btCollisionWorld; +class btDispatcher; +class btPersistentManifold; + + +///SimulationIslandManager creates and handles simulation islands, using btUnionFind +class btSimulationIslandManager +{ + btUnionFind m_unionFind; + + btAlignedObjectArray m_islandmanifold; + btAlignedObjectArray m_islandBodies; + + +public: + btSimulationIslandManager(); + virtual ~btSimulationIslandManager(); + + + void initUnionFind(int n); + + + btUnionFind& getUnionFind() { return m_unionFind;} + + virtual void updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher); + virtual void storeIslandActivationState(btCollisionWorld* world); + + + void findUnions(btDispatcher* dispatcher,btCollisionWorld* colWorld); + + + + struct IslandCallback + { + virtual ~IslandCallback() {}; + + virtual void ProcessIsland(btCollisionObject** bodies,int numBodies,class btPersistentManifold** manifolds,int numManifolds, int islandId) = 0; + }; + + void buildAndProcessIslands(btDispatcher* dispatcher,btCollisionObjectArray& collisionObjects, IslandCallback* callback); + +}; + +#endif //SIMULATION_ISLAND_MANAGER_H + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp new file mode 100644 index 000000000..f43b09068 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp @@ -0,0 +1,260 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btSphereBoxCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" +#include "BulletCollision/CollisionShapes/btBoxShape.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" +//#include + +btSphereBoxCollisionAlgorithm::btSphereBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped) +: btCollisionAlgorithm(ci), +m_ownManifold(false), +m_manifoldPtr(mf), +m_isSwapped(isSwapped) +{ + btCollisionObject* sphereObj = m_isSwapped? col1 : col0; + btCollisionObject* boxObj = m_isSwapped? col0 : col1; + + if (!m_manifoldPtr && m_dispatcher->needsCollision(sphereObj,boxObj)) + { + m_manifoldPtr = m_dispatcher->getNewManifold(sphereObj,boxObj); + m_ownManifold = true; + } +} + + +btSphereBoxCollisionAlgorithm::~btSphereBoxCollisionAlgorithm() +{ + if (m_ownManifold) + { + if (m_manifoldPtr) + m_dispatcher->releaseManifold(m_manifoldPtr); + } +} + + + +void btSphereBoxCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + (void)dispatchInfo; + (void)resultOut; + if (!m_manifoldPtr) + return; + + btCollisionObject* sphereObj = m_isSwapped? body1 : body0; + btCollisionObject* boxObj = m_isSwapped? body0 : body1; + + + btSphereShape* sphere0 = (btSphereShape*)sphereObj->getCollisionShape(); + + btVector3 normalOnSurfaceB; + btVector3 pOnBox,pOnSphere; + btVector3 sphereCenter = sphereObj->getWorldTransform().getOrigin(); + btScalar radius = sphere0->getRadius(); + + btScalar dist = getSphereDistance(boxObj,pOnBox,pOnSphere,sphereCenter,radius); + + resultOut->setPersistentManifold(m_manifoldPtr); + + if (dist < SIMD_EPSILON) + { + btVector3 normalOnSurfaceB = (pOnBox- pOnSphere).normalize(); + + /// report a contact. internally this will be kept persistent, and contact reduction is done + + resultOut->addContactPoint(normalOnSurfaceB,pOnBox,dist); + + } + + if (m_ownManifold) + { + if (m_manifoldPtr->getNumContacts()) + { + resultOut->refreshContactPoints(); + } + } + +} + +btScalar btSphereBoxCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + (void)resultOut; + (void)dispatchInfo; + (void)col0; + (void)col1; + + //not yet + return btScalar(1.); +} + + +btScalar btSphereBoxCollisionAlgorithm::getSphereDistance(btCollisionObject* boxObj, btVector3& pointOnBox, btVector3& v3PointOnSphere, const btVector3& sphereCenter, btScalar fRadius ) +{ + + btScalar margins; + btVector3 bounds[2]; + btBoxShape* boxShape= (btBoxShape*)boxObj->getCollisionShape(); + + bounds[0] = -boxShape->getHalfExtentsWithoutMargin(); + bounds[1] = boxShape->getHalfExtentsWithoutMargin(); + + margins = boxShape->getMargin();//also add sphereShape margin? + + const btTransform& m44T = boxObj->getWorldTransform(); + + btVector3 boundsVec[2]; + btScalar fPenetration; + + boundsVec[0] = bounds[0]; + boundsVec[1] = bounds[1]; + + btVector3 marginsVec( margins, margins, margins ); + + // add margins + bounds[0] += marginsVec; + bounds[1] -= marginsVec; + + ///////////////////////////////////////////////// + + btVector3 tmp, prel, n[6], normal, v3P; + btScalar fSep = btScalar(10000000.0), fSepThis; + + n[0].setValue( btScalar(-1.0), btScalar(0.0), btScalar(0.0) ); + n[1].setValue( btScalar(0.0), btScalar(-1.0), btScalar(0.0) ); + n[2].setValue( btScalar(0.0), btScalar(0.0), btScalar(-1.0) ); + n[3].setValue( btScalar(1.0), btScalar(0.0), btScalar(0.0) ); + n[4].setValue( btScalar(0.0), btScalar(1.0), btScalar(0.0) ); + n[5].setValue( btScalar(0.0), btScalar(0.0), btScalar(1.0) ); + + // convert point in local space + prel = m44T.invXform( sphereCenter); + + bool bFound = false; + + v3P = prel; + + for (int i=0;i<6;i++) + { + int j = i<3? 0:1; + if ( (fSepThis = ((v3P-bounds[j]) .dot(n[i]))) > btScalar(0.0) ) + { + v3P = v3P - n[i]*fSepThis; + bFound = true; + } + } + + // + + if ( bFound ) + { + bounds[0] = boundsVec[0]; + bounds[1] = boundsVec[1]; + + normal = (prel - v3P).normalize(); + pointOnBox = v3P + normal*margins; + v3PointOnSphere = prel - normal*fRadius; + + if ( ((v3PointOnSphere - pointOnBox) .dot (normal)) > btScalar(0.0) ) + { + return btScalar(1.0); + } + + // transform back in world space + tmp = m44T( pointOnBox); + pointOnBox = tmp; + tmp = m44T( v3PointOnSphere); + v3PointOnSphere = tmp; + btScalar fSeps2 = (pointOnBox-v3PointOnSphere).length2(); + + //if this fails, fallback into deeper penetration case, below + if (fSeps2 > SIMD_EPSILON) + { + fSep = - btSqrt(fSeps2); + normal = (pointOnBox-v3PointOnSphere); + normal *= btScalar(1.)/fSep; + } + + return fSep; + } + + ////////////////////////////////////////////////// + // Deep penetration case + + fPenetration = getSpherePenetration( boxObj,pointOnBox, v3PointOnSphere, sphereCenter, fRadius,bounds[0],bounds[1] ); + + bounds[0] = boundsVec[0]; + bounds[1] = boundsVec[1]; + + if ( fPenetration <= btScalar(0.0) ) + return (fPenetration-margins); + else + return btScalar(1.0); +} + +btScalar btSphereBoxCollisionAlgorithm::getSpherePenetration( btCollisionObject* boxObj,btVector3& pointOnBox, btVector3& v3PointOnSphere, const btVector3& sphereCenter, btScalar fRadius, const btVector3& aabbMin, const btVector3& aabbMax) +{ + + btVector3 bounds[2]; + + bounds[0] = aabbMin; + bounds[1] = aabbMax; + + btVector3 p0, tmp, prel, n[6], normal; + btScalar fSep = btScalar(-10000000.0), fSepThis; + + // set p0 and normal to a default value to shup up GCC + p0.setValue(btScalar(0.), btScalar(0.), btScalar(0.)); + normal.setValue(btScalar(0.), btScalar(0.), btScalar(0.)); + + n[0].setValue( btScalar(-1.0), btScalar(0.0), btScalar(0.0) ); + n[1].setValue( btScalar(0.0), btScalar(-1.0), btScalar(0.0) ); + n[2].setValue( btScalar(0.0), btScalar(0.0), btScalar(-1.0) ); + n[3].setValue( btScalar(1.0), btScalar(0.0), btScalar(0.0) ); + n[4].setValue( btScalar(0.0), btScalar(1.0), btScalar(0.0) ); + n[5].setValue( btScalar(0.0), btScalar(0.0), btScalar(1.0) ); + + const btTransform& m44T = boxObj->getWorldTransform(); + + // convert point in local space + prel = m44T.invXform( sphereCenter); + + /////////// + + for (int i=0;i<6;i++) + { + int j = i<3 ? 0:1; + if ( (fSepThis = ((prel-bounds[j]) .dot( n[i]))-fRadius) > btScalar(0.0) ) return btScalar(1.0); + if ( fSepThis > fSep ) + { + p0 = bounds[j]; normal = (btVector3&)n[i]; + fSep = fSepThis; + } + } + + pointOnBox = prel - normal*(normal.dot((prel-p0))); + v3PointOnSphere = pointOnBox + normal*fSep; + + // transform back in world space + tmp = m44T( pointOnBox); + pointOnBox = tmp; + tmp = m44T( v3PointOnSphere); v3PointOnSphere = tmp; + normal = (pointOnBox-v3PointOnSphere).normalize(); + + return fSep; + +} + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h new file mode 100644 index 000000000..b839dc4ad --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h @@ -0,0 +1,67 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SPHERE_BOX_COLLISION_ALGORITHM_H +#define SPHERE_BOX_COLLISION_ALGORITHM_H + +#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h" +class btPersistentManifold; +#include "btCollisionDispatcher.h" + +#include "LinearMath/btVector3.h" + +/// btSphereBoxCollisionAlgorithm provides sphere-box collision detection. +/// Other features are frame-coherency (persistent data) and collision response. +class btSphereBoxCollisionAlgorithm : public btCollisionAlgorithm +{ + bool m_ownManifold; + btPersistentManifold* m_manifoldPtr; + bool m_isSwapped; + +public: + + btSphereBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped); + + virtual ~btSphereBoxCollisionAlgorithm(); + + virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + btScalar getSphereDistance( btCollisionObject* boxObj,btVector3& v3PointOnBox, btVector3& v3PointOnSphere, const btVector3& v3SphereCenter, btScalar fRadius ); + + btScalar getSpherePenetration( btCollisionObject* boxObj, btVector3& v3PointOnBox, btVector3& v3PointOnSphere, const btVector3& v3SphereCenter, btScalar fRadius, const btVector3& aabbMin, const btVector3& aabbMax); + + struct CreateFunc :public btCollisionAlgorithmCreateFunc + { + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + { + void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereBoxCollisionAlgorithm)); + if (!m_swapped) + { + return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0,body1,false); + } else + { + return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0,body1,true); + } + } + }; + +}; + +#endif //SPHERE_BOX_COLLISION_ALGORITHM_H + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp new file mode 100644 index 000000000..45960cc76 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp @@ -0,0 +1,93 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btSphereSphereCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" + +btSphereSphereCollisionAlgorithm::btSphereSphereCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1) +: btCollisionAlgorithm(ci), +m_ownManifold(false), +m_manifoldPtr(mf) +{ + if (!m_manifoldPtr) + { + m_manifoldPtr = m_dispatcher->getNewManifold(col0,col1); + m_ownManifold = true; + } +} + +btSphereSphereCollisionAlgorithm::~btSphereSphereCollisionAlgorithm() +{ + if (m_ownManifold) + { + if (m_manifoldPtr) + m_dispatcher->releaseManifold(m_manifoldPtr); + } +} + +void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + (void)dispatchInfo; + + if (!m_manifoldPtr) + return; + + resultOut->setPersistentManifold(m_manifoldPtr); + + btSphereShape* sphere0 = (btSphereShape*)col0->getCollisionShape(); + btSphereShape* sphere1 = (btSphereShape*)col1->getCollisionShape(); + + btVector3 diff = col0->getWorldTransform().getOrigin()- col1->getWorldTransform().getOrigin(); + btScalar len = diff.length(); + btScalar radius0 = sphere0->getRadius(); + btScalar radius1 = sphere1->getRadius(); + + m_manifoldPtr->clearManifold(); + + ///iff distance positive, don't generate a new contact + if ( len > (radius0+radius1)) + { + return; + } + ///distance (negative means penetration) + btScalar dist = len - (radius0+radius1); + + btVector3 normalOnSurfaceB = diff / len; + ///point on A (worldspace) + btVector3 pos0 = col0->getWorldTransform().getOrigin() - radius0 * normalOnSurfaceB; + ///point on B (worldspace) + btVector3 pos1 = col1->getWorldTransform().getOrigin() + radius1* normalOnSurfaceB; + + /// report a contact. internally this will be kept persistent, and contact reduction is done + + + resultOut->addContactPoint(normalOnSurfaceB,pos1,dist); + + //no resultOut->refreshContactPoints(); needed, because of clearManifold (all points are new) + +} + +btScalar btSphereSphereCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + (void)col0; + (void)col1; + (void)dispatchInfo; + (void)resultOut; + + //not yet + return btScalar(1.); +} diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h new file mode 100644 index 000000000..bcaa0d303 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h @@ -0,0 +1,59 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SPHERE_SPHERE_COLLISION_ALGORITHM_H +#define SPHERE_SPHERE_COLLISION_ALGORITHM_H + +#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h" +#include "btCollisionDispatcher.h" + +class btPersistentManifold; + +/// btSphereSphereCollisionAlgorithm provides sphere-sphere collision detection. +/// Other features are frame-coherency (persistent data) and collision response. +/// Also provides the most basic sample for custom/user btCollisionAlgorithm +class btSphereSphereCollisionAlgorithm : public btCollisionAlgorithm +{ + bool m_ownManifold; + btPersistentManifold* m_manifoldPtr; + +public: + btSphereSphereCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1); + + btSphereSphereCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci) + : btCollisionAlgorithm(ci) {} + + virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + + virtual ~btSphereSphereCollisionAlgorithm(); + + struct CreateFunc :public btCollisionAlgorithmCreateFunc + { + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + { + void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereSphereCollisionAlgorithm)); + return new(mem) btSphereSphereCollisionAlgorithm(0,ci,body0,body1); + } + }; + +}; + +#endif //SPHERE_SPHERE_COLLISION_ALGORITHM_H + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp new file mode 100644 index 000000000..b3b612d52 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp @@ -0,0 +1,82 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btSphereTriangleCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" +#include "SphereTriangleDetector.h" + + +btSphereTriangleCollisionAlgorithm::btSphereTriangleCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1,bool swapped) +: btCollisionAlgorithm(ci), +m_ownManifold(false), +m_manifoldPtr(mf), +m_swapped(swapped) +{ + if (!m_manifoldPtr) + { + m_manifoldPtr = m_dispatcher->getNewManifold(col0,col1); + m_ownManifold = true; + } +} + +btSphereTriangleCollisionAlgorithm::~btSphereTriangleCollisionAlgorithm() +{ + if (m_ownManifold) + { + if (m_manifoldPtr) + m_dispatcher->releaseManifold(m_manifoldPtr); + } +} + +void btSphereTriangleCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + if (!m_manifoldPtr) + return; + + btCollisionObject* sphereObj = m_swapped? col1 : col0; + btCollisionObject* triObj = m_swapped? col0 : col1; + + btSphereShape* sphere = (btSphereShape*)sphereObj->getCollisionShape(); + btTriangleShape* triangle = (btTriangleShape*)triObj->getCollisionShape(); + + /// report a contact. internally this will be kept persistent, and contact reduction is done + resultOut->setPersistentManifold(m_manifoldPtr); + SphereTriangleDetector detector(sphere,triangle); + + btDiscreteCollisionDetectorInterface::ClosestPointInput input; + input.m_maximumDistanceSquared = btScalar(1e30);//todo: tighter bounds + input.m_transformA = col0->getWorldTransform(); + input.m_transformB = col1->getWorldTransform(); + + detector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw); + + if (m_ownManifold) + resultOut->refreshContactPoints(); + +} + +btScalar btSphereTriangleCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +{ + (void)resultOut; + (void)dispatchInfo; + (void)col0; + (void)col1; + + //not yet + return btScalar(1.); +} diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h new file mode 100644 index 000000000..4aefc0c43 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h @@ -0,0 +1,62 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SPHERE_TRIANGLE_COLLISION_ALGORITHM_H +#define SPHERE_TRIANGLE_COLLISION_ALGORITHM_H + +#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h" +class btPersistentManifold; +#include "btCollisionDispatcher.h" + +/// btSphereSphereCollisionAlgorithm provides sphere-sphere collision detection. +/// Other features are frame-coherency (persistent data) and collision response. +/// Also provides the most basic sample for custom/user btCollisionAlgorithm +class btSphereTriangleCollisionAlgorithm : public btCollisionAlgorithm +{ + bool m_ownManifold; + btPersistentManifold* m_manifoldPtr; + bool m_swapped; + +public: + btSphereTriangleCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool swapped); + + btSphereTriangleCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci) + : btCollisionAlgorithm(ci) {} + + virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut); + + + virtual ~btSphereTriangleCollisionAlgorithm(); + + struct CreateFunc :public btCollisionAlgorithmCreateFunc + { + + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + { + + void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereTriangleCollisionAlgorithm)); + + return new(mem) btSphereTriangleCollisionAlgorithm(ci.m_manifold,ci,body0,body1,m_swapped); + } + }; + +}; + +#endif //SPHERE_TRIANGLE_COLLISION_ALGORITHM_H + diff --git a/src/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.cpp b/src/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.cpp new file mode 100644 index 000000000..c81be8aa7 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.cpp @@ -0,0 +1,84 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btUnionFind.h" +#include + + + + +btUnionFind::~btUnionFind() +{ + Free(); + +} + +btUnionFind::btUnionFind() +{ + +} + +void btUnionFind::allocate(int N) +{ + m_elements.resize(N); +} +void btUnionFind::Free() +{ + m_elements.clear(); +} + + +void btUnionFind::reset(int N) +{ + allocate(N); + + for (int i = 0; i < N; i++) + { + m_elements[i].m_id = i; m_elements[i].m_sz = 1; + } +} + + +class btUnionFindElementSortPredicate +{ + public: + + bool operator() ( const btElement& lhs, const btElement& rhs ) + { + return lhs.m_id < rhs.m_id; + } +}; + +///this is a special operation, destroying the content of btUnionFind. +///it sorts the elements, based on island id, in order to make it easy to iterate over islands +void btUnionFind::sortIslands() +{ + + //first store the original body index, and islandId + int numElements = m_elements.size(); + + for (int i=0;i m_elements; + + public: + + btUnionFind(); + ~btUnionFind(); + + + //this is a special operation, destroying the content of btUnionFind. + //it sorts the elements, based on island id, in order to make it easy to iterate over islands + void sortIslands(); + + void reset(int N); + + SIMD_FORCE_INLINE int getNumElements() const + { + return int(m_elements.size()); + } + SIMD_FORCE_INLINE bool isRoot(int x) const + { + return (x == m_elements[x].m_id); + } + + btElement& getElement(int index) + { + return m_elements[index]; + } + const btElement& getElement(int index) const + { + return m_elements[index]; + } + + void allocate(int N); + void Free(); + + + + + int find(int p, int q) + { + return (find(p) == find(q)); + } + + void unite(int p, int q) + { + int i = find(p), j = find(q); + if (i == j) + return; + +#ifndef USE_PATH_COMPRESSION + //weighted quick union, this keeps the 'trees' balanced, and keeps performance of unite O( log(n) ) + if (m_elements[i].m_sz < m_elements[j].m_sz) + { + m_elements[i].m_id = j; m_elements[j].m_sz += m_elements[i].m_sz; + } + else + { + m_elements[j].m_id = i; m_elements[i].m_sz += m_elements[j].m_sz; + } +#else + m_elements[i].m_id = j; m_elements[j].m_sz += m_elements[i].m_sz; +#endif //USE_PATH_COMPRESSION + } + + int find(int x) + { + //assert(x < m_N); + //assert(x >= 0); + + while (x != m_elements[x].m_id) + { + //not really a reason not to use path compression, and it flattens the trees/improves find performance dramatically + + #ifdef USE_PATH_COMPRESSION + // + m_elements[x].m_id = m_elements[m_elements[x].m_id].m_id; + #endif // + x = m_elements[x].m_id; + //assert(x < m_N); + //assert(x >= 0); + + } + return x; + } + + + }; + + +#endif //UNION_FIND_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btBoxShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btBoxShape.cpp new file mode 100644 index 000000000..adac455bb --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btBoxShape.cpp @@ -0,0 +1,54 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btBoxShape.h" + + +//{ + + +void btBoxShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const +{ + const btVector3& halfExtents = getHalfExtentsWithoutMargin(); + + btMatrix3x3 abs_b = t.getBasis().absolute(); + btPoint3 center = t.getOrigin(); + btVector3 extent = btVector3(abs_b[0].dot(halfExtents), + abs_b[1].dot(halfExtents), + abs_b[2].dot(halfExtents)); + extent += btVector3(getMargin(),getMargin(),getMargin()); + + aabbMin = center - extent; + aabbMax = center + extent; + + +} + + +void btBoxShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const +{ + //btScalar margin = btScalar(0.); + btVector3 halfExtents = getHalfExtentsWithMargin(); + + btScalar lx=btScalar(2.)*(halfExtents.x()); + btScalar ly=btScalar(2.)*(halfExtents.y()); + btScalar lz=btScalar(2.)*(halfExtents.z()); + + inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz), + mass/(btScalar(12.0)) * (lx*lx + lz*lz), + mass/(btScalar(12.0)) * (lx*lx + ly*ly)); + +} + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btBoxShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btBoxShape.h new file mode 100644 index 000000000..98f1bd34b --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btBoxShape.h @@ -0,0 +1,323 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef OBB_BOX_MINKOWSKI_H +#define OBB_BOX_MINKOWSKI_H + +#include "btPolyhedralConvexShape.h" +#include "btCollisionMargin.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "LinearMath/btPoint3.h" +#include "LinearMath/btMinMax.h" + +///btBoxShape implements both a feature based (vertex/edge/plane) and implicit (getSupportingVertex) Box +class btBoxShape: public btPolyhedralConvexShape +{ + + //btVector3 m_boxHalfExtents1; //use m_implicitShapeDimensions instead + + +public: + + btVector3 getHalfExtentsWithMargin() const + { + btVector3 halfExtents = getHalfExtentsWithoutMargin(); + btVector3 margin(getMargin(),getMargin(),getMargin()); + halfExtents += margin; + return halfExtents; + } + + const btVector3& getHalfExtentsWithoutMargin() const + { + return m_implicitShapeDimensions;//changed in Bullet 2.63: assume the scaling and margin are included + } + + + virtual int getShapeType() const { return BOX_SHAPE_PROXYTYPE;} + + virtual btVector3 localGetSupportingVertex(const btVector3& vec) const + { + btVector3 halfExtents = getHalfExtentsWithoutMargin(); + btVector3 margin(getMargin(),getMargin(),getMargin()); + halfExtents += margin; + + return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()), + btFsels(vec.y(), halfExtents.y(), -halfExtents.y()), + btFsels(vec.z(), halfExtents.z(), -halfExtents.z())); + } + + SIMD_FORCE_INLINE btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const + { + const btVector3& halfExtents = getHalfExtentsWithoutMargin(); + + return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()), + btFsels(vec.y(), halfExtents.y(), -halfExtents.y()), + btFsels(vec.z(), halfExtents.z(), -halfExtents.z())); + } + + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const + { + const btVector3& halfExtents = getHalfExtentsWithoutMargin(); + + for (int i=0;i>1)) - halfExtents.y() * ((i&2)>>1), + halfExtents.z() * (1-((i&4)>>2)) - halfExtents.z() * ((i&4)>>2)); + } + + + virtual void getPlaneEquation(btVector4& plane,int i) const + { + btVector3 halfExtents = getHalfExtentsWithoutMargin(); + + switch (i) + { + case 0: + plane.setValue(btScalar(1.),btScalar(0.),btScalar(0.)); + plane[3] = -halfExtents.x(); + break; + case 1: + plane.setValue(btScalar(-1.),btScalar(0.),btScalar(0.)); + plane[3] = -halfExtents.x(); + break; + case 2: + plane.setValue(btScalar(0.),btScalar(1.),btScalar(0.)); + plane[3] = -halfExtents.y(); + break; + case 3: + plane.setValue(btScalar(0.),btScalar(-1.),btScalar(0.)); + plane[3] = -halfExtents.y(); + break; + case 4: + plane.setValue(btScalar(0.),btScalar(0.),btScalar(1.)); + plane[3] = -halfExtents.z(); + break; + case 5: + plane.setValue(btScalar(0.),btScalar(0.),btScalar(-1.)); + plane[3] = -halfExtents.z(); + break; + default: + assert(0); + } + } + + + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const + //virtual void getEdge(int i,Edge& edge) const + { + int edgeVert0 = 0; + int edgeVert1 = 0; + + switch (i) + { + case 0: + edgeVert0 = 0; + edgeVert1 = 1; + break; + case 1: + edgeVert0 = 0; + edgeVert1 = 2; + break; + case 2: + edgeVert0 = 1; + edgeVert1 = 3; + + break; + case 3: + edgeVert0 = 2; + edgeVert1 = 3; + break; + case 4: + edgeVert0 = 0; + edgeVert1 = 4; + break; + case 5: + edgeVert0 = 1; + edgeVert1 = 5; + + break; + case 6: + edgeVert0 = 2; + edgeVert1 = 6; + break; + case 7: + edgeVert0 = 3; + edgeVert1 = 7; + break; + case 8: + edgeVert0 = 4; + edgeVert1 = 5; + break; + case 9: + edgeVert0 = 4; + edgeVert1 = 6; + break; + case 10: + edgeVert0 = 5; + edgeVert1 = 7; + break; + case 11: + edgeVert0 = 6; + edgeVert1 = 7; + break; + default: + btAssert(0); + + } + + getVertex(edgeVert0,pa ); + getVertex(edgeVert1,pb ); + } + + + + + + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const + { + btVector3 halfExtents = getHalfExtentsWithoutMargin(); + + //btScalar minDist = 2*tolerance; + + bool result = (pt.x() <= (halfExtents.x()+tolerance)) && + (pt.x() >= (-halfExtents.x()-tolerance)) && + (pt.y() <= (halfExtents.y()+tolerance)) && + (pt.y() >= (-halfExtents.y()-tolerance)) && + (pt.z() <= (halfExtents.z()+tolerance)) && + (pt.z() >= (-halfExtents.z()-tolerance)); + + return result; + } + + + //debugging + virtual const char* getName()const + { + return "Box"; + } + + virtual int getNumPreferredPenetrationDirections() const + { + return 6; + } + + virtual void getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const + { + switch (index) + { + case 0: + penetrationVector.setValue(btScalar(1.),btScalar(0.),btScalar(0.)); + break; + case 1: + penetrationVector.setValue(btScalar(-1.),btScalar(0.),btScalar(0.)); + break; + case 2: + penetrationVector.setValue(btScalar(0.),btScalar(1.),btScalar(0.)); + break; + case 3: + penetrationVector.setValue(btScalar(0.),btScalar(-1.),btScalar(0.)); + break; + case 4: + penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(1.)); + break; + case 5: + penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(-1.)); + break; + default: + assert(0); + } + } + +}; + +#endif //OBB_BOX_MINKOWSKI_H + + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp new file mode 100644 index 000000000..eea263fe5 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp @@ -0,0 +1,200 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +//#define DISABLE_BVH + +#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" +#include "BulletCollision/CollisionShapes/btOptimizedBvh.h" + + +///Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization. +///Uses an interface to access the triangles to allow for sharing graphics/physics triangles. +btBvhTriangleMeshShape::btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh) +:btTriangleMeshShape(meshInterface), +m_bvh(0), +m_useQuantizedAabbCompression(useQuantizedAabbCompression), +m_ownsBvh(false) +{ + //construct bvh from meshInterface +#ifndef DISABLE_BVH + + btVector3 bvhAabbMin,bvhAabbMax; + meshInterface->calculateAabbBruteForce(bvhAabbMin,bvhAabbMax); + + if (buildBvh) + { + void* mem = btAlignedAlloc(sizeof(btOptimizedBvh),16); + m_bvh = new (mem) btOptimizedBvh(); + m_bvh->build(meshInterface,m_useQuantizedAabbCompression,bvhAabbMin,bvhAabbMax); + m_ownsBvh = true; + } + +#endif //DISABLE_BVH + +} + +btBvhTriangleMeshShape::btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression,const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,bool buildBvh) +:btTriangleMeshShape(meshInterface), +m_bvh(0), +m_useQuantizedAabbCompression(useQuantizedAabbCompression), +m_ownsBvh(false) +{ + //construct bvh from meshInterface +#ifndef DISABLE_BVH + + if (buildBvh) + { + void* mem = btAlignedAlloc(sizeof(btOptimizedBvh),16); + m_bvh = new (mem) btOptimizedBvh(); + + m_bvh->build(meshInterface,m_useQuantizedAabbCompression,bvhAabbMin,bvhAabbMax); + m_ownsBvh = true; + } + +#endif //DISABLE_BVH + +} + +void btBvhTriangleMeshShape::partialRefitTree(const btVector3& aabbMin,const btVector3& aabbMax) +{ + m_bvh->refitPartial( m_meshInterface,aabbMin,aabbMax ); + + m_localAabbMin.setMin(aabbMin); + m_localAabbMax.setMax(aabbMax); +} + + +void btBvhTriangleMeshShape::refitTree() +{ + m_bvh->refit( m_meshInterface ); + + recalcLocalAabb(); +} + +btBvhTriangleMeshShape::~btBvhTriangleMeshShape() +{ + if (m_ownsBvh) + { + m_bvh->~btOptimizedBvh(); + btAlignedFree(m_bvh); + } +} + +//perform bvh tree traversal and report overlapping triangles to 'callback' +void btBvhTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const +{ + +#ifdef DISABLE_BVH + //brute force traverse all triangles + btTriangleMeshShape::processAllTriangles(callback,aabbMin,aabbMax); +#else + + //first get all the nodes + + + struct MyNodeOverlapCallback : public btNodeOverlapCallback + { + btStridingMeshInterface* m_meshInterface; + btTriangleCallback* m_callback; + btVector3 m_triangle[3]; + + + MyNodeOverlapCallback(btTriangleCallback* callback,btStridingMeshInterface* meshInterface) + :m_meshInterface(meshInterface), + m_callback(callback) + { + } + + virtual void processNode(int nodeSubPart, int nodeTriangleIndex) + { + const unsigned char *vertexbase; + int numverts; + PHY_ScalarType type; + int stride; + const unsigned char *indexbase; + int indexstride; + int numfaces; + PHY_ScalarType indicestype; + + + m_meshInterface->getLockedReadOnlyVertexIndexBase( + &vertexbase, + numverts, + type, + stride, + &indexbase, + indexstride, + numfaces, + indicestype, + nodeSubPart); + + int* gfxbase = (int*)(indexbase+nodeTriangleIndex*indexstride); + + const btVector3& meshScaling = m_meshInterface->getScaling(); + for (int j=2;j>=0;j--) + { + + int graphicsindex = gfxbase[j]; + + +#ifdef DEBUG_TRIANGLE_MESH + printf("%d ,",graphicsindex); +#endif //DEBUG_TRIANGLE_MESH + btScalar* graphicsbase = (btScalar*)(vertexbase+graphicsindex*stride); + + m_triangle[j] = btVector3( + graphicsbase[0]*meshScaling.getX(), + graphicsbase[1]*meshScaling.getY(), + graphicsbase[2]*meshScaling.getZ()); +#ifdef DEBUG_TRIANGLE_MESH + printf("triangle vertices:%f,%f,%f\n",triangle[j].x(),triangle[j].y(),triangle[j].z()); +#endif //DEBUG_TRIANGLE_MESH + } + + m_callback->processTriangle(m_triangle,nodeSubPart,nodeTriangleIndex); + m_meshInterface->unLockReadOnlyVertexBase(nodeSubPart); + } + + }; + + MyNodeOverlapCallback myNodeCallback(callback,m_meshInterface); + + m_bvh->reportAabbOverlappingNodex(&myNodeCallback,aabbMin,aabbMax); + + +#endif//DISABLE_BVH + + +} + + +void btBvhTriangleMeshShape::setLocalScaling(const btVector3& scaling) +{ + if ((getLocalScaling() -scaling).length2() > SIMD_EPSILON) + { + btTriangleMeshShape::setLocalScaling(scaling); + if (m_ownsBvh) + { + m_bvh->~btOptimizedBvh(); + btAlignedFree(m_bvh); + } + ///m_localAabbMin/m_localAabbMax is already re-calculated in btTriangleMeshShape. We could just scale aabb, but this needs some more work + void* mem = btAlignedAlloc(sizeof(btOptimizedBvh),16); + m_bvh = new(mem) btOptimizedBvh(); + //rebuild the bvh... + m_bvh->build(m_meshInterface,m_useQuantizedAabbCompression,m_localAabbMin,m_localAabbMax); + + } +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h new file mode 100644 index 000000000..95c73b244 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h @@ -0,0 +1,90 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BVH_TRIANGLE_MESH_SHAPE_H +#define BVH_TRIANGLE_MESH_SHAPE_H + +#include "btTriangleMeshShape.h" +#include "btOptimizedBvh.h" +#include "LinearMath/btAlignedAllocator.h" + +///Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization. +///Uses an interface to access the triangles to allow for sharing graphics/physics triangles. +ATTRIBUTE_ALIGNED16(class) btBvhTriangleMeshShape : public btTriangleMeshShape +{ + + btOptimizedBvh* m_bvh; + bool m_useQuantizedAabbCompression; + bool m_ownsBvh; + bool m_pad[11];////need padding due to alignment + +public: + + BT_DECLARE_ALIGNED_ALLOCATOR(); + + btBvhTriangleMeshShape() :btTriangleMeshShape(0),m_bvh(0),m_ownsBvh(false) {}; + btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true); + + ///optionally pass in a larger bvh aabb, used for quantization. This allows for deformations within this aabb + btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression,const btVector3& bvhAabbMin,const btVector3& bvhAabbMax, bool buildBvh = true); + + virtual ~btBvhTriangleMeshShape(); + + + /* + virtual int getShapeType() const + { + return TRIANGLE_MESH_SHAPE_PROXYTYPE; + } + */ + + + + virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + + void refitTree(); + + ///for a fast incremental refit of parts of the tree. Note: the entire AABB of the tree will become more conservative, it never shrinks + void partialRefitTree(const btVector3& aabbMin,const btVector3& aabbMax); + + //debugging + virtual const char* getName()const {return "BVHTRIANGLEMESH";} + + + virtual void setLocalScaling(const btVector3& scaling); + + btOptimizedBvh* getOptimizedBvh() + { + return m_bvh; + } + + + void setOptimizedBvh(btOptimizedBvh* bvh) + { + btAssert(!m_bvh); + btAssert(!m_ownsBvh); + + m_bvh = bvh; + m_ownsBvh = false; + } + + bool usesQuantizedAabbCompression() const + { + return m_useQuantizedAabbCompression; + } +} +; + +#endif //BVH_TRIANGLE_MESH_SHAPE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp new file mode 100644 index 000000000..56fced755 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp @@ -0,0 +1,146 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btCapsuleShape.h" + +#include "BulletCollision/CollisionShapes/btCollisionMargin.h" +#include "LinearMath/btQuaternion.h" + +btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) +{ + m_implicitShapeDimensions.setValue(radius,0.5f*height,radius); +} + + + btVector3 btCapsuleShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const +{ + + btVector3 supVec(0,0,0); + + btScalar maxDot(btScalar(-1e30)); + + btVector3 vec = vec0; + btScalar lenSqr = vec.length2(); + if (lenSqr < btScalar(0.0001)) + { + vec.setValue(1,0,0); + } else + { + btScalar rlen = btScalar(1.) / btSqrt(lenSqr ); + vec *= rlen; + } + + btVector3 vtx; + btScalar newDot; + + btScalar radius = getRadius(); + + + { + btVector3 pos(0,getHalfHeight(),0); + vtx = pos +vec*m_localScaling*(radius) - vec * getMargin(); + newDot = vec.dot(vtx); + if (newDot > maxDot) + { + maxDot = newDot; + supVec = vtx; + } + } + { + btVector3 pos(0,-getHalfHeight(),0); + vtx = pos +vec*m_localScaling*(radius) - vec * getMargin(); + newDot = vec.dot(vtx); + if (newDot > maxDot) + { + maxDot = newDot; + supVec = vtx; + } + } + + return supVec; + +} + + void btCapsuleShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + + + btScalar radius = getRadius(); + + for (int j=0;j maxDot) + { + maxDot = newDot; + supportVerticesOut[j] = vtx; + } + } + { + btVector3 pos(0,-getHalfHeight(),0); + vtx = pos +vec*m_localScaling*(radius) - vec * getMargin(); + newDot = vec.dot(vtx); + if (newDot > maxDot) + { + maxDot = newDot; + supportVerticesOut[j] = vtx; + } + } + + } +} + + +void btCapsuleShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const +{ + //as an approximation, take the inertia of the box that bounds the spheres + + btTransform ident; + ident.setIdentity(); + + + btScalar radius = getRadius(); + + btVector3 halfExtents(radius,radius+getHalfHeight(),radius); + + btScalar margin = CONVEX_DISTANCE_MARGIN; + + btScalar lx=btScalar(2.)*(halfExtents[0]+margin); + btScalar ly=btScalar(2.)*(halfExtents[1]+margin); + btScalar lz=btScalar(2.)*(halfExtents[2]+margin); + const btScalar x2 = lx*lx; + const btScalar y2 = ly*ly; + const btScalar z2 = lz*lz; + const btScalar scaledmass = mass * btScalar(.08333333); + + inertia[0] = scaledmass * (y2+z2); + inertia[1] = scaledmass * (x2+z2); + inertia[2] = scaledmass * (x2+y2); + +} + + + + + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h new file mode 100644 index 000000000..0b566450f --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h @@ -0,0 +1,60 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_CAPSULE_SHAPE_H +#define BT_CAPSULE_SHAPE_H + +#include "btConvexInternalShape.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types + + +///btCapsuleShape represents a capsule around the Y axis +///A more general solution that can represent capsules is the btMultiSphereShape +class btCapsuleShape : public btConvexInternalShape +{ + +public: + btCapsuleShape(btScalar radius,btScalar height); + + ///CollisionShape Interface + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const; + + /// btConvexShape Interface + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + + virtual int getShapeType() const { return CAPSULE_SHAPE_PROXYTYPE; } + + virtual const char* getName()const + { + return "CapsuleShape"; + } + + btScalar getRadius() const + { + return m_implicitShapeDimensions.getX(); + } + + btScalar getHalfHeight() const + { + return m_implicitShapeDimensions.getY(); + } + +}; + + + +#endif //BT_CAPSULE_SHAPE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btCollisionMargin.h b/src/bullet/src/BulletCollision/CollisionShapes/btCollisionMargin.h new file mode 100644 index 000000000..4730264d3 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btCollisionMargin.h @@ -0,0 +1,26 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COLLISION_MARGIN_H +#define COLLISION_MARGIN_H + +//used by Gjk and some other algorithms + +#define CONVEX_DISTANCE_MARGIN btScalar(0.04)// btScalar(0.1)//;//btScalar(0.01) + + + +#endif //COLLISION_MARGIN_H + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.cpp new file mode 100644 index 000000000..81d82428f --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.cpp @@ -0,0 +1,85 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "BulletCollision/CollisionShapes/btCollisionShape.h" + + +/* + Make sure this dummy function never changes so that it + can be used by probes that are checking whether the + library is actually installed. +*/ +extern "C" void btBulletCollisionProbe () {} + + + +void btCollisionShape::getBoundingSphere(btVector3& center,btScalar& radius) const +{ + btTransform tr; + tr.setIdentity(); + btVector3 aabbMin,aabbMax; + + getAabb(tr,aabbMin,aabbMax); + + radius = (aabbMax-aabbMin).length()*btScalar(0.5); + center = (aabbMin+aabbMax)*btScalar(0.5); +} + +btScalar btCollisionShape::getAngularMotionDisc() const +{ + btVector3 center; + btScalar disc; + getBoundingSphere(center,disc); + disc += (center).length(); + return disc; +} + +void btCollisionShape::calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) +{ + //start with static aabb + getAabb(curTrans,temporalAabbMin,temporalAabbMax); + + btScalar temporalAabbMaxx = temporalAabbMax.getX(); + btScalar temporalAabbMaxy = temporalAabbMax.getY(); + btScalar temporalAabbMaxz = temporalAabbMax.getZ(); + btScalar temporalAabbMinx = temporalAabbMin.getX(); + btScalar temporalAabbMiny = temporalAabbMin.getY(); + btScalar temporalAabbMinz = temporalAabbMin.getZ(); + + // add linear motion + btVector3 linMotion = linvel*timeStep; + //todo: simd would have a vector max/min operation, instead of per-element access + if (linMotion.x() > btScalar(0.)) + temporalAabbMaxx += linMotion.x(); + else + temporalAabbMinx += linMotion.x(); + if (linMotion.y() > btScalar(0.)) + temporalAabbMaxy += linMotion.y(); + else + temporalAabbMiny += linMotion.y(); + if (linMotion.z() > btScalar(0.)) + temporalAabbMaxz += linMotion.z(); + else + temporalAabbMinz += linMotion.z(); + + //add conservative angular motion + btScalar angularMotion = angvel.length() * getAngularMotionDisc() * timeStep; + btVector3 angularMotion3d(angularMotion,angularMotion,angularMotion); + temporalAabbMin = btVector3(temporalAabbMinx,temporalAabbMiny,temporalAabbMinz); + temporalAabbMax = btVector3(temporalAabbMaxx,temporalAabbMaxy,temporalAabbMaxz); + + temporalAabbMin -= angularMotion3d; + temporalAabbMax += angularMotion3d; +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h new file mode 100644 index 000000000..53fb12e33 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h @@ -0,0 +1,94 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COLLISION_SHAPE_H +#define COLLISION_SHAPE_H + +#include "LinearMath/btTransform.h" +#include "LinearMath/btVector3.h" +#include "LinearMath/btMatrix3x3.h" +#include "LinearMath/btPoint3.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types + +///btCollisionShape provides interface for collision shapes that can be shared among btCollisionObjects. +class btCollisionShape +{ +public: + + btCollisionShape() + { + } + virtual ~btCollisionShape() + { + } + + ///getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t. + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0; + + virtual void getBoundingSphere(btVector3& center,btScalar& radius) const; + + ///getAngularMotionDisc returns the maximus radius needed for Conservative Advancement to handle time-of-impact with rotations. + virtual btScalar getAngularMotionDisc() const; + + + ///calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep) + ///result is conservative + void calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax); + +#ifndef __SPU__ + + SIMD_FORCE_INLINE bool isPolyhedral() const + { + return btBroadphaseProxy::isPolyhedral(getShapeType()); + } + + SIMD_FORCE_INLINE bool isConvex() const + { + return btBroadphaseProxy::isConvex(getShapeType()); + } + SIMD_FORCE_INLINE bool isConcave() const + { + return btBroadphaseProxy::isConcave(getShapeType()); + } + SIMD_FORCE_INLINE bool isCompound() const + { + return btBroadphaseProxy::isCompound(getShapeType()); + } + + ///isInfinite is used to catch simulation error (aabb check) + SIMD_FORCE_INLINE bool isInfinite() const + { + return btBroadphaseProxy::isInfinite(getShapeType()); + } + + virtual int getShapeType() const=0; + virtual void setLocalScaling(const btVector3& scaling) =0; + virtual const btVector3& getLocalScaling() const =0; + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const = 0; + + +//debugging support + virtual const char* getName()const =0 ; +#endif //__SPU__ + + + + virtual void setMargin(btScalar margin) = 0; + virtual btScalar getMargin() const = 0; + +}; + +#endif //COLLISION_SHAPE_H + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.cpp new file mode 100644 index 000000000..114a1f4c1 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.cpp @@ -0,0 +1,107 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btCompoundShape.h" + + +#include "btCollisionShape.h" + + +btCompoundShape::btCompoundShape() +:m_localAabbMin(btScalar(1e30),btScalar(1e30),btScalar(1e30)), +m_localAabbMax(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30)), +m_aabbTree(0), +m_collisionMargin(btScalar(0.)), +m_localScaling(btScalar(1.),btScalar(1.),btScalar(1.)) +{ +} + + +btCompoundShape::~btCompoundShape() +{ +} + +void btCompoundShape::addChildShape(const btTransform& localTransform,btCollisionShape* shape) +{ + //m_childTransforms.push_back(localTransform); + //m_childShapes.push_back(shape); + btCompoundShapeChild child; + child.m_transform = localTransform; + child.m_childShape = shape; + child.m_childShapeType = shape->getShapeType(); + child.m_childMargin = shape->getMargin(); + + m_children.push_back(child); + + //extend the local aabbMin/aabbMax + btVector3 localAabbMin,localAabbMax; + shape->getAabb(localTransform,localAabbMin,localAabbMax); + for (int i=0;i<3;i++) + { + if (m_localAabbMin[i] > localAabbMin[i]) + { + m_localAabbMin[i] = localAabbMin[i]; + } + if (m_localAabbMax[i] < localAabbMax[i]) + { + m_localAabbMax[i] = localAabbMax[i]; + } + + } +} + + + + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version +void btCompoundShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const +{ + btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin); + btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin); + + btMatrix3x3 abs_b = trans.getBasis().absolute(); + + btPoint3 center = trans(localCenter); + + btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents), + abs_b[1].dot(localHalfExtents), + abs_b[2].dot(localHalfExtents)); + extent += btVector3(getMargin(),getMargin(),getMargin()); + + aabbMin = center - extent; + aabbMax = center + extent; +} + +void btCompoundShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const +{ + //approximation: take the inertia from the aabb for now + btTransform ident; + ident.setIdentity(); + btVector3 aabbMin,aabbMax; + getAabb(ident,aabbMin,aabbMax); + + btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5); + + btScalar lx=btScalar(2.)*(halfExtents.x()); + btScalar ly=btScalar(2.)*(halfExtents.y()); + btScalar lz=btScalar(2.)*(halfExtents.z()); + + inertia[0] = mass/(btScalar(12.0)) * (ly*ly + lz*lz); + inertia[1] = mass/(btScalar(12.0)) * (lx*lx + lz*lz); + inertia[2] = mass/(btScalar(12.0)) * (lx*lx + ly*ly); + +} + + + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.h new file mode 100644 index 000000000..d23bd65b5 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.h @@ -0,0 +1,136 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COMPOUND_SHAPE_H +#define COMPOUND_SHAPE_H + +#include "btCollisionShape.h" + +#include "LinearMath/btVector3.h" +#include "LinearMath/btTransform.h" +#include "LinearMath/btMatrix3x3.h" +#include "btCollisionMargin.h" +#include "LinearMath/btAlignedObjectArray.h" + +class btOptimizedBvh; + +ATTRIBUTE_ALIGNED16(struct) btCompoundShapeChild +{ + BT_DECLARE_ALIGNED_ALLOCATOR(); + + btTransform m_transform; + btCollisionShape* m_childShape; + int m_childShapeType; + btScalar m_childMargin; +}; + +/// btCompoundShape allows to store multiple other btCollisionShapes +/// This allows for concave collision objects. This is more general then the Static Concave btTriangleMeshShape. +ATTRIBUTE_ALIGNED16(class) btCompoundShape : public btCollisionShape +{ + //btAlignedObjectArray m_childTransforms; + //btAlignedObjectArray m_childShapes; + btAlignedObjectArray m_children; + btVector3 m_localAabbMin; + btVector3 m_localAabbMax; + + btOptimizedBvh* m_aabbTree; + +public: + BT_DECLARE_ALIGNED_ALLOCATOR(); + + btCompoundShape(); + + virtual ~btCompoundShape(); + + void addChildShape(const btTransform& localTransform,btCollisionShape* shape); + + int getNumChildShapes() const + { + return int (m_children.size()); + } + + btCollisionShape* getChildShape(int index) + { + return m_children[index].m_childShape; + } + const btCollisionShape* getChildShape(int index) const + { + return m_children[index].m_childShape; + } + + btTransform getChildTransform(int index) + { + return m_children[index].m_transform; + } + const btTransform getChildTransform(int index) const + { + return m_children[index].m_transform; + } + + + btCompoundShapeChild* getChildList() + { + return &m_children[0]; + } + + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version + void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + + + virtual void setLocalScaling(const btVector3& scaling) + { + m_localScaling = scaling; + } + virtual const btVector3& getLocalScaling() const + { + return m_localScaling; + } + + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const; + + virtual int getShapeType() const { return COMPOUND_SHAPE_PROXYTYPE;} + + virtual void setMargin(btScalar margin) + { + m_collisionMargin = margin; + } + virtual btScalar getMargin() const + { + return m_collisionMargin; + } + virtual const char* getName()const + { + return "Compound"; + } + + //this is optional, but should make collision queries faster, by culling non-overlapping nodes + void createAabbTreeFromChildren(); + + const btOptimizedBvh* getAabbTree() const + { + return m_aabbTree; + } + +private: + btScalar m_collisionMargin; +protected: + btVector3 m_localScaling; + +}; + + + +#endif //COMPOUND_SHAPE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.cpp new file mode 100644 index 000000000..5103500a0 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.cpp @@ -0,0 +1,28 @@ + +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btConcaveShape.h" + +btConcaveShape::btConcaveShape() : m_collisionMargin(btScalar(0.)) +{ + +} + +btConcaveShape::~btConcaveShape() +{ + +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.h new file mode 100644 index 000000000..4db4e6513 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.h @@ -0,0 +1,50 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONCAVE_SHAPE_H +#define CONCAVE_SHAPE_H + +#include "btCollisionShape.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types +#include "btTriangleCallback.h" + + +///Concave shape proves an interface concave shapes that can produce triangles that overlapping a given AABB. +///Static triangle mesh, infinite plane, height field/landscapes are example that implement this interface. +class btConcaveShape : public btCollisionShape +{ +protected: + btScalar m_collisionMargin; + +public: + btConcaveShape(); + + virtual ~btConcaveShape(); + + virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const = 0; + + virtual btScalar getMargin() const { + return m_collisionMargin; + } + virtual void setMargin(btScalar collisionMargin) + { + m_collisionMargin = collisionMargin; + } + + + +}; + +#endif //CONCAVE_SHAPE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConeShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btConeShape.cpp new file mode 100644 index 000000000..207b3024b --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConeShape.cpp @@ -0,0 +1,133 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btConeShape.h" +#include "LinearMath/btPoint3.h" + + + +btConeShape::btConeShape (btScalar radius,btScalar height): +m_radius (radius), +m_height(height) +{ + setConeUpIndex(1); + btVector3 halfExtents; + m_sinAngle = (m_radius / btSqrt(m_radius * m_radius + m_height * m_height)); +} + +btConeShapeZ::btConeShapeZ (btScalar radius,btScalar height): +btConeShape(radius,height) +{ + setConeUpIndex(2); +} + +btConeShapeX::btConeShapeX (btScalar radius,btScalar height): +btConeShape(radius,height) +{ + setConeUpIndex(0); +} + +///choose upAxis index +void btConeShape::setConeUpIndex(int upIndex) +{ + switch (upIndex) + { + case 0: + m_coneIndices[0] = 1; + m_coneIndices[1] = 0; + m_coneIndices[2] = 2; + break; + case 1: + m_coneIndices[0] = 0; + m_coneIndices[1] = 1; + m_coneIndices[2] = 2; + break; + case 2: + m_coneIndices[0] = 0; + m_coneIndices[1] = 2; + m_coneIndices[2] = 1; + break; + default: + assert(0); + }; +} + +btVector3 btConeShape::coneLocalSupport(const btVector3& v) const +{ + + btScalar halfHeight = m_height * btScalar(0.5); + + if (v[m_coneIndices[1]] > v.length() * m_sinAngle) + { + btVector3 tmp; + + tmp[m_coneIndices[0]] = btScalar(0.); + tmp[m_coneIndices[1]] = halfHeight; + tmp[m_coneIndices[2]] = btScalar(0.); + return tmp; + } + else { + btScalar s = btSqrt(v[m_coneIndices[0]] * v[m_coneIndices[0]] + v[m_coneIndices[2]] * v[m_coneIndices[2]]); + if (s > SIMD_EPSILON) { + btScalar d = m_radius / s; + btVector3 tmp; + tmp[m_coneIndices[0]] = v[m_coneIndices[0]] * d; + tmp[m_coneIndices[1]] = -halfHeight; + tmp[m_coneIndices[2]] = v[m_coneIndices[2]] * d; + return tmp; + } + else { + btVector3 tmp; + tmp[m_coneIndices[0]] = btScalar(0.); + tmp[m_coneIndices[1]] = -halfHeight; + tmp[m_coneIndices[2]] = btScalar(0.); + return tmp; + } + } + +} + +btVector3 btConeShape::localGetSupportingVertexWithoutMargin(const btVector3& vec) const +{ + return coneLocalSupport(vec); +} + +void btConeShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + for (int i=0;i maxDot) + { + maxDot = newDot; + supVec = vtx; + } + } + return supVec; +} + +void btConvexHullShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + btScalar newDot; + //use 'w' component of supportVerticesOut? + { + for (int i=0;i supportVerticesOut[j][3]) + { + //WARNING: don't swap next lines, the w component would get overwritten! + supportVerticesOut[j] = vtx; + supportVerticesOut[j][3] = newDot; + } + } + } + + + +} + + + +btVector3 btConvexHullShape::localGetSupportingVertex(const btVector3& vec)const +{ + btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec); + + if ( getMargin()!=btScalar(0.) ) + { + btVector3 vecnorm = vec; + if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON)) + { + vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.)); + } + vecnorm.normalize(); + supVertex+= getMargin() * vecnorm; + } + return supVertex; +} + + + + + + + + + +//currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection +//Please note that you can debug-draw btConvexHullShape with the Raytracer Demo +int btConvexHullShape::getNumVertices() const +{ + return m_points.size(); +} + +int btConvexHullShape::getNumEdges() const +{ + return m_points.size(); +} + +void btConvexHullShape::getEdge(int i,btPoint3& pa,btPoint3& pb) const +{ + + int index0 = i%m_points.size(); + int index1 = (i+1)%m_points.size(); + pa = m_points[index0]*m_localScaling; + pb = m_points[index1]*m_localScaling; +} + +void btConvexHullShape::getVertex(int i,btPoint3& vtx) const +{ + vtx = m_points[i]*m_localScaling; +} + +int btConvexHullShape::getNumPlanes() const +{ + return 0; +} + +void btConvexHullShape::getPlane(btVector3& ,btPoint3& ,int ) const +{ + + btAssert(0); +} + +//not yet +bool btConvexHullShape::isInside(const btPoint3& ,btScalar ) const +{ + assert(0); + return false; +} + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.h new file mode 100644 index 000000000..0928d68b8 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.h @@ -0,0 +1,77 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONVEX_HULL_SHAPE_H +#define CONVEX_HULL_SHAPE_H + +#include "btPolyhedralConvexShape.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types +#include "LinearMath/btAlignedObjectArray.h" + +///ConvexHullShape implements an implicit (getSupportingVertex) Convex Hull of a Point Cloud (vertices) +///No connectivity is needed. localGetSupportingVertex iterates linearly though all vertices. +///on modern hardware, due to cache coherency this isn't that bad. Complex algorithms tend to trash the cash. +///(memory is much slower then the cpu) +ATTRIBUTE_ALIGNED16(class) btConvexHullShape : public btPolyhedralConvexShape +{ + btAlignedObjectArray m_points; + +public: + BT_DECLARE_ALIGNED_ALLOCATOR(); + + + ///this constructor optionally takes in a pointer to points. Each point is assumed to be 3 consecutive btScalar (x,y,z), the striding defines the number of bytes between each point, in memory. + ///It is easier to not pass any points in the constructor, and just add one point at a time, using addPoint. + ///btConvexHullShape make an internal copy of the points. + btConvexHullShape(const btScalar* points=0,int numPoints=0, int stride=sizeof(btPoint3)); + + void addPoint(const btPoint3& point); + + btPoint3* getPoints() + { + return &m_points[0]; + } + + int getNumPoints() + { + return m_points.size(); + } + + virtual btVector3 localGetSupportingVertex(const btVector3& vec)const; + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + + + virtual int getShapeType()const { return CONVEX_HULL_SHAPE_PROXYTYPE; } + + //debugging + virtual const char* getName()const {return "Convex";} + + + virtual int getNumVertices() const; + virtual int getNumEdges() const; + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const; + virtual void getVertex(int i,btPoint3& vtx) const; + virtual int getNumPlanes() const; + virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const; + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const; + + + +}; + + +#endif //CONVEX_HULL_SHAPE_H + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp new file mode 100644 index 000000000..f828d28e1 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp @@ -0,0 +1,78 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btConvexInternalShape.h" + + +btConvexInternalShape::btConvexInternalShape() +: m_localScaling(btScalar(1.),btScalar(1.),btScalar(1.)), +m_collisionMargin(CONVEX_DISTANCE_MARGIN) +{ +} + + +void btConvexInternalShape::setLocalScaling(const btVector3& scaling) +{ + m_localScaling = scaling; +} + + + +void btConvexInternalShape::getAabbSlow(const btTransform& trans,btVector3&minAabb,btVector3&maxAabb) const +{ + + btScalar margin = getMargin(); + for (int i=0;i<3;i++) + { + btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.)); + vec[i] = btScalar(1.); + + btVector3 sv = localGetSupportingVertex(vec*trans.getBasis()); + + btVector3 tmp = trans(sv); + maxAabb[i] = tmp[i]+margin; + vec[i] = btScalar(-1.); + tmp = trans(localGetSupportingVertex(vec*trans.getBasis())); + minAabb[i] = tmp[i]-margin; + } +}; + + +btVector3 btConvexInternalShape::localGetSupportingVertex(const btVector3& vec)const +{ +#ifndef __SPU__ + + btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec); + + if ( getMargin()!=btScalar(0.) ) + { + btVector3 vecnorm = vec; + if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON)) + { + vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.)); + } + vecnorm.normalize(); + supVertex+= getMargin() * vecnorm; + } + return supVertex; + +#else + return btVector3(0,0,0); +#endif //__SPU__ + + } + + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h new file mode 100644 index 000000000..a03af873b --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h @@ -0,0 +1,99 @@ + +#ifndef BT_CONVEX_INTERNAL_SHAPE_H +#define BT_CONVEX_INTERNAL_SHAPE_H + +#include "btConvexShape.h" + +///btConvexInternalShape carries some additional data, shared by most implementations +class btConvexInternalShape : public btConvexShape +{ + + protected: + + //local scaling. collisionMargin is not scaled ! + btVector3 m_localScaling; + + btVector3 m_implicitShapeDimensions; + + btScalar m_collisionMargin; + + btScalar m_padding[2]; + + + + +public: + + btConvexInternalShape(); + + virtual ~btConvexInternalShape() + { + + } + + + virtual btVector3 localGetSupportingVertex(const btVector3& vec)const; +#ifndef __SPU__ + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec) const= 0; + + //notice that the vectors should be unit length + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const= 0; +#endif //#ifndef __SPU__ + + const btVector3& getImplicitShapeDimensions() const + { + return m_implicitShapeDimensions; + } + + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version + void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const + { + getAabbSlow(t,aabbMin,aabbMax); + } + + + + virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + + + virtual void setLocalScaling(const btVector3& scaling); + virtual const btVector3& getLocalScaling() const + { + return m_localScaling; + } + + const btVector3& getLocalScalingNV() const + { + return m_localScaling; + } + + virtual void setMargin(btScalar margin) + { + m_collisionMargin = margin; + } + virtual btScalar getMargin() const + { + return m_collisionMargin; + } + + btScalar getMarginNV() const + { + return m_collisionMargin; + } + + virtual int getNumPreferredPenetrationDirections() const + { + return 0; + } + + virtual void getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const + { + (void)penetrationVector; + (void)index; + btAssert(0); + } + +}; + + +#endif //BT_CONVEX_INTERNAL_SHAPE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConvexShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btConvexShape.cpp new file mode 100644 index 000000000..7afcccf8b --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConvexShape.cpp @@ -0,0 +1,18 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btConvexShape.h" + + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h new file mode 100644 index 000000000..6dfd288e0 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h @@ -0,0 +1,77 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONVEX_SHAPE_INTERFACE1 +#define CONVEX_SHAPE_INTERFACE1 + +#include "btCollisionShape.h" + +#include "LinearMath/btVector3.h" +#include "LinearMath/btTransform.h" +#include "LinearMath/btMatrix3x3.h" +#include "btCollisionMargin.h" +#include "LinearMath/btAlignedAllocator.h" + +//todo: get rid of this btConvexCastResult thing! +struct btConvexCastResult; +#define MAX_PREFERRED_PENETRATION_DIRECTIONS 10 + +/// btConvexShape is an abstract shape interface. +/// It describes general convex shapes using the localGetSupportingVertex interface +/// used in combination with GJK or btConvexCast +ATTRIBUTE_ALIGNED16(class) btConvexShape : public btCollisionShape +{ + + +public: + + BT_DECLARE_ALIGNED_ALLOCATOR(); + + virtual ~btConvexShape() + { + + } + + + virtual btVector3 localGetSupportingVertex(const btVector3& vec)const =0; +#ifndef __SPU__ + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec) const= 0; + + //notice that the vectors should be unit length + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const= 0; +#endif //#ifndef __SPU__ + + + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version + void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0; + + virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0; + + virtual void setLocalScaling(const btVector3& scaling) =0; + virtual const btVector3& getLocalScaling() const =0; + + virtual void setMargin(btScalar margin)=0; + + virtual btScalar getMargin() const=0; + + virtual int getNumPreferredPenetrationDirections() const=0; + + virtual void getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const=0; + +}; + + + +#endif //CONVEX_SHAPE_INTERFACE1 diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp new file mode 100644 index 000000000..5f93abbef --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp @@ -0,0 +1,205 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#include "btConvexTriangleMeshShape.h" +#include "BulletCollision/CollisionShapes/btCollisionMargin.h" + +#include "LinearMath/btQuaternion.h" +#include "BulletCollision/CollisionShapes/btStridingMeshInterface.h" + + +btConvexTriangleMeshShape ::btConvexTriangleMeshShape (btStridingMeshInterface* meshInterface) +:m_stridingMesh(meshInterface) +{ + recalcLocalAabb(); +} + + + + +///It's not nice to have all this virtual function overhead, so perhaps we can also gather the points once +///but then we are duplicating +class LocalSupportVertexCallback: public btInternalTriangleIndexCallback +{ + + btVector3 m_supportVertexLocal; +public: + + btScalar m_maxDot; + btVector3 m_supportVecLocal; + + LocalSupportVertexCallback(const btVector3& supportVecLocal) + : m_supportVertexLocal(btScalar(0.),btScalar(0.),btScalar(0.)), + m_maxDot(btScalar(-1e30)), + m_supportVecLocal(supportVecLocal) + { + } + + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + { + (void)triangleIndex; + (void)partId; + + for (int i=0;i<3;i++) + { + btScalar dot = m_supportVecLocal.dot(triangle[i]); + if (dot > m_maxDot) + { + m_maxDot = dot; + m_supportVertexLocal = triangle[i]; + } + } + } + + btVector3 GetSupportVertexLocal() + { + return m_supportVertexLocal; + } + +}; + + + + + +btVector3 btConvexTriangleMeshShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const +{ + btVector3 supVec(btScalar(0.),btScalar(0.),btScalar(0.)); + + btVector3 vec = vec0; + btScalar lenSqr = vec.length2(); + if (lenSqr < btScalar(0.0001)) + { + vec.setValue(1,0,0); + } else + { + btScalar rlen = btScalar(1.) / btSqrt(lenSqr ); + vec *= rlen; + } + + LocalSupportVertexCallback supportCallback(vec); + btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + m_stridingMesh->InternalProcessAllTriangles(&supportCallback,-aabbMax,aabbMax); + supVec = supportCallback.GetSupportVertexLocal(); + + return supVec; +} + +void btConvexTriangleMeshShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + //use 'w' component of supportVerticesOut? + { + for (int i=0;iInternalProcessAllTriangles(&supportCallback,-aabbMax,aabbMax); + supportVerticesOut[j] = supportCallback.GetSupportVertexLocal(); + } + +} + + + +btVector3 btConvexTriangleMeshShape::localGetSupportingVertex(const btVector3& vec)const +{ + btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec); + + if ( getMargin()!=btScalar(0.) ) + { + btVector3 vecnorm = vec; + if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON)) + { + vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.)); + } + vecnorm.normalize(); + supVertex+= getMargin() * vecnorm; + } + return supVertex; +} + + + + + + + + + +//currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection +//Please note that you can debug-draw btConvexTriangleMeshShape with the Raytracer Demo +int btConvexTriangleMeshShape::getNumVertices() const +{ + //cache this? + return 0; + +} + +int btConvexTriangleMeshShape::getNumEdges() const +{ + return 0; +} + +void btConvexTriangleMeshShape::getEdge(int ,btPoint3& ,btPoint3& ) const +{ + btAssert(0); +} + +void btConvexTriangleMeshShape::getVertex(int ,btPoint3& ) const +{ + btAssert(0); +} + +int btConvexTriangleMeshShape::getNumPlanes() const +{ + return 0; +} + +void btConvexTriangleMeshShape::getPlane(btVector3& ,btPoint3& ,int ) const +{ + btAssert(0); +} + +//not yet +bool btConvexTriangleMeshShape::isInside(const btPoint3& ,btScalar ) const +{ + btAssert(0); + return false; +} + + + +void btConvexTriangleMeshShape::setLocalScaling(const btVector3& scaling) +{ + m_stridingMesh->setScaling(scaling); + + recalcLocalAabb(); + +} + + +const btVector3& btConvexTriangleMeshShape::getLocalScaling() const +{ + return m_stridingMesh->getScaling(); +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h new file mode 100644 index 000000000..f3daa5836 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h @@ -0,0 +1,55 @@ +#ifndef CONVEX_TRIANGLEMESH_SHAPE_H +#define CONVEX_TRIANGLEMESH_SHAPE_H + + +#include "btPolyhedralConvexShape.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types + + +/// btConvexTriangleMeshShape is a convex hull of a triangle mesh. If you just have a point cloud, you can use btConvexHullShape instead. +/// It uses the btStridingMeshInterface instead of a point cloud. This can avoid the duplication of the triangle mesh data. +class btConvexTriangleMeshShape : public btPolyhedralConvexShape +{ + + class btStridingMeshInterface* m_stridingMesh; + +public: + btConvexTriangleMeshShape(btStridingMeshInterface* meshInterface); + + class btStridingMeshInterface* getMeshInterface() + { + return m_stridingMesh; + } + const class btStridingMeshInterface* getMeshInterface() const + { + return m_stridingMesh; + } + + virtual btVector3 localGetSupportingVertex(const btVector3& vec)const; + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + + virtual int getShapeType()const { return CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE; } + + //debugging + virtual const char* getName()const {return "ConvexTrimesh";} + + virtual int getNumVertices() const; + virtual int getNumEdges() const; + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const; + virtual void getVertex(int i,btPoint3& vtx) const; + virtual int getNumPlanes() const; + virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const; + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const; + + + virtual void setLocalScaling(const btVector3& scaling); + virtual const btVector3& getLocalScaling() const; + +}; + + + +#endif //CONVEX_TRIANGLEMESH_SHAPE_H + + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.cpp new file mode 100644 index 000000000..3afef1c75 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.cpp @@ -0,0 +1,206 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#include "btCylinderShape.h" +#include "LinearMath/btPoint3.h" + +btCylinderShape::btCylinderShape (const btVector3& halfExtents) +:btBoxShape(halfExtents), +m_upAxis(1) +{ + recalcLocalAabb(); +} + + +btCylinderShapeX::btCylinderShapeX (const btVector3& halfExtents) +:btCylinderShape(halfExtents) +{ + m_upAxis = 0; + recalcLocalAabb(); +} + + +btCylinderShapeZ::btCylinderShapeZ (const btVector3& halfExtents) +:btCylinderShape(halfExtents) +{ + m_upAxis = 2; + recalcLocalAabb(); +} + +void btCylinderShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const +{ + //skip the box 'getAabb' + btPolyhedralConvexShape::getAabb(t,aabbMin,aabbMax); +} + + +SIMD_FORCE_INLINE btVector3 CylinderLocalSupportX(const btVector3& halfExtents,const btVector3& v) +{ +const int cylinderUpAxis = 0; +const int XX = 1; +const int YY = 0; +const int ZZ = 2; + + //mapping depends on how cylinder local orientation is + // extents of the cylinder is: X,Y is for radius, and Z for height + + + btScalar radius = halfExtents[XX]; + btScalar halfHeight = halfExtents[cylinderUpAxis]; + + + btVector3 tmp; + btScalar d ; + + btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]); + if (s != btScalar(0.0)) + { + d = radius / s; + tmp[XX] = v[XX] * d; + tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight; + tmp[ZZ] = v[ZZ] * d; + return tmp; + } + else + { + tmp[XX] = radius; + tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight; + tmp[ZZ] = btScalar(0.0); + return tmp; + } + + +} + + + + + + +inline btVector3 CylinderLocalSupportY(const btVector3& halfExtents,const btVector3& v) +{ + +const int cylinderUpAxis = 1; +const int XX = 0; +const int YY = 1; +const int ZZ = 2; + + + btScalar radius = halfExtents[XX]; + btScalar halfHeight = halfExtents[cylinderUpAxis]; + + + btVector3 tmp; + btScalar d ; + + btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]); + if (s != btScalar(0.0)) + { + d = radius / s; + tmp[XX] = v[XX] * d; + tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight; + tmp[ZZ] = v[ZZ] * d; + return tmp; + } + else + { + tmp[XX] = radius; + tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight; + tmp[ZZ] = btScalar(0.0); + return tmp; + } + +} + +inline btVector3 CylinderLocalSupportZ(const btVector3& halfExtents,const btVector3& v) +{ +const int cylinderUpAxis = 2; +const int XX = 0; +const int YY = 2; +const int ZZ = 1; + + //mapping depends on how cylinder local orientation is + // extents of the cylinder is: X,Y is for radius, and Z for height + + + btScalar radius = halfExtents[XX]; + btScalar halfHeight = halfExtents[cylinderUpAxis]; + + + btVector3 tmp; + btScalar d ; + + btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]); + if (s != btScalar(0.0)) + { + d = radius / s; + tmp[XX] = v[XX] * d; + tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight; + tmp[ZZ] = v[ZZ] * d; + return tmp; + } + else + { + tmp[XX] = radius; + tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight; + tmp[ZZ] = btScalar(0.0); + return tmp; + } + + +} + +btVector3 btCylinderShapeX::localGetSupportingVertexWithoutMargin(const btVector3& vec)const +{ + return CylinderLocalSupportX(getHalfExtentsWithoutMargin(),vec); +} + + +btVector3 btCylinderShapeZ::localGetSupportingVertexWithoutMargin(const btVector3& vec)const +{ + return CylinderLocalSupportZ(getHalfExtentsWithoutMargin(),vec); +} +btVector3 btCylinderShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const +{ + return CylinderLocalSupportY(getHalfExtentsWithoutMargin(),vec); +} + +void btCylinderShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + for (int i=0;i=0); + btAssert(y>=0); + btAssert(xstartX) + startX = quantizedAabbMin[1]; + if (quantizedAabbMax[1]startJ) + startJ = quantizedAabbMin[2]; + if (quantizedAabbMax[2]startX) + startX = quantizedAabbMin[0]; + if (quantizedAabbMax[0]startJ) + startJ = quantizedAabbMin[2]; + if (quantizedAabbMax[2]startX) + startX = quantizedAabbMin[0]; + if (quantizedAabbMax[0]startJ) + startJ = quantizedAabbMin[1]; + if (quantizedAabbMax[1]processTriangle(vertices,x,j); + //second triangle + getVertex(x,j,vertices[0]); + getVertex(x+1,j+1,vertices[1]); + getVertex(x,j+1,vertices[2]); + callback->processTriangle(vertices,x,j); + } else + { + //first triangle + getVertex(x,j,vertices[0]); + getVertex(x,j+1,vertices[1]); + getVertex(x+1,j,vertices[2]); + callback->processTriangle(vertices,x,j); + //second triangle + getVertex(x+1,j,vertices[0]); + getVertex(x,j+1,vertices[1]); + getVertex(x+1,j+1,vertices[2]); + callback->processTriangle(vertices,x,j); + } + } + } + + + +} + +void btHeightfieldTerrainShape::calculateLocalInertia(btScalar ,btVector3& inertia) const +{ + //moving concave objects not supported + + inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); +} + +void btHeightfieldTerrainShape::setLocalScaling(const btVector3& scaling) +{ + m_localScaling = scaling; +} +const btVector3& btHeightfieldTerrainShape::getLocalScaling() const +{ + return m_localScaling; +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h new file mode 100644 index 000000000..8dba7b3d5 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h @@ -0,0 +1,88 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef HEIGHTFIELD_TERRAIN_SHAPE_H +#define HEIGHTFIELD_TERRAIN_SHAPE_H + +#include "btConcaveShape.h" + +///btHeightfieldTerrainShape simulates a 2D heightfield terrain +class btHeightfieldTerrainShape : public btConcaveShape +{ +protected: + btVector3 m_localAabbMin; + btVector3 m_localAabbMax; + + ///terrain data + int m_width; + int m_length; + btScalar m_maxHeight; + union + { + unsigned char* m_heightfieldDataUnsignedChar; + btScalar* m_heightfieldDataFloat; + void* m_heightfieldDataUnknown; + }; + + bool m_useFloatData; + bool m_flipQuadEdges; + bool m_useDiamondSubdivision; + + int m_upAxis; + + btVector3 m_localScaling; + + virtual btScalar getHeightFieldValue(int x,int y) const; + void quantizeWithClamp(int* out, const btVector3& point) const; + void getVertex(int x,int y,btVector3& vertex) const; + + inline bool testQuantizedAabbAgainstQuantizedAabb(int* aabbMin1, int* aabbMax1,const int* aabbMin2,const int* aabbMax2) const + { + bool overlap = true; + overlap = (aabbMin1[0] > aabbMax2[0] || aabbMax1[0] < aabbMin2[0]) ? false : overlap; + overlap = (aabbMin1[2] > aabbMax2[2] || aabbMax1[2] < aabbMin2[2]) ? false : overlap; + overlap = (aabbMin1[1] > aabbMax2[1] || aabbMax1[1] < aabbMin2[1]) ? false : overlap; + return overlap; + } + +public: + btHeightfieldTerrainShape(int width,int height,void* heightfieldData, btScalar maxHeight,int upAxis,bool useFloatData,bool flipQuadEdges); + + virtual ~btHeightfieldTerrainShape(); + + + void setUseDiamondSubdivision(bool useDiamondSubdivision=true) { m_useDiamondSubdivision = useDiamondSubdivision;} + + virtual int getShapeType() const + { + return TERRAIN_SHAPE_PROXYTYPE; + } + + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + + virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const; + + virtual void setLocalScaling(const btVector3& scaling); + + virtual const btVector3& getLocalScaling() const; + + //debugging + virtual const char* getName()const {return "HEIGHTFIELD";} + +}; + +#endif //HEIGHTFIELD_TERRAIN_SHAPE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp new file mode 100644 index 000000000..7f7f28221 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp @@ -0,0 +1,57 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btMinkowskiSumShape.h" + + +btMinkowskiSumShape::btMinkowskiSumShape(const btConvexShape* shapeA,const btConvexShape* shapeB) +:m_shapeA(shapeA), +m_shapeB(shapeB) +{ + m_transA.setIdentity(); + m_transB.setIdentity(); +} + +btVector3 btMinkowskiSumShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const +{ + btVector3 supVertexA = m_transA(m_shapeA->localGetSupportingVertexWithoutMargin(vec*m_transA.getBasis())); + btVector3 supVertexB = m_transB(m_shapeB->localGetSupportingVertexWithoutMargin(vec*m_transB.getBasis())); + return supVertexA + supVertexB; +} + +void btMinkowskiSumShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + //todo: could make recursive use of batching. probably this shape is not used frequently. + for (int i=0;igetMargin() + m_shapeB->getMargin(); +} + + +void btMinkowskiSumShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const +{ + (void)mass; + btAssert(0); + inertia.setValue(0,0,0); +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h new file mode 100644 index 000000000..484e317e6 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h @@ -0,0 +1,62 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef MINKOWSKI_SUM_SHAPE_H +#define MINKOWSKI_SUM_SHAPE_H + +#include "btConvexInternalShape.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types + +/// btMinkowskiSumShape represents implicit (getSupportingVertex) based minkowski sum of two convex implicit shapes. +class btMinkowskiSumShape : public btConvexInternalShape +{ + + btTransform m_transA; + btTransform m_transB; + const btConvexShape* m_shapeA; + const btConvexShape* m_shapeB; + +public: + + btMinkowskiSumShape(const btConvexShape* shapeA,const btConvexShape* shapeB); + + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + + + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const; + + void setTransformA(const btTransform& transA) { m_transA = transA;} + void setTransformB(const btTransform& transB) { m_transB = transB;} + + const btTransform& getTransformA()const { return m_transA;} + const btTransform& GetTransformB()const { return m_transB;} + + + virtual int getShapeType() const { return MINKOWSKI_SUM_SHAPE_PROXYTYPE; } + + virtual btScalar getMargin() const; + + const btConvexShape* getShapeA() const { return m_shapeA;} + const btConvexShape* getShapeB() const { return m_shapeB;} + + virtual const char* getName()const + { + return "MinkowskiSum"; + } +}; + +#endif //MINKOWSKI_SUM_SHAPE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp new file mode 100644 index 000000000..a8ce8622f --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp @@ -0,0 +1,148 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btMultiSphereShape.h" +#include "BulletCollision/CollisionShapes/btCollisionMargin.h" +#include "LinearMath/btQuaternion.h" + +btMultiSphereShape::btMultiSphereShape (const btVector3& inertiaHalfExtents,const btVector3* positions,const btScalar* radi,int numSpheres) +:m_inertiaHalfExtents(inertiaHalfExtents) +{ + btScalar startMargin = btScalar(1e30); + + m_numSpheres = numSpheres; + for (int i=0;i maxDot) + { + maxDot = newDot; + supVec = vtx; + } + } + + return supVec; + +} + + void btMultiSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + + for (int j=0;j maxDot) + { + maxDot = newDot; + supportVerticesOut[j] = vtx; + } + } + } +} + + + + + + + + +void btMultiSphereShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const +{ + //as an approximation, take the inertia of the box that bounds the spheres + + btTransform ident; + ident.setIdentity(); +// btVector3 aabbMin,aabbMax; + +// getAabb(ident,aabbMin,aabbMax); + + btVector3 halfExtents = m_inertiaHalfExtents;//(aabbMax - aabbMin)* btScalar(0.5); + + btScalar margin = CONVEX_DISTANCE_MARGIN; + + btScalar lx=btScalar(2.)*(halfExtents[0]+margin); + btScalar ly=btScalar(2.)*(halfExtents[1]+margin); + btScalar lz=btScalar(2.)*(halfExtents[2]+margin); + const btScalar x2 = lx*lx; + const btScalar y2 = ly*ly; + const btScalar z2 = lz*lz; + const btScalar scaledmass = mass * btScalar(.08333333); + + inertia[0] = scaledmass * (y2+z2); + inertia[1] = scaledmass * (x2+z2); + inertia[2] = scaledmass * (x2+y2); + +} + + + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.h new file mode 100644 index 000000000..7db54e7a2 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.h @@ -0,0 +1,74 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef MULTI_SPHERE_MINKOWSKI_H +#define MULTI_SPHERE_MINKOWSKI_H + +#include "btConvexInternalShape.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types + +#define MAX_NUM_SPHERES 5 + +///btMultiSphereShape represents implicit convex hull of a collection of spheres (using getSupportingVertex) +class btMultiSphereShape : public btConvexInternalShape + +{ + + btVector3 m_localPositions[MAX_NUM_SPHERES]; + btScalar m_radi[MAX_NUM_SPHERES]; + btVector3 m_inertiaHalfExtents; + + int m_numSpheres; + + + + +public: + btMultiSphereShape (const btVector3& inertiaHalfExtents,const btVector3* positions,const btScalar* radi,int numSpheres); + + ///CollisionShape Interface + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const; + + /// btConvexShape Interface + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + + int getSphereCount() const + { + return m_numSpheres; + } + + const btVector3& getSpherePosition(int index) const + { + return m_localPositions[index]; + } + + btScalar getSphereRadius(int index) const + { + return m_radi[index]; + } + + virtual int getShapeType() const { return MULTI_SPHERE_SHAPE_PROXYTYPE; } + + virtual const char* getName()const + { + return "MultiSphere"; + } + +}; + + +#endif //MULTI_SPHERE_MINKOWSKI_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp new file mode 100644 index 000000000..e80469f45 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp @@ -0,0 +1,1181 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#include "btOptimizedBvh.h" +#include "btStridingMeshInterface.h" +#include "LinearMath/btAabbUtil2.h" +#include "LinearMath/btIDebugDraw.h" + + +btOptimizedBvh::btOptimizedBvh() : m_useQuantization(false), + //m_traversalMode(TRAVERSAL_STACKLESS_CACHE_FRIENDLY) + m_traversalMode(TRAVERSAL_STACKLESS) + //m_traversalMode(TRAVERSAL_RECURSIVE) + ,m_subtreeHeaderCount(0) //PCK: add this line +{ + +} + + +void btOptimizedBvh::build(btStridingMeshInterface* triangles, bool useQuantizedAabbCompression, const btVector3& bvhAabbMin, const btVector3& bvhAabbMax) +{ + m_useQuantization = useQuantizedAabbCompression; + + + // NodeArray triangleNodes; + + struct NodeTriangleCallback : public btInternalTriangleIndexCallback + { + + NodeArray& m_triangleNodes; + + NodeTriangleCallback& operator=(NodeTriangleCallback& other) + { + m_triangleNodes = other.m_triangleNodes; + return *this; + } + + NodeTriangleCallback(NodeArray& triangleNodes) + :m_triangleNodes(triangleNodes) + { + } + + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + { + btOptimizedBvhNode node; + btVector3 aabbMin,aabbMax; + aabbMin.setValue(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + aabbMax.setValue(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30)); + aabbMin.setMin(triangle[0]); + aabbMax.setMax(triangle[0]); + aabbMin.setMin(triangle[1]); + aabbMax.setMax(triangle[1]); + aabbMin.setMin(triangle[2]); + aabbMax.setMax(triangle[2]); + + //with quantization? + node.m_aabbMinOrg = aabbMin; + node.m_aabbMaxOrg = aabbMax; + + node.m_escapeIndex = -1; + + //for child nodes + node.m_subPart = partId; + node.m_triangleIndex = triangleIndex; + m_triangleNodes.push_back(node); + } + }; + struct QuantizedNodeTriangleCallback : public btInternalTriangleIndexCallback + { + QuantizedNodeArray& m_triangleNodes; + const btOptimizedBvh* m_optimizedTree; // for quantization + + QuantizedNodeTriangleCallback& operator=(QuantizedNodeTriangleCallback& other) + { + m_triangleNodes = other.m_triangleNodes; + m_optimizedTree = other.m_optimizedTree; + return *this; + } + + QuantizedNodeTriangleCallback(QuantizedNodeArray& triangleNodes,const btOptimizedBvh* tree) + :m_triangleNodes(triangleNodes),m_optimizedTree(tree) + { + } + + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + { + btAssert(partId==0); + //negative indices are reserved for escapeIndex + btAssert(triangleIndex>=0); + + btQuantizedBvhNode node; + btVector3 aabbMin,aabbMax; + aabbMin.setValue(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + aabbMax.setValue(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30)); + aabbMin.setMin(triangle[0]); + aabbMax.setMax(triangle[0]); + aabbMin.setMin(triangle[1]); + aabbMax.setMax(triangle[1]); + aabbMin.setMin(triangle[2]); + aabbMax.setMax(triangle[2]); + + //PCK: add these checks for zero dimensions of aabb + const btScalar MIN_AABB_DIMENSION = btScalar(0.002); + const btScalar MIN_AABB_HALF_DIMENSION = btScalar(0.001); + if (aabbMax.x() - aabbMin.x() < MIN_AABB_DIMENSION) + { + aabbMax.setX(aabbMax.x() + MIN_AABB_HALF_DIMENSION); + aabbMin.setX(aabbMin.x() - MIN_AABB_HALF_DIMENSION); + } + if (aabbMax.y() - aabbMin.y() < MIN_AABB_DIMENSION) + { + aabbMax.setY(aabbMax.y() + MIN_AABB_HALF_DIMENSION); + aabbMin.setY(aabbMin.y() - MIN_AABB_HALF_DIMENSION); + } + if (aabbMax.z() - aabbMin.z() < MIN_AABB_DIMENSION) + { + aabbMax.setZ(aabbMax.z() + MIN_AABB_HALF_DIMENSION); + aabbMin.setZ(aabbMin.z() - MIN_AABB_HALF_DIMENSION); + } + + m_optimizedTree->quantizeWithClamp(&node.m_quantizedAabbMin[0],aabbMin); + m_optimizedTree->quantizeWithClamp(&node.m_quantizedAabbMax[0],aabbMax); + + node.m_escapeIndexOrTriangleIndex = triangleIndex; + + m_triangleNodes.push_back(node); + } + }; + + + + int numLeafNodes = 0; + + + if (m_useQuantization) + { + + //initialize quantization values + setQuantizationValues(bvhAabbMin,bvhAabbMax); + + QuantizedNodeTriangleCallback callback(m_quantizedLeafNodes,this); + + + triangles->InternalProcessAllTriangles(&callback,m_bvhAabbMin,m_bvhAabbMax); + + //now we have an array of leafnodes in m_leafNodes + numLeafNodes = m_quantizedLeafNodes.size(); + + + m_quantizedContiguousNodes.resize(2*numLeafNodes); + + + } else + { + NodeTriangleCallback callback(m_leafNodes); + + btVector3 aabbMin(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30)); + btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + + triangles->InternalProcessAllTriangles(&callback,aabbMin,aabbMax); + + //now we have an array of leafnodes in m_leafNodes + numLeafNodes = m_leafNodes.size(); + + m_contiguousNodes.resize(2*numLeafNodes); + } + + m_curNodeIndex = 0; + + buildTree(0,numLeafNodes); + + ///if the entire tree is small then subtree size, we need to create a header info for the tree + if(m_useQuantization && !m_SubtreeHeaders.size()) + { + btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand(); + subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[0]); + subtree.m_rootNodeIndex = 0; + subtree.m_subtreeSize = m_quantizedContiguousNodes[0].isLeafNode() ? 1 : m_quantizedContiguousNodes[0].getEscapeIndex(); + } + + //PCK: update the copy of the size + m_subtreeHeaderCount = m_SubtreeHeaders.size(); + + //PCK: clear m_quantizedLeafNodes and m_leafNodes, they are temporary + m_quantizedLeafNodes.clear(); + m_leafNodes.clear(); +} + + + +void btOptimizedBvh::refitPartial(btStridingMeshInterface* meshInterface,const btVector3& aabbMin,const btVector3& aabbMax) +{ + //incrementally initialize quantization values + btAssert(m_useQuantization); + + btAssert(aabbMin.getX() > m_bvhAabbMin.getX()); + btAssert(aabbMin.getY() > m_bvhAabbMin.getY()); + btAssert(aabbMin.getZ() > m_bvhAabbMin.getZ()); + + btAssert(aabbMax.getX() < m_bvhAabbMax.getX()); + btAssert(aabbMax.getY() < m_bvhAabbMax.getY()); + btAssert(aabbMax.getZ() < m_bvhAabbMax.getZ()); + + ///we should update all quantization values, using updateBvhNodes(meshInterface); + ///but we only update chunks that overlap the given aabb + + unsigned short quantizedQueryAabbMin[3]; + unsigned short quantizedQueryAabbMax[3]; + + quantizeWithClamp(&quantizedQueryAabbMin[0],aabbMin); + quantizeWithClamp(&quantizedQueryAabbMax[0],aabbMax); + + int i; + for (i=0;im_SubtreeHeaders.size();i++) + { + btBvhSubtreeInfo& subtree = m_SubtreeHeaders[i]; + + //PCK: unsigned instead of bool + unsigned overlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax); + if (overlap != 0) + { + updateBvhNodes(meshInterface,subtree.m_rootNodeIndex,subtree.m_rootNodeIndex+subtree.m_subtreeSize,i); + + subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[subtree.m_rootNodeIndex]); + } + } + +} + +///just for debugging, to visualize the individual patches/subtrees +#ifdef DEBUG_PATCH_COLORS +btVector3 color[4]= +{ + btVector3(255,0,0), + btVector3(0,255,0), + btVector3(0,0,255), + btVector3(0,255,255) +}; +#endif //DEBUG_PATCH_COLORS + + +void btOptimizedBvh::updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index) +{ + (void)index; + + btAssert(m_useQuantization); + + int nodeSubPart=0; + + //get access info to trianglemesh data + const unsigned char *vertexbase; + int numverts; + PHY_ScalarType type; + int stride; + const unsigned char *indexbase; + int indexstride; + int numfaces; + PHY_ScalarType indicestype; + meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase,numverts, type,stride,&indexbase,indexstride,numfaces,indicestype,nodeSubPart); + + btVector3 triangleVerts[3]; + btVector3 aabbMin,aabbMax; + const btVector3& meshScaling = meshInterface->getScaling(); + + int i; + for (i=endNode-1;i>=firstNode;i--) + { + + + btQuantizedBvhNode& curNode = m_quantizedContiguousNodes[i]; + if (curNode.isLeafNode()) + { + //recalc aabb from triangle data + int nodeTriangleIndex = curNode.getTriangleIndex(); + //triangles->getLockedReadOnlyVertexIndexBase(vertexBase,numVerts, + + int* gfxbase = (int*)(indexbase+nodeTriangleIndex*indexstride); + + + for (int j=2;j>=0;j--) + { + + int graphicsindex = gfxbase[j]; + btScalar* graphicsbase = (btScalar*)(vertexbase+graphicsindex*stride); +#ifdef DEBUG_PATCH_COLORS + btVector3 mycolor = color[index&3]; + graphicsbase[8] = mycolor.getX(); + graphicsbase[9] = mycolor.getY(); + graphicsbase[10] = mycolor.getZ(); +#endif //DEBUG_PATCH_COLORS + + + triangleVerts[j] = btVector3( + graphicsbase[0]*meshScaling.getX(), + graphicsbase[1]*meshScaling.getY(), + graphicsbase[2]*meshScaling.getZ()); + } + + + + aabbMin.setValue(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + aabbMax.setValue(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30)); + aabbMin.setMin(triangleVerts[0]); + aabbMax.setMax(triangleVerts[0]); + aabbMin.setMin(triangleVerts[1]); + aabbMax.setMax(triangleVerts[1]); + aabbMin.setMin(triangleVerts[2]); + aabbMax.setMax(triangleVerts[2]); + + quantizeWithClamp(&curNode.m_quantizedAabbMin[0],aabbMin); + quantizeWithClamp(&curNode.m_quantizedAabbMax[0],aabbMax); + + } else + { + //combine aabb from both children + + btQuantizedBvhNode* leftChildNode = &m_quantizedContiguousNodes[i+1]; + + btQuantizedBvhNode* rightChildNode = leftChildNode->isLeafNode() ? &m_quantizedContiguousNodes[i+2] : + &m_quantizedContiguousNodes[i+1+leftChildNode->getEscapeIndex()]; + + + { + for (int i=0;i<3;i++) + { + curNode.m_quantizedAabbMin[i] = leftChildNode->m_quantizedAabbMin[i]; + if (curNode.m_quantizedAabbMin[i]>rightChildNode->m_quantizedAabbMin[i]) + curNode.m_quantizedAabbMin[i]=rightChildNode->m_quantizedAabbMin[i]; + + curNode.m_quantizedAabbMax[i] = leftChildNode->m_quantizedAabbMax[i]; + if (curNode.m_quantizedAabbMax[i] < rightChildNode->m_quantizedAabbMax[i]) + curNode.m_quantizedAabbMax[i] = rightChildNode->m_quantizedAabbMax[i]; + } + } + } + + } + + meshInterface->unLockReadOnlyVertexBase(nodeSubPart); + + +} + +void btOptimizedBvh::setQuantizationValues(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,btScalar quantizationMargin) +{ + //enlarge the AABB to avoid division by zero when initializing the quantization values + btVector3 clampValue(quantizationMargin,quantizationMargin,quantizationMargin); + m_bvhAabbMin = bvhAabbMin - clampValue; + m_bvhAabbMax = bvhAabbMax + clampValue; + btVector3 aabbSize = m_bvhAabbMax - m_bvhAabbMin; + m_bvhQuantization = btVector3(btScalar(65535.0),btScalar(65535.0),btScalar(65535.0)) / aabbSize; +} + + +void btOptimizedBvh::refit(btStridingMeshInterface* meshInterface) +{ + if (m_useQuantization) + { + //calculate new aabb + btVector3 aabbMin,aabbMax; + meshInterface->calculateAabbBruteForce(aabbMin,aabbMax); + + setQuantizationValues(aabbMin,aabbMax); + + updateBvhNodes(meshInterface,0,m_curNodeIndex,0); + + ///now update all subtree headers + + int i; + for (i=0;i gMaxStackDepth) + gMaxStackDepth = gStackDepth; +#endif //DEBUG_TREE_BUILDING + + + int splitAxis, splitIndex, i; + int numIndices =endIndex-startIndex; + int curIndex = m_curNodeIndex; + + assert(numIndices>0); + + if (numIndices==1) + { +#ifdef DEBUG_TREE_BUILDING + gStackDepth--; +#endif //DEBUG_TREE_BUILDING + + assignInternalNodeFromLeafNode(m_curNodeIndex,startIndex); + + m_curNodeIndex++; + return; + } + //calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'. + + splitAxis = calcSplittingAxis(startIndex,endIndex); + + splitIndex = sortAndCalcSplittingIndex(startIndex,endIndex,splitAxis); + + int internalNodeIndex = m_curNodeIndex; + + setInternalNodeAabbMax(m_curNodeIndex,btVector3(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30))); + setInternalNodeAabbMin(m_curNodeIndex,btVector3(btScalar(1e30),btScalar(1e30),btScalar(1e30))); + + for (i=startIndex;im_escapeIndex; + + int leftChildNodexIndex = m_curNodeIndex; + + //build left child tree + buildTree(startIndex,splitIndex); + + int rightChildNodexIndex = m_curNodeIndex; + //build right child tree + buildTree(splitIndex,endIndex); + +#ifdef DEBUG_TREE_BUILDING + gStackDepth--; +#endif //DEBUG_TREE_BUILDING + + int escapeIndex = m_curNodeIndex - curIndex; + + if (m_useQuantization) + { + //escapeIndex is the number of nodes of this subtree + const int sizeQuantizedNode =sizeof(btQuantizedBvhNode); + const int treeSizeInBytes = escapeIndex * sizeQuantizedNode; + if (treeSizeInBytes > MAX_SUBTREE_SIZE_IN_BYTES) + { + updateSubtreeHeaders(leftChildNodexIndex,rightChildNodexIndex); + } + } + + setInternalNodeEscapeIndex(internalNodeIndex,escapeIndex); + +} + +void btOptimizedBvh::updateSubtreeHeaders(int leftChildNodexIndex,int rightChildNodexIndex) +{ + btAssert(m_useQuantization); + + btQuantizedBvhNode& leftChildNode = m_quantizedContiguousNodes[leftChildNodexIndex]; + int leftSubTreeSize = leftChildNode.isLeafNode() ? 1 : leftChildNode.getEscapeIndex(); + int leftSubTreeSizeInBytes = leftSubTreeSize * sizeof(btQuantizedBvhNode); + + btQuantizedBvhNode& rightChildNode = m_quantizedContiguousNodes[rightChildNodexIndex]; + int rightSubTreeSize = rightChildNode.isLeafNode() ? 1 : rightChildNode.getEscapeIndex(); + int rightSubTreeSizeInBytes = rightSubTreeSize * sizeof(btQuantizedBvhNode); + + if(leftSubTreeSizeInBytes <= MAX_SUBTREE_SIZE_IN_BYTES) + { + btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand(); + subtree.setAabbFromQuantizeNode(leftChildNode); + subtree.m_rootNodeIndex = leftChildNodexIndex; + subtree.m_subtreeSize = leftSubTreeSize; + } + + if(rightSubTreeSizeInBytes <= MAX_SUBTREE_SIZE_IN_BYTES) + { + btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand(); + subtree.setAabbFromQuantizeNode(rightChildNode); + subtree.m_rootNodeIndex = rightChildNodexIndex; + subtree.m_subtreeSize = rightSubTreeSize; + } + + //PCK: update the copy of the size + m_subtreeHeaderCount = m_SubtreeHeaders.size(); +} + + +int btOptimizedBvh::sortAndCalcSplittingIndex(int startIndex,int endIndex,int splitAxis) +{ + int i; + int splitIndex =startIndex; + int numIndices = endIndex - startIndex; + btScalar splitValue; + + btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.)); + for (i=startIndex;i splitValue) + { + //swap + swapLeafNodes(i,splitIndex); + splitIndex++; + } + } + + //if the splitIndex causes unbalanced trees, fix this by using the center in between startIndex and endIndex + //otherwise the tree-building might fail due to stack-overflows in certain cases. + //unbalanced1 is unsafe: it can cause stack overflows + //bool unbalanced1 = ((splitIndex==startIndex) || (splitIndex == (endIndex-1))); + + //unbalanced2 should work too: always use center (perfect balanced trees) + //bool unbalanced2 = true; + + //this should be safe too: + int rangeBalancedIndices = numIndices/3; + bool unbalanced = ((splitIndex<=(startIndex+rangeBalancedIndices)) || (splitIndex >=(endIndex-1-rangeBalancedIndices))); + + if (unbalanced) + { + splitIndex = startIndex+ (numIndices>>1); + } + + bool unbal = (splitIndex==startIndex) || (splitIndex == (endIndex)); + btAssert(!unbal); + + return splitIndex; +} + + +int btOptimizedBvh::calcSplittingAxis(int startIndex,int endIndex) +{ + int i; + + btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.)); + btVector3 variance(btScalar(0.),btScalar(0.),btScalar(0.)); + int numIndices = endIndex-startIndex; + + for (i=startIndex;im_aabbMinOrg,rootNode->m_aabbMaxOrg); + isLeafNode = rootNode->m_escapeIndex == -1; + + //PCK: unsigned instead of bool + if (isLeafNode && (aabbOverlap != 0)) + { + nodeCallback->processNode(rootNode->m_subPart,rootNode->m_triangleIndex); + } + + //PCK: unsigned instead of bool + if ((aabbOverlap != 0) || isLeafNode) + { + rootNode++; + curIndex++; + } else + { + escapeIndex = rootNode->m_escapeIndex; + rootNode += escapeIndex; + curIndex += escapeIndex; + } + } + if (maxIterations < walkIterations) + maxIterations = walkIterations; + +} + +/* +///this was the original recursive traversal, before we optimized towards stackless traversal +void btOptimizedBvh::walkTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const +{ + bool isLeafNode, aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax); + if (aabbOverlap) + { + isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild); + if (isLeafNode) + { + nodeCallback->processNode(rootNode); + } else + { + walkTree(rootNode->m_leftChild,nodeCallback,aabbMin,aabbMax); + walkTree(rootNode->m_rightChild,nodeCallback,aabbMin,aabbMax); + } + } + +} +*/ + +void btOptimizedBvh::walkRecursiveQuantizedTreeAgainstQueryAabb(const btQuantizedBvhNode* currentNode,btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const +{ + btAssert(m_useQuantization); + + bool isLeafNode; + //PCK: unsigned instead of bool + unsigned aabbOverlap; + + //PCK: unsigned instead of bool + aabbOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,currentNode->m_quantizedAabbMin,currentNode->m_quantizedAabbMax); + isLeafNode = currentNode->isLeafNode(); + + //PCK: unsigned instead of bool + if (aabbOverlap != 0) + { + if (isLeafNode) + { + nodeCallback->processNode(0,currentNode->getTriangleIndex()); + } else + { + //process left and right children + const btQuantizedBvhNode* leftChildNode = currentNode+1; + walkRecursiveQuantizedTreeAgainstQueryAabb(leftChildNode,nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax); + + const btQuantizedBvhNode* rightChildNode = leftChildNode->isLeafNode() ? leftChildNode+1:leftChildNode+leftChildNode->getEscapeIndex(); + walkRecursiveQuantizedTreeAgainstQueryAabb(rightChildNode,nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax); + } + } +} + + + + + + + +void btOptimizedBvh::walkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,int startNodeIndex,int endNodeIndex) const +{ + btAssert(m_useQuantization); + + int curIndex = startNodeIndex; + int walkIterations = 0; + int subTreeSize = endNodeIndex - startNodeIndex; + + const btQuantizedBvhNode* rootNode = &m_quantizedContiguousNodes[startNodeIndex]; + int escapeIndex; + + bool isLeafNode; + //PCK: unsigned instead of bool + unsigned aabbOverlap; + + while (curIndex < endNodeIndex) + { + +//#define VISUALLY_ANALYZE_BVH 1 +#ifdef VISUALLY_ANALYZE_BVH + //some code snippet to debugDraw aabb, to visually analyze bvh structure + static int drawPatch = 0; + //need some global access to a debugDrawer + extern btIDebugDraw* debugDrawerPtr; + if (curIndex==drawPatch) + { + btVector3 aabbMin,aabbMax; + aabbMin = unQuantize(rootNode->m_quantizedAabbMin); + aabbMax = unQuantize(rootNode->m_quantizedAabbMax); + btVector3 color(1,0,0); + debugDrawerPtr->drawAabb(aabbMin,aabbMax,color); + } +#endif//VISUALLY_ANALYZE_BVH + + //catch bugs in tree data + assert (walkIterations < subTreeSize); + + walkIterations++; + //PCK: unsigned instead of bool + aabbOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax); + isLeafNode = rootNode->isLeafNode(); + + if (isLeafNode && aabbOverlap) + { + nodeCallback->processNode(0,rootNode->getTriangleIndex()); + } + + //PCK: unsigned instead of bool + if ((aabbOverlap != 0) || isLeafNode) + { + rootNode++; + curIndex++; + } else + { + escapeIndex = rootNode->getEscapeIndex(); + rootNode += escapeIndex; + curIndex += escapeIndex; + } + } + if (maxIterations < walkIterations) + maxIterations = walkIterations; + +} + +//This traversal can be called from Playstation 3 SPU +void btOptimizedBvh::walkStacklessQuantizedTreeCacheFriendly(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const +{ + btAssert(m_useQuantization); + + int i; + + + for (i=0;im_SubtreeHeaders.size();i++) + { + const btBvhSubtreeInfo& subtree = m_SubtreeHeaders[i]; + + //PCK: unsigned instead of bool + unsigned overlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax); + if (overlap != 0) + { + walkStacklessQuantizedTree(nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax, + subtree.m_rootNodeIndex, + subtree.m_rootNodeIndex+subtree.m_subtreeSize); + } + } +} + + + + +void btOptimizedBvh::reportSphereOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const +{ + (void)nodeCallback; + (void)aabbMin; + (void)aabbMax; + //not yet, please use aabb + btAssert(0); +} + + + + +btVector3 btOptimizedBvh::unQuantize(const unsigned short* vecIn) const +{ + btVector3 vecOut; + vecOut.setValue( + (btScalar)(vecIn[0]) / (m_bvhQuantization.getX()), + (btScalar)(vecIn[1]) / (m_bvhQuantization.getY()), + (btScalar)(vecIn[2]) / (m_bvhQuantization.getZ())); + vecOut += m_bvhAabbMin; + return vecOut; +} + + +void btOptimizedBvh::swapLeafNodes(int i,int splitIndex) +{ + if (m_useQuantization) + { + btQuantizedBvhNode tmp = m_quantizedLeafNodes[i]; + m_quantizedLeafNodes[i] = m_quantizedLeafNodes[splitIndex]; + m_quantizedLeafNodes[splitIndex] = tmp; + } else + { + btOptimizedBvhNode tmp = m_leafNodes[i]; + m_leafNodes[i] = m_leafNodes[splitIndex]; + m_leafNodes[splitIndex] = tmp; + } +} + +void btOptimizedBvh::assignInternalNodeFromLeafNode(int internalNode,int leafNodeIndex) +{ + if (m_useQuantization) + { + m_quantizedContiguousNodes[internalNode] = m_quantizedLeafNodes[leafNodeIndex]; + } else + { + m_contiguousNodes[internalNode] = m_leafNodes[leafNodeIndex]; + } +} + +//PCK: include +#include + +//PCK: consts +static const unsigned BVH_ALIGNMENT = 16; +static const unsigned BVH_ALIGNMENT_MASK = BVH_ALIGNMENT-1; + +static const unsigned BVH_ALIGNMENT_BLOCKS = 2; + + + +unsigned int btOptimizedBvh::getAlignmentSerializationPadding() +{ + return BVH_ALIGNMENT_BLOCKS * BVH_ALIGNMENT; +} + +unsigned btOptimizedBvh::calculateSerializeBufferSize() +{ + unsigned baseSize = sizeof(btOptimizedBvh) + getAlignmentSerializationPadding(); + baseSize += sizeof(btBvhSubtreeInfo) * m_subtreeHeaderCount; + if (m_useQuantization) + { + return baseSize + m_curNodeIndex * sizeof(btQuantizedBvhNode); + } + return baseSize + m_curNodeIndex * sizeof(btOptimizedBvhNode); +} + +bool btOptimizedBvh::serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) +{ + assert(m_subtreeHeaderCount == m_SubtreeHeaders.size()); + m_subtreeHeaderCount = m_SubtreeHeaders.size(); + +/* if (i_dataBufferSize < calculateSerializeBufferSize() || o_alignedDataBuffer == NULL || (((unsigned)o_alignedDataBuffer & BVH_ALIGNMENT_MASK) != 0)) + { + ///check alignedment for buffer? + btAssert(0); + return false; + } +*/ + + btOptimizedBvh *targetBvh = (btOptimizedBvh *)o_alignedDataBuffer; + + // construct the class so the virtual function table, etc will be set up + // Also, m_leafNodes and m_quantizedLeafNodes will be initialized to default values by the constructor + new (targetBvh) btOptimizedBvh; + + if (i_swapEndian) + { + targetBvh->m_curNodeIndex = btSwapEndian(m_curNodeIndex); + + + btSwapVector3Endian(m_bvhAabbMin,targetBvh->m_bvhAabbMin); + btSwapVector3Endian(m_bvhAabbMax,targetBvh->m_bvhAabbMax); + btSwapVector3Endian(m_bvhQuantization,targetBvh->m_bvhQuantization); + + targetBvh->m_traversalMode = (btTraversalMode)btSwapEndian(m_traversalMode); + targetBvh->m_subtreeHeaderCount = btSwapEndian(m_subtreeHeaderCount); + } + else + { + targetBvh->m_curNodeIndex = m_curNodeIndex; + targetBvh->m_bvhAabbMin = m_bvhAabbMin; + targetBvh->m_bvhAabbMax = m_bvhAabbMax; + targetBvh->m_bvhQuantization = m_bvhQuantization; + targetBvh->m_traversalMode = m_traversalMode; + targetBvh->m_subtreeHeaderCount = m_subtreeHeaderCount; + } + + targetBvh->m_useQuantization = m_useQuantization; + + unsigned char *nodeData = (unsigned char *)targetBvh; + nodeData += sizeof(btOptimizedBvh); + + unsigned sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK; + nodeData += sizeToAdd; + + int nodeCount = m_curNodeIndex; + + if (m_useQuantization) + { + targetBvh->m_quantizedContiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount); + + if (i_swapEndian) + { + for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) + { + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0]); + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1]); + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2]); + + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0]); + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1]); + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2]); + + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex); + } + } + else + { + for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) + { + + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0]; + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1]; + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2]; + + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0]; + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1]; + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2]; + + targetBvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex; + + + } + } + nodeData += sizeof(btQuantizedBvhNode) * nodeCount; + } + else + { + targetBvh->m_contiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount); + + if (i_swapEndian) + { + for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) + { + btSwapVector3Endian(m_contiguousNodes[nodeIndex].m_aabbMinOrg, targetBvh->m_contiguousNodes[nodeIndex].m_aabbMinOrg); + btSwapVector3Endian(m_contiguousNodes[nodeIndex].m_aabbMaxOrg, targetBvh->m_contiguousNodes[nodeIndex].m_aabbMaxOrg); + + targetBvh->m_contiguousNodes[nodeIndex].m_escapeIndex = btSwapEndian(m_contiguousNodes[nodeIndex].m_escapeIndex); + targetBvh->m_contiguousNodes[nodeIndex].m_subPart = btSwapEndian(m_contiguousNodes[nodeIndex].m_subPart); + targetBvh->m_contiguousNodes[nodeIndex].m_triangleIndex = btSwapEndian(m_contiguousNodes[nodeIndex].m_triangleIndex); + } + } + else + { + for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) + { + targetBvh->m_contiguousNodes[nodeIndex].m_aabbMinOrg = m_contiguousNodes[nodeIndex].m_aabbMinOrg; + targetBvh->m_contiguousNodes[nodeIndex].m_aabbMaxOrg = m_contiguousNodes[nodeIndex].m_aabbMaxOrg; + + targetBvh->m_contiguousNodes[nodeIndex].m_escapeIndex = m_contiguousNodes[nodeIndex].m_escapeIndex; + targetBvh->m_contiguousNodes[nodeIndex].m_subPart = m_contiguousNodes[nodeIndex].m_subPart; + targetBvh->m_contiguousNodes[nodeIndex].m_triangleIndex = m_contiguousNodes[nodeIndex].m_triangleIndex; + } + } + nodeData += sizeof(btOptimizedBvhNode) * nodeCount; + } + + sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK; + nodeData += sizeToAdd; + + // Now serialize the subtree headers + targetBvh->m_SubtreeHeaders.initializeFromBuffer(nodeData, m_subtreeHeaderCount, m_subtreeHeaderCount); + if (i_swapEndian) + { + for (int i = 0; i < m_subtreeHeaderCount; i++) + { + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMin[0]); + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMin[1]); + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMin[2]); + + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMax[0]); + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMax[1]); + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMax[2]); + + targetBvh->m_SubtreeHeaders[i].m_rootNodeIndex = btSwapEndian(m_SubtreeHeaders[i].m_rootNodeIndex); + targetBvh->m_SubtreeHeaders[i].m_subtreeSize = btSwapEndian(m_SubtreeHeaders[i].m_subtreeSize); + } + } + else + { + for (int i = 0; i < m_subtreeHeaderCount; i++) + { + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0] = (m_SubtreeHeaders[i].m_quantizedAabbMin[0]); + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1] = (m_SubtreeHeaders[i].m_quantizedAabbMin[1]); + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2] = (m_SubtreeHeaders[i].m_quantizedAabbMin[2]); + + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0] = (m_SubtreeHeaders[i].m_quantizedAabbMax[0]); + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1] = (m_SubtreeHeaders[i].m_quantizedAabbMax[1]); + targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2] = (m_SubtreeHeaders[i].m_quantizedAabbMax[2]); + + targetBvh->m_SubtreeHeaders[i].m_rootNodeIndex = (m_SubtreeHeaders[i].m_rootNodeIndex); + targetBvh->m_SubtreeHeaders[i].m_subtreeSize = (m_SubtreeHeaders[i].m_subtreeSize); + targetBvh->m_SubtreeHeaders[i] = m_SubtreeHeaders[i]; + } + } + + nodeData += sizeof(btBvhSubtreeInfo) * m_subtreeHeaderCount; + + return true; +} + +btOptimizedBvh *btOptimizedBvh::deSerializeInPlace(void *i_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) +{ + + if (i_alignedDataBuffer == NULL)// || (((unsigned)i_alignedDataBuffer & BVH_ALIGNMENT_MASK) != 0)) + { + return NULL; + } + btOptimizedBvh *bvh = (btOptimizedBvh *)i_alignedDataBuffer; + + if (i_swapEndian) + { + bvh->m_curNodeIndex = btSwapEndian(bvh->m_curNodeIndex); + + btUnSwapVector3Endian(bvh->m_bvhAabbMin); + btUnSwapVector3Endian(bvh->m_bvhAabbMax); + btUnSwapVector3Endian(bvh->m_bvhQuantization); + + bvh->m_traversalMode = (btTraversalMode)btSwapEndian(bvh->m_traversalMode); + bvh->m_subtreeHeaderCount = btSwapEndian(bvh->m_subtreeHeaderCount); + } + + int calculatedBufSize = bvh->calculateSerializeBufferSize(); + btAssert(calculatedBufSize <= i_dataBufferSize); + + if (calculatedBufSize > i_dataBufferSize) + { + return NULL; + } + + unsigned char *nodeData = (unsigned char *)bvh; + nodeData += sizeof(btOptimizedBvh); + + unsigned sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK; + nodeData += sizeToAdd; + + int nodeCount = bvh->m_curNodeIndex; + + // Must call placement new to fill in virtual function table, etc, but we don't want to overwrite most data, so call a special version of the constructor + // Also, m_leafNodes and m_quantizedLeafNodes will be initialized to default values by the constructor + new (bvh) btOptimizedBvh(*bvh, false); + + if (bvh->m_useQuantization) + { + bvh->m_quantizedContiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount); + + if (i_swapEndian) + { + for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) + { + bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0]); + bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1]); + bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2]); + + bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0]); + bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1]); + bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2]); + + bvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex); + } + } + nodeData += sizeof(btQuantizedBvhNode) * nodeCount; + } + else + { + bvh->m_contiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount); + + if (i_swapEndian) + { + for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) + { + btUnSwapVector3Endian(bvh->m_contiguousNodes[nodeIndex].m_aabbMinOrg); + btUnSwapVector3Endian(bvh->m_contiguousNodes[nodeIndex].m_aabbMaxOrg); + + bvh->m_contiguousNodes[nodeIndex].m_escapeIndex = btSwapEndian(bvh->m_contiguousNodes[nodeIndex].m_escapeIndex); + bvh->m_contiguousNodes[nodeIndex].m_subPart = btSwapEndian(bvh->m_contiguousNodes[nodeIndex].m_subPart); + bvh->m_contiguousNodes[nodeIndex].m_triangleIndex = btSwapEndian(bvh->m_contiguousNodes[nodeIndex].m_triangleIndex); + } + } + nodeData += sizeof(btOptimizedBvhNode) * nodeCount; + } + + sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK; + nodeData += sizeToAdd; + + // Now serialize the subtree headers + bvh->m_SubtreeHeaders.initializeFromBuffer(nodeData, bvh->m_subtreeHeaderCount, bvh->m_subtreeHeaderCount); + if (i_swapEndian) + { + for (int i = 0; i < bvh->m_subtreeHeaderCount; i++) + { + bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0]); + bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1]); + bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2]); + + bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0]); + bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1]); + bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2]); + + bvh->m_SubtreeHeaders[i].m_rootNodeIndex = btSwapEndian(bvh->m_SubtreeHeaders[i].m_rootNodeIndex); + bvh->m_SubtreeHeaders[i].m_subtreeSize = btSwapEndian(bvh->m_SubtreeHeaders[i].m_subtreeSize); + } + } + + return bvh; +} + +// Constructor that prevents btVector3's default constructor from being called +btOptimizedBvh::btOptimizedBvh(btOptimizedBvh &self, bool ownsMemory) : +m_bvhAabbMin(self.m_bvhAabbMin), +m_bvhAabbMax(self.m_bvhAabbMax), +m_bvhQuantization(self.m_bvhQuantization) +{ + +} + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.h b/src/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.h new file mode 100644 index 000000000..bcacdbe58 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.h @@ -0,0 +1,393 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef OPTIMIZED_BVH_H +#define OPTIMIZED_BVH_H + + + +#include "LinearMath/btVector3.h" +#include "LinearMath/btAlignedAllocator.h" + + +//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/vclrf__m128.asp + + + +class btStridingMeshInterface; + +//Note: currently we have 16 bytes per quantized node +#define MAX_SUBTREE_SIZE_IN_BYTES 2048 + + +///btQuantizedBvhNode is a compressed aabb node, 16 bytes. +///Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range). +ATTRIBUTE_ALIGNED16 (struct) btQuantizedBvhNode +{ + BT_DECLARE_ALIGNED_ALLOCATOR(); + + //12 bytes + unsigned short int m_quantizedAabbMin[3]; + unsigned short int m_quantizedAabbMax[3]; + //4 bytes + int m_escapeIndexOrTriangleIndex; + + bool isLeafNode() const + { + //skipindex is negative (internal node), triangleindex >=0 (leafnode) + return (m_escapeIndexOrTriangleIndex >= 0); + } + int getEscapeIndex() const + { + btAssert(!isLeafNode()); + return -m_escapeIndexOrTriangleIndex; + } + int getTriangleIndex() const + { + btAssert(isLeafNode()); + return m_escapeIndexOrTriangleIndex; + } +} +; + +/// btOptimizedBvhNode contains both internal and leaf node information. +/// Total node size is 44 bytes / node. You can use the compressed version of 16 bytes. +ATTRIBUTE_ALIGNED16 (struct) btOptimizedBvhNode +{ + BT_DECLARE_ALIGNED_ALLOCATOR(); + + //32 bytes + btVector3 m_aabbMinOrg; + btVector3 m_aabbMaxOrg; + + //4 + int m_escapeIndex; + + //8 + //for child nodes + int m_subPart; + int m_triangleIndex; + int m_padding[5];//bad, due to alignment + + +}; + + +///btBvhSubtreeInfo provides info to gather a subtree of limited size +ATTRIBUTE_ALIGNED16(class) btBvhSubtreeInfo +{ +public: + BT_DECLARE_ALIGNED_ALLOCATOR(); + + //12 bytes + unsigned short int m_quantizedAabbMin[3]; + unsigned short int m_quantizedAabbMax[3]; + //4 bytes, points to the root of the subtree + int m_rootNodeIndex; + //4 bytes + int m_subtreeSize; + int m_padding[3]; + + btBvhSubtreeInfo() + { + //memset(&m_padding[0], 0, sizeof(m_padding)); + } + + + void setAabbFromQuantizeNode(const btQuantizedBvhNode& quantizedNode) + { + m_quantizedAabbMin[0] = quantizedNode.m_quantizedAabbMin[0]; + m_quantizedAabbMin[1] = quantizedNode.m_quantizedAabbMin[1]; + m_quantizedAabbMin[2] = quantizedNode.m_quantizedAabbMin[2]; + m_quantizedAabbMax[0] = quantizedNode.m_quantizedAabbMax[0]; + m_quantizedAabbMax[1] = quantizedNode.m_quantizedAabbMax[1]; + m_quantizedAabbMax[2] = quantizedNode.m_quantizedAabbMax[2]; + } +} +; + + +class btNodeOverlapCallback +{ +public: + virtual ~btNodeOverlapCallback() {}; + + virtual void processNode(int subPart, int triangleIndex) = 0; +}; + +#include "LinearMath/btAlignedAllocator.h" +#include "LinearMath/btAlignedObjectArray.h" + + + +///for code readability: +typedef btAlignedObjectArray NodeArray; +typedef btAlignedObjectArray QuantizedNodeArray; +typedef btAlignedObjectArray BvhSubtreeInfoArray; + + +///OptimizedBvh store an AABB tree that can be quickly traversed on CPU (and SPU,GPU in future) +ATTRIBUTE_ALIGNED16(class) btOptimizedBvh +{ + NodeArray m_leafNodes; + NodeArray m_contiguousNodes; + + QuantizedNodeArray m_quantizedLeafNodes; + + QuantizedNodeArray m_quantizedContiguousNodes; + + int m_curNodeIndex; + + + //quantization data + bool m_useQuantization; + btVector3 m_bvhAabbMin; + btVector3 m_bvhAabbMax; + btVector3 m_bvhQuantization; +public: + BT_DECLARE_ALIGNED_ALLOCATOR(); + + enum btTraversalMode + { + TRAVERSAL_STACKLESS = 0, + TRAVERSAL_STACKLESS_CACHE_FRIENDLY, + TRAVERSAL_RECURSIVE + }; +protected: + + btTraversalMode m_traversalMode; + + BvhSubtreeInfoArray m_SubtreeHeaders; + + //This is only used for serialization so we don't have to add serialization directly to btAlignedObjectArray + int m_subtreeHeaderCount; + + + ///two versions, one for quantized and normal nodes. This allows code-reuse while maintaining readability (no template/macro!) + ///this might be refactored into a virtual, it is usually not calculated at run-time + void setInternalNodeAabbMin(int nodeIndex, const btVector3& aabbMin) + { + if (m_useQuantization) + { + quantizeWithClamp(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] ,aabbMin); + } else + { + m_contiguousNodes[nodeIndex].m_aabbMinOrg = aabbMin; + + } + } + void setInternalNodeAabbMax(int nodeIndex,const btVector3& aabbMax) + { + if (m_useQuantization) + { + quantizeWithClamp(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0],aabbMax); + } else + { + m_contiguousNodes[nodeIndex].m_aabbMaxOrg = aabbMax; + } + } + + btVector3 getAabbMin(int nodeIndex) const + { + if (m_useQuantization) + { + return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMin[0]); + } + //non-quantized + return m_leafNodes[nodeIndex].m_aabbMinOrg; + + } + btVector3 getAabbMax(int nodeIndex) const + { + if (m_useQuantization) + { + return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMax[0]); + } + //non-quantized + return m_leafNodes[nodeIndex].m_aabbMaxOrg; + + } + + void setQuantizationValues(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,btScalar quantizationMargin=btScalar(1.0)); + + void setInternalNodeEscapeIndex(int nodeIndex, int escapeIndex) + { + if (m_useQuantization) + { + m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = -escapeIndex; + } + else + { + m_contiguousNodes[nodeIndex].m_escapeIndex = escapeIndex; + } + + } + + void mergeInternalNodeAabb(int nodeIndex,const btVector3& newAabbMin,const btVector3& newAabbMax) + { + if (m_useQuantization) + { + unsigned short int quantizedAabbMin[3]; + unsigned short int quantizedAabbMax[3]; + quantizeWithClamp(quantizedAabbMin,newAabbMin); + quantizeWithClamp(quantizedAabbMax,newAabbMax); + for (int i=0;i<3;i++) + { + if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] > quantizedAabbMin[i]) + m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] = quantizedAabbMin[i]; + + if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] < quantizedAabbMax[i]) + m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] = quantizedAabbMax[i]; + + } + } else + { + //non-quantized + m_contiguousNodes[nodeIndex].m_aabbMinOrg.setMin(newAabbMin); + m_contiguousNodes[nodeIndex].m_aabbMaxOrg.setMax(newAabbMax); + } + } + + void swapLeafNodes(int firstIndex,int secondIndex); + + void assignInternalNodeFromLeafNode(int internalNode,int leafNodeIndex); + +protected: + + + + void buildTree (int startIndex,int endIndex); + + int calcSplittingAxis(int startIndex,int endIndex); + + int sortAndCalcSplittingIndex(int startIndex,int endIndex,int splitAxis); + + void walkStacklessTree(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; + + void walkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,int startNodeIndex,int endNodeIndex) const; + + ///tree traversal designed for small-memory processors like PS3 SPU + void walkStacklessQuantizedTreeCacheFriendly(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const; + + ///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal + void walkRecursiveQuantizedTreeAgainstQueryAabb(const btQuantizedBvhNode* currentNode,btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const; + + ///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal + void walkRecursiveQuantizedTreeAgainstQuantizedTree(const btQuantizedBvhNode* treeNodeA,const btQuantizedBvhNode* treeNodeB,btNodeOverlapCallback* nodeCallback) const; + + +#define USE_BANCHLESS 1 +#ifdef USE_BANCHLESS + //This block replaces the block below and uses no branches, and replaces the 8 bit return with a 32 bit return for improved performance (~3x on XBox 360) + SIMD_FORCE_INLINE unsigned testQuantizedAabbAgainstQuantizedAabb(unsigned short int* aabbMin1,unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2) const + { + return btSelect((unsigned)((aabbMin1[0] <= aabbMax2[0]) & (aabbMax1[0] >= aabbMin2[0]) + & (aabbMin1[2] <= aabbMax2[2]) & (aabbMax1[2] >= aabbMin2[2]) + & (aabbMin1[1] <= aabbMax2[1]) & (aabbMax1[1] >= aabbMin2[1])), + 1, 0); + } +#else + SIMD_FORCE_INLINE bool testQuantizedAabbAgainstQuantizedAabb(unsigned short int* aabbMin1,unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2) const + { + bool overlap = true; + overlap = (aabbMin1[0] > aabbMax2[0] || aabbMax1[0] < aabbMin2[0]) ? false : overlap; + overlap = (aabbMin1[2] > aabbMax2[2] || aabbMax1[2] < aabbMin2[2]) ? false : overlap; + overlap = (aabbMin1[1] > aabbMax2[1] || aabbMax1[1] < aabbMin2[1]) ? false : overlap; + return overlap; + } +#endif //USE_BANCHLESS + + void updateSubtreeHeaders(int leftChildNodexIndex,int rightChildNodexIndex); + +public: + btOptimizedBvh(); + + virtual ~btOptimizedBvh(); + + void build(btStridingMeshInterface* triangles,bool useQuantizedAabbCompression, const btVector3& bvhAabbMin, const btVector3& bvhAabbMax); + + void reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; + + void reportSphereOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; + + SIMD_FORCE_INLINE void quantizeWithClamp(unsigned short* out, const btVector3& point) const + { + + btAssert(m_useQuantization); + + btVector3 clampedPoint(point); + clampedPoint.setMax(m_bvhAabbMin); + clampedPoint.setMin(m_bvhAabbMax); + + btVector3 v = (clampedPoint - m_bvhAabbMin) * m_bvhQuantization; + out[0] = (unsigned short)(v.getX()+0.5f); + out[1] = (unsigned short)(v.getY()+0.5f); + out[2] = (unsigned short)(v.getZ()+0.5f); + } + + + btVector3 unQuantize(const unsigned short* vecIn) const; + + ///setTraversalMode let's you choose between stackless, recursive or stackless cache friendly tree traversal. Note this is only implemented for quantized trees. + void setTraversalMode(btTraversalMode traversalMode) + { + m_traversalMode = traversalMode; + } + + void refit(btStridingMeshInterface* triangles); + + void refitPartial(btStridingMeshInterface* triangles,const btVector3& aabbMin, const btVector3& aabbMax); + + void updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index); + + + SIMD_FORCE_INLINE QuantizedNodeArray& getQuantizedNodeArray() + { + return m_quantizedContiguousNodes; + } + + SIMD_FORCE_INLINE BvhSubtreeInfoArray& getSubtreeInfoArray() + { + return m_SubtreeHeaders; + } + + /////Calculate space needed to store BVH for serialization + unsigned calculateSerializeBufferSize(); + + /// Data buffer MUST be 16 byte aligned + bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian); + + ///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place' + static btOptimizedBvh *deSerializeInPlace(void *i_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian); + + static unsigned int getAlignmentSerializationPadding(); + + SIMD_FORCE_INLINE bool isQuantized() + { + return m_useQuantization; + } + +private: + // Special "copy" constructor that allows for in-place deserialization + // Prevents btVector3's default constructor from being called, but doesn't inialize much else + // ownsMemory should most likely be false if deserializing, and if you are not, don't call this (it also changes the function signature, which we need) + btOptimizedBvh(btOptimizedBvh &other, bool ownsMemory); + +} +; + + +#endif //OPTIMIZED_BVH_H + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp new file mode 100644 index 000000000..30323deb3 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp @@ -0,0 +1,148 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +btPolyhedralConvexShape::btPolyhedralConvexShape() +:m_localAabbMin(1,1,1), +m_localAabbMax(-1,-1,-1), +m_isLocalAabbValid(false), +m_optionalHull(0) +{ + +} + + + +btVector3 btPolyhedralConvexShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const +{ + int i; + btVector3 supVec(0,0,0); + + btScalar maxDot(btScalar(-1e30)); + + btVector3 vec = vec0; + btScalar lenSqr = vec.length2(); + if (lenSqr < btScalar(0.0001)) + { + vec.setValue(1,0,0); + } else + { + btScalar rlen = btScalar(1.) / btSqrt(lenSqr ); + vec *= rlen; + } + + btVector3 vtx; + btScalar newDot; + + for (i=0;i maxDot) + { + maxDot = newDot; + supVec = vtx; + } + } + + return supVec; + +} + +void btPolyhedralConvexShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + int i; + + btVector3 vtx; + btScalar newDot; + + for (i=0;i supportVerticesOut[j][3]) + { + //WARNING: don't swap next lines, the w component would get overwritten! + supportVerticesOut[j] = vtx; + supportVerticesOut[j][3] = newDot; + } + } + } +} + + + +void btPolyhedralConvexShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const +{ + //not yet, return box inertia + + btScalar margin = getMargin(); + + btTransform ident; + ident.setIdentity(); + btVector3 aabbMin,aabbMax; + getAabb(ident,aabbMin,aabbMax); + btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5); + + btScalar lx=btScalar(2.)*(halfExtents.x()+margin); + btScalar ly=btScalar(2.)*(halfExtents.y()+margin); + btScalar lz=btScalar(2.)*(halfExtents.z()+margin); + const btScalar x2 = lx*lx; + const btScalar y2 = ly*ly; + const btScalar z2 = lz*lz; + const btScalar scaledmass = mass * btScalar(0.08333333); + + inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2)); + +} + + + +void btPolyhedralConvexShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const +{ + getNonvirtualAabb(trans,aabbMin,aabbMax,getMargin()); +} + + + + +void btPolyhedralConvexShape::recalcLocalAabb() +{ + m_isLocalAabbValid = true; + + for (int i=0;i<3;i++) + { + btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.)); + vec[i] = btScalar(1.); + btVector3 tmp = localGetSupportingVertex(vec); + m_localAabbMax[i] = tmp[i]+m_collisionMargin; + vec[i] = btScalar(-1.); + tmp = localGetSupportingVertex(vec); + m_localAabbMin[i] = tmp[i]-m_collisionMargin; + } +} + + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h new file mode 100644 index 000000000..9d46b991e --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h @@ -0,0 +1,93 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BU_SHAPE +#define BU_SHAPE + +#include "LinearMath/btPoint3.h" +#include "LinearMath/btMatrix3x3.h" +#include "btConvexInternalShape.h" + + +///PolyhedralConvexShape is an interface class for feature based (vertex/edge/face) convex shapes. +class btPolyhedralConvexShape : public btConvexInternalShape +{ + +protected: + btVector3 m_localAabbMin; + btVector3 m_localAabbMax; + bool m_isLocalAabbValid; + +public: + + btPolyhedralConvexShape(); + + //brute force implementations + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const; + + + inline void getNonvirtualAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax, btScalar margin) const + { + + //lazy evaluation of local aabb + btAssert(m_isLocalAabbValid); + + btAssert(m_localAabbMin.getX() <= m_localAabbMax.getX()); + btAssert(m_localAabbMin.getY() <= m_localAabbMax.getY()); + btAssert(m_localAabbMin.getZ() <= m_localAabbMax.getZ()); + + + btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin); + btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin); + + btMatrix3x3 abs_b = trans.getBasis().absolute(); + + btPoint3 center = trans(localCenter); + + btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents), + abs_b[1].dot(localHalfExtents), + abs_b[2].dot(localHalfExtents)); + extent += btVector3(margin,margin,margin); + + aabbMin = center - extent; + aabbMax = center + extent; + + + } + + + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + + void recalcLocalAabb(); + + virtual int getNumVertices() const = 0 ; + virtual int getNumEdges() const = 0; + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const = 0; + virtual void getVertex(int i,btPoint3& vtx) const = 0; + virtual int getNumPlanes() const = 0; + virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const = 0; +// virtual int getIndex(int i) const = 0 ; + + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const = 0; + + /// optional Hull is for optional Separating Axis Test Hull collision detection, see Hull.cpp + class Hull* m_optionalHull; + +}; + +#endif //BU_SHAPE diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btSphereShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btSphereShape.cpp new file mode 100644 index 000000000..15cfe432e --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btSphereShape.cpp @@ -0,0 +1,77 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btSphereShape.h" +#include "BulletCollision/CollisionShapes/btCollisionMargin.h" + +#include "LinearMath/btQuaternion.h" + + +btSphereShape ::btSphereShape (btScalar radius) +{ + m_implicitShapeDimensions.setX(radius); +} + +btVector3 btSphereShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const +{ + (void)vec; + return btVector3(btScalar(0.),btScalar(0.),btScalar(0.)); +} + +void btSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + (void)vectors; + + for (int i=0;iprocessTriangle(triangle,0,0); + + triangle[0] = projectedCenter - tangentDir0*radius - tangentDir1*radius; + triangle[1] = projectedCenter - tangentDir0*radius + tangentDir1*radius; + triangle[2] = projectedCenter + tangentDir0*radius + tangentDir1*radius; + + callback->processTriangle(triangle,0,1); + +} + +void btStaticPlaneShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const +{ + (void)mass; + + //moving concave objects not supported + + inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); +} + +void btStaticPlaneShape::setLocalScaling(const btVector3& scaling) +{ + m_localScaling = scaling; +} +const btVector3& btStaticPlaneShape::getLocalScaling() const +{ + return m_localScaling; +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h new file mode 100644 index 000000000..0cbce3abd --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h @@ -0,0 +1,61 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef STATIC_PLANE_SHAPE_H +#define STATIC_PLANE_SHAPE_H + +#include "btConcaveShape.h" + + +///StaticPlaneShape simulates an 'infinite' plane by dynamically reporting triangles approximated by intersection of the plane with the AABB. +///Assumed is that the other objects is not also infinite, so a reasonable sized AABB. +class btStaticPlaneShape : public btConcaveShape +{ +protected: + btVector3 m_localAabbMin; + btVector3 m_localAabbMax; + + btVector3 m_planeNormal; + btScalar m_planeConstant; + btVector3 m_localScaling; + +public: + btStaticPlaneShape(const btVector3& planeNormal,btScalar planeConstant); + + virtual ~btStaticPlaneShape(); + + + virtual int getShapeType() const + { + return STATIC_PLANE_PROXYTYPE; + } + + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + + virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const; + + virtual void setLocalScaling(const btVector3& scaling); + virtual const btVector3& getLocalScaling() const; + + + //debugging + virtual const char* getName()const {return "STATICPLANE";} + + +}; + +#endif //STATIC_PLANE_SHAPE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp new file mode 100644 index 000000000..3129b7c83 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp @@ -0,0 +1,124 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btStridingMeshInterface.h" + +btStridingMeshInterface::~btStridingMeshInterface() +{ + +} + + +void btStridingMeshInterface::InternalProcessAllTriangles(btInternalTriangleIndexCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const +{ + (void)aabbMin; + (void)aabbMax; + int numtotalphysicsverts = 0; + int part,graphicssubparts = getNumSubParts(); + const unsigned char * vertexbase; + const unsigned char * indexbase; + int indexstride; + PHY_ScalarType type; + PHY_ScalarType gfxindextype; + int stride,numverts,numtriangles; + int gfxindex; + btVector3 triangle[3]; + btScalar* graphicsbase; + + btVector3 meshScaling = getScaling(); + + ///if the number of parts is big, the performance might drop due to the innerloop switch on indextype + for (part=0;partinternalProcessTriangleIndex(triangle,part,gfxindex); + } + break; + } + case PHY_SHORT: + { + for (gfxindex=0;gfxindexinternalProcessTriangleIndex(triangle,part,gfxindex); + } + break; + } + default: + btAssert((gfxindextype == PHY_INTEGER) || (gfxindextype == PHY_SHORT)); + } + + unLockReadOnlyVertexBase(part); + } +} + +void btStridingMeshInterface::calculateAabbBruteForce(btVector3& aabbMin,btVector3& aabbMax) +{ + + struct AabbCalculationCallback : public btInternalTriangleIndexCallback + { + btVector3 m_aabbMin; + btVector3 m_aabbMax; + + AabbCalculationCallback() + { + m_aabbMin.setValue(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + m_aabbMax.setValue(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30)); + } + + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + { + (void)partId; + (void)triangleIndex; + + m_aabbMin.setMin(triangle[0]); + m_aabbMax.setMax(triangle[0]); + m_aabbMin.setMin(triangle[1]); + m_aabbMax.setMax(triangle[1]); + m_aabbMin.setMin(triangle[2]); + m_aabbMax.setMax(triangle[2]); + } + }; + + //first calculate the total aabb for all triangles + AabbCalculationCallback aabbCallback; + aabbMin.setValue(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30)); + aabbMax.setValue(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + InternalProcessAllTriangles(&aabbCallback,aabbMin,aabbMax); + + aabbMin = aabbCallback.m_aabbMin; + aabbMax = aabbCallback.m_aabbMax; +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h b/src/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h new file mode 100644 index 000000000..4ce0bd2e2 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h @@ -0,0 +1,89 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef STRIDING_MESHINTERFACE_H +#define STRIDING_MESHINTERFACE_H + +#include "LinearMath/btVector3.h" +#include "btTriangleCallback.h" + +/// PHY_ScalarType enumerates possible scalar types. +/// See the btStridingMeshInterface for its use +typedef enum PHY_ScalarType { + PHY_FLOAT, + PHY_DOUBLE, + PHY_INTEGER, + PHY_SHORT, + PHY_FIXEDPOINT88 +} PHY_ScalarType; + +/// btStridingMeshInterface is the interface class for high performance access to triangle meshes +/// It allows for sharing graphics and collision meshes. Also it provides locking/unlocking of graphics meshes that are in gpu memory. +class btStridingMeshInterface +{ + protected: + + btVector3 m_scaling; + + public: + btStridingMeshInterface() :m_scaling(btScalar(1.),btScalar(1.),btScalar(1.)) + { + + } + + virtual ~btStridingMeshInterface(); + + + + void InternalProcessAllTriangles(btInternalTriangleIndexCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + + ///brute force method to calculate aabb + void calculateAabbBruteForce(btVector3& aabbMin,btVector3& aabbMax); + + /// get read and write access to a subpart of a triangle mesh + /// this subpart has a continuous array of vertices and indices + /// in this way the mesh can be handled as chunks of memory with striding + /// very similar to OpenGL vertexarray support + /// make a call to unLockVertexBase when the read and write access is finished + virtual void getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0)=0; + + virtual void getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const=0; + + /// unLockVertexBase finishes the access to a subpart of the triangle mesh + /// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished + virtual void unLockVertexBase(int subpart)=0; + + virtual void unLockReadOnlyVertexBase(int subpart) const=0; + + + /// getNumSubParts returns the number of seperate subparts + /// each subpart has a continuous array of vertices and indices + virtual int getNumSubParts() const=0; + + virtual void preallocateVertices(int numverts)=0; + virtual void preallocateIndices(int numindices)=0; + + const btVector3& getScaling() const { + return m_scaling; + } + void setScaling(const btVector3& scaling) + { + m_scaling = scaling; + } + + +}; + +#endif //STRIDING_MESHINTERFACE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp new file mode 100644 index 000000000..3aa1eda99 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp @@ -0,0 +1,195 @@ + +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#include "btTetrahedronShape.h" +#include "LinearMath/btMatrix3x3.h" + +btBU_Simplex1to4::btBU_Simplex1to4() +:m_numVertices(0) +{ +} + +btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0) +:m_numVertices(0) +{ + addVertex(pt0); +} + +btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1) +:m_numVertices(0) +{ + addVertex(pt0); + addVertex(pt1); +} + +btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2) +:m_numVertices(0) +{ + addVertex(pt0); + addVertex(pt1); + addVertex(pt2); +} + +btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2,const btPoint3& pt3) +:m_numVertices(0) +{ + addVertex(pt0); + addVertex(pt1); + addVertex(pt2); + addVertex(pt3); +} + + + + + +void btBU_Simplex1to4::addVertex(const btPoint3& pt) +{ + m_vertices[m_numVertices++] = pt; + + recalcLocalAabb(); +} + + +int btBU_Simplex1to4::getNumVertices() const +{ + return m_numVertices; +} + +int btBU_Simplex1to4::getNumEdges() const +{ + //euler formula, F-E+V = 2, so E = F+V-2 + + switch (m_numVertices) + { + case 0: + return 0; + case 1: return 0; + case 2: return 1; + case 3: return 3; + case 4: return 6; + + + } + + return 0; +} + +void btBU_Simplex1to4::getEdge(int i,btPoint3& pa,btPoint3& pb) const +{ + + switch (m_numVertices) + { + + case 2: + pa = m_vertices[0]; + pb = m_vertices[1]; + break; + case 3: + switch (i) + { + case 0: + pa = m_vertices[0]; + pb = m_vertices[1]; + break; + case 1: + pa = m_vertices[1]; + pb = m_vertices[2]; + break; + case 2: + pa = m_vertices[2]; + pb = m_vertices[0]; + break; + + } + break; + case 4: + switch (i) + { + case 0: + pa = m_vertices[0]; + pb = m_vertices[1]; + break; + case 1: + pa = m_vertices[1]; + pb = m_vertices[2]; + break; + case 2: + pa = m_vertices[2]; + pb = m_vertices[0]; + break; + case 3: + pa = m_vertices[0]; + pb = m_vertices[3]; + break; + case 4: + pa = m_vertices[1]; + pb = m_vertices[3]; + break; + case 5: + pa = m_vertices[2]; + pb = m_vertices[3]; + break; + } + + } + + + + +} + +void btBU_Simplex1to4::getVertex(int i,btPoint3& vtx) const +{ + vtx = m_vertices[i]; +} + +int btBU_Simplex1to4::getNumPlanes() const +{ + switch (m_numVertices) + { + case 0: + return 0; + case 1: + return 0; + case 2: + return 0; + case 3: + return 2; + case 4: + return 4; + default: + { + } + } + return 0; +} + + +void btBU_Simplex1to4::getPlane(btVector3&, btPoint3& ,int ) const +{ + +} + +int btBU_Simplex1to4::getIndex(int ) const +{ + return 0; +} + +bool btBU_Simplex1to4::isInside(const btPoint3& ,btScalar ) const +{ + return false; +} + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.h new file mode 100644 index 000000000..ca1b4b42a --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.h @@ -0,0 +1,75 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BU_SIMPLEX_1TO4_SHAPE +#define BU_SIMPLEX_1TO4_SHAPE + + +#include "btPolyhedralConvexShape.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" + + +///BU_Simplex1to4 implements feature based and implicit simplex of up to 4 vertices (tetrahedron, triangle, line, vertex). +class btBU_Simplex1to4 : public btPolyhedralConvexShape +{ +protected: + + int m_numVertices; + btPoint3 m_vertices[4]; + +public: + btBU_Simplex1to4(); + + btBU_Simplex1to4(const btPoint3& pt0); + btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1); + btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2); + btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2,const btPoint3& pt3); + + + void reset() + { + m_numVertices = 0; + } + + + virtual int getShapeType() const{ return TETRAHEDRAL_SHAPE_PROXYTYPE; } + + void addVertex(const btPoint3& pt); + + //PolyhedralConvexShape interface + + virtual int getNumVertices() const; + + virtual int getNumEdges() const; + + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const; + + virtual void getVertex(int i,btPoint3& vtx) const; + + virtual int getNumPlanes() const; + + virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i) const; + + virtual int getIndex(int i) const; + + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const; + + + ///getName is for debugging + virtual const char* getName()const { return "btBU_Simplex1to4";} + +}; + +#endif //BU_SIMPLEX_1TO4_SHAPE diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp new file mode 100644 index 000000000..21374fd99 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp @@ -0,0 +1,42 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btTriangleBuffer.h" + + +///example usage of this class: +// btTriangleBuffer triBuf; +// concaveShape->processAllTriangles(&triBuf,aabbMin, aabbMax); +// for (int i=0;i m_triangleBuffer; + +public: + + + virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex); + + int getNumTriangles() const + { + return int(m_triangleBuffer.size()); + } + + const btTriangle& getTriangle(int index) const + { + return m_triangleBuffer[index]; + } + + void clearBuffer() + { + m_triangleBuffer.clear(); + } + +}; + + +#endif //BT_TRIANGLE_BUFFER_H + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp new file mode 100644 index 000000000..a020746db --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp @@ -0,0 +1,28 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btTriangleCallback.h" + +btTriangleCallback::~btTriangleCallback() +{ + +} + + +btInternalTriangleIndexCallback::~btInternalTriangleIndexCallback() +{ + +} + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.h b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.h new file mode 100644 index 000000000..7b2337498 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.h @@ -0,0 +1,40 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef TRIANGLE_CALLBACK_H +#define TRIANGLE_CALLBACK_H + +#include "LinearMath/btVector3.h" + + +class btTriangleCallback +{ +public: + + virtual ~btTriangleCallback(); + virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) = 0; +}; + +class btInternalTriangleIndexCallback +{ +public: + + virtual ~btInternalTriangleIndexCallback(); + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) = 0; +}; + + + +#endif //TRIANGLE_CALLBACK_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp new file mode 100644 index 000000000..554915a70 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp @@ -0,0 +1,78 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btTriangleIndexVertexArray.h" + +btTriangleIndexVertexArray::btTriangleIndexVertexArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,int numVertices,btScalar* vertexBase,int vertexStride) +{ + btIndexedMesh mesh; + + mesh.m_numTriangles = numTriangles; + mesh.m_triangleIndexBase = (const unsigned char *)triangleIndexBase; + mesh.m_triangleIndexStride = triangleIndexStride; + mesh.m_numVertices = numVertices; + mesh.m_vertexBase = (const unsigned char *)vertexBase; + mesh.m_vertexStride = vertexStride; + + addIndexedMesh(mesh); + +} + +btTriangleIndexVertexArray::~btTriangleIndexVertexArray() +{ + +} + +void btTriangleIndexVertexArray::getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) +{ + btAssert(subpart< getNumSubParts() ); + + btIndexedMesh& mesh = m_indexedMeshes[subpart]; + + numverts = mesh.m_numVertices; + (*vertexbase) = (unsigned char *) mesh.m_vertexBase; + #ifdef BT_USE_DOUBLE_PRECISION + type = PHY_DOUBLE; + #else + type = PHY_FLOAT; + #endif + vertexStride = mesh.m_vertexStride; + + numfaces = mesh.m_numTriangles; + + (*indexbase) = (unsigned char *)mesh.m_triangleIndexBase; + indexstride = mesh.m_triangleIndexStride; + indicestype = PHY_INTEGER; +} + +void btTriangleIndexVertexArray::getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) const +{ + const btIndexedMesh& mesh = m_indexedMeshes[subpart]; + + numverts = mesh.m_numVertices; + (*vertexbase) = (const unsigned char *)mesh.m_vertexBase; + #ifdef BT_USE_DOUBLE_PRECISION + type = PHY_DOUBLE; + #else + type = PHY_FLOAT; + #endif + vertexStride = mesh.m_vertexStride; + + numfaces = mesh.m_numTriangles; + (*indexbase) = (const unsigned char *)mesh.m_triangleIndexBase; + indexstride = mesh.m_triangleIndexStride; + indicestype = PHY_INTEGER; +} + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h new file mode 100644 index 000000000..3441a8325 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h @@ -0,0 +1,105 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_TRIANGLE_INDEX_VERTEX_ARRAY_H +#define BT_TRIANGLE_INDEX_VERTEX_ARRAY_H + +#include "btStridingMeshInterface.h" +#include "LinearMath/btAlignedObjectArray.h" +#include "LinearMath/btScalar.h" + + +///IndexedMesh indexes into existing vertex and index arrays, in a similar way OpenGL glDrawElements +///instead of the number of indices, we pass the number of triangles +///todo: explain with pictures +ATTRIBUTE_ALIGNED16( struct) btIndexedMesh +{ + BT_DECLARE_ALIGNED_ALLOCATOR(); + + int m_numTriangles; + const unsigned char * m_triangleIndexBase; + int m_triangleIndexStride; + int m_numVertices; + const unsigned char * m_vertexBase; + int m_vertexStride; + int pad[2]; +} +; + + +typedef btAlignedObjectArray IndexedMeshArray; + +///TriangleIndexVertexArray allows to use multiple meshes, by indexing into existing triangle/index arrays. +///Additional meshes can be added using addIndexedMesh +///No duplcate is made of the vertex/index data, it only indexes into external vertex/index arrays. +///So keep those arrays around during the lifetime of this btTriangleIndexVertexArray. +ATTRIBUTE_ALIGNED16( class) btTriangleIndexVertexArray : public btStridingMeshInterface +{ + IndexedMeshArray m_indexedMeshes; + int m_pad[3]; + + +public: + + BT_DECLARE_ALIGNED_ALLOCATOR(); + + btTriangleIndexVertexArray() + { + } + + virtual ~btTriangleIndexVertexArray(); + + //just to be backwards compatible + btTriangleIndexVertexArray(int numTriangleIndices,int* triangleIndexBase,int triangleIndexStride,int numVertices,btScalar* vertexBase,int vertexStride); + + void addIndexedMesh(const btIndexedMesh& mesh) + { + m_indexedMeshes.push_back(mesh); + } + + + virtual void getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0); + + virtual void getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const; + + /// unLockVertexBase finishes the access to a subpart of the triangle mesh + /// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished + virtual void unLockVertexBase(int subpart) {(void)subpart;} + + virtual void unLockReadOnlyVertexBase(int subpart) const {(void)subpart;} + + /// getNumSubParts returns the number of seperate subparts + /// each subpart has a continuous array of vertices and indices + virtual int getNumSubParts() const { + return (int)m_indexedMeshes.size(); + } + + IndexedMeshArray& getIndexedMeshArray() + { + return m_indexedMeshes; + } + + const IndexedMeshArray& getIndexedMeshArray() const + { + return m_indexedMeshes; + } + + virtual void preallocateVertices(int numverts){(void) numverts;} + virtual void preallocateIndices(int numindices){(void) numindices;} + +} +; + +#endif //BT_TRIANGLE_INDEX_VERTEX_ARRAY_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp new file mode 100644 index 000000000..98c54ef45 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp @@ -0,0 +1,60 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btTriangleMesh.h" +#include + + +btTriangleMesh::btTriangleMesh () +{ + +} + +void btTriangleMesh::getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) +{ + (void)subpart; + numverts = m_vertices.size(); + *vertexbase = (unsigned char*)&m_vertices[0]; + type = PHY_FLOAT; + stride = sizeof(btVector3); + + numfaces = m_indices.size()/3; + *indexbase = (unsigned char*) &m_indices[0]; + indicestype = PHY_INTEGER; + indexstride = 3*sizeof(int); + +} + +void btTriangleMesh::getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) const +{ + (void)subpart; + numverts = m_vertices.size(); + *vertexbase = (unsigned char*)&m_vertices[0]; + type = PHY_FLOAT; + stride = sizeof(btVector3); + + numfaces = m_indices.size()/3; + *indexbase = (unsigned char*) &m_indices[0]; + indicestype = PHY_INTEGER; + indexstride = 3*sizeof(int); + +} + + + +int btTriangleMesh::getNumSubParts() const +{ + return 1; +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h new file mode 100644 index 000000000..83e5a56d1 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h @@ -0,0 +1,75 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef TRIANGLE_MESH_H +#define TRIANGLE_MESH_H + +#include "btStridingMeshInterface.h" +#include "LinearMath/btVector3.h" +#include "LinearMath/btAlignedObjectArray.h" + +///TriangleMesh provides storage for a concave triangle mesh. It can be used as data for the btTriangleMeshShape. +class btTriangleMesh : public btStridingMeshInterface +{ + btAlignedObjectArray m_vertices; + btAlignedObjectArray m_indices; + + public: + btTriangleMesh (); + + void addTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2) + { + int curIndex = m_indices.size(); + m_vertices.push_back(vertex0); + m_vertices.push_back(vertex1); + m_vertices.push_back(vertex2); + + m_indices.push_back(curIndex++); + m_indices.push_back(curIndex++); + m_indices.push_back(curIndex++); + } + + int getNumTriangles() const + { + return m_indices.size() / 3; + } + + + +//StridingMeshInterface interface implementation + + virtual void getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0); + + virtual void getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const; + + /// unLockVertexBase finishes the access to a subpart of the triangle mesh + /// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished + virtual void unLockVertexBase(int subpart) {(void) subpart;} + + virtual void unLockReadOnlyVertexBase(int subpart) const { (void) subpart;} + + /// getNumSubParts returns the number of seperate subparts + /// each subpart has a continuous array of vertices and indices + virtual int getNumSubParts() const; + + virtual void preallocateVertices(int numverts){(void) numverts;} + virtual void preallocateIndices(int numindices){(void) numindices;} + + +}; + +#endif //TRIANGLE_MESH_H + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp new file mode 100644 index 000000000..0d390c88b --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp @@ -0,0 +1,202 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btTriangleMeshShape.h" +#include "LinearMath/btVector3.h" +#include "LinearMath/btQuaternion.h" +#include "btStridingMeshInterface.h" +#include "LinearMath/btAabbUtil2.h" +#include "BulletCollision/CollisionShapes/btCollisionMargin.h" + + +btTriangleMeshShape::btTriangleMeshShape(btStridingMeshInterface* meshInterface) +: m_meshInterface(meshInterface) +{ + recalcLocalAabb(); +} + + +btTriangleMeshShape::~btTriangleMeshShape() +{ + +} + + + + +void btTriangleMeshShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const +{ + + btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin); + btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin); + + btMatrix3x3 abs_b = trans.getBasis().absolute(); + + btPoint3 center = trans(localCenter); + + btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents), + abs_b[1].dot(localHalfExtents), + abs_b[2].dot(localHalfExtents)); + extent += btVector3(getMargin(),getMargin(),getMargin()); + + aabbMin = center - extent; + aabbMax = center + extent; + + +} + +void btTriangleMeshShape::recalcLocalAabb() +{ + for (int i=0;i<3;i++) + { + btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.)); + vec[i] = btScalar(1.); + btVector3 tmp = localGetSupportingVertex(vec); + m_localAabbMax[i] = tmp[i]+m_collisionMargin; + vec[i] = btScalar(-1.); + tmp = localGetSupportingVertex(vec); + m_localAabbMin[i] = tmp[i]-m_collisionMargin; + } +} + + + +class SupportVertexCallback : public btTriangleCallback +{ + + btVector3 m_supportVertexLocal; +public: + + btTransform m_worldTrans; + btScalar m_maxDot; + btVector3 m_supportVecLocal; + + SupportVertexCallback(const btVector3& supportVecWorld,const btTransform& trans) + : m_supportVertexLocal(btScalar(0.),btScalar(0.),btScalar(0.)), m_worldTrans(trans) ,m_maxDot(btScalar(-1e30)) + + { + m_supportVecLocal = supportVecWorld * m_worldTrans.getBasis(); + } + + virtual void processTriangle( btVector3* triangle,int partId, int triangleIndex) + { + (void)partId; + (void)triangleIndex; + for (int i=0;i<3;i++) + { + btScalar dot = m_supportVecLocal.dot(triangle[i]); + if (dot > m_maxDot) + { + m_maxDot = dot; + m_supportVertexLocal = triangle[i]; + } + } + } + + btVector3 GetSupportVertexWorldSpace() + { + return m_worldTrans(m_supportVertexLocal); + } + + btVector3 GetSupportVertexLocal() + { + return m_supportVertexLocal; + } + +}; + + +void btTriangleMeshShape::setLocalScaling(const btVector3& scaling) +{ + m_meshInterface->setScaling(scaling); + recalcLocalAabb(); +} + +const btVector3& btTriangleMeshShape::getLocalScaling() const +{ + return m_meshInterface->getScaling(); +} + + + + + + +//#define DEBUG_TRIANGLE_MESH + + + +void btTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const +{ + struct FilteredCallback : public btInternalTriangleIndexCallback + { + btTriangleCallback* m_callback; + btVector3 m_aabbMin; + btVector3 m_aabbMax; + + FilteredCallback(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) + :m_callback(callback), + m_aabbMin(aabbMin), + m_aabbMax(aabbMax) + { + } + + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + { + if (TestTriangleAgainstAabb2(&triangle[0],m_aabbMin,m_aabbMax)) + { + //check aabb in triangle-space, before doing this + m_callback->processTriangle(triangle,partId,triangleIndex); + } + + } + + }; + + FilteredCallback filterCallback(callback,aabbMin,aabbMax); + + m_meshInterface->InternalProcessAllTriangles(&filterCallback,aabbMin,aabbMax); +} + + + + + +void btTriangleMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const +{ + (void)mass; + //moving concave objects not supported + btAssert(0); + inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); +} + + +btVector3 btTriangleMeshShape::localGetSupportingVertex(const btVector3& vec) const +{ + btVector3 supportVertex; + + btTransform ident; + ident.setIdentity(); + + SupportVertexCallback supportCallback(vec,ident); + + btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + + processAllTriangles(&supportCallback,-aabbMax,aabbMax); + + supportVertex = supportCallback.GetSupportVertexLocal(); + + return supportVertex; +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h new file mode 100644 index 000000000..6657fc091 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h @@ -0,0 +1,80 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef TRIANGLE_MESH_SHAPE_H +#define TRIANGLE_MESH_SHAPE_H + +#include "btConcaveShape.h" +#include "btStridingMeshInterface.h" + + +///Concave triangle mesh interface. Don't use this class directly, use btBvhTriangleMeshShape instead. +class btTriangleMeshShape : public btConcaveShape +{ +protected: + btVector3 m_localAabbMin; + btVector3 m_localAabbMax; + btStridingMeshInterface* m_meshInterface; + + ///btTriangleMeshShape constructor has been disabled/protected, so that users will not mistakenly use this class. + ///Don't use btTriangleMeshShape but use btBvhTriangleMeshShape instead! + btTriangleMeshShape(btStridingMeshInterface* meshInterface); + +public: + + virtual ~btTriangleMeshShape(); + + virtual btVector3 localGetSupportingVertex(const btVector3& vec) const; + + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const + { + assert(0); + return localGetSupportingVertex(vec); + } + + void recalcLocalAabb(); + + virtual int getShapeType() const + { + return TRIANGLE_MESH_SHAPE_PROXYTYPE; + } + + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + + virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const; + + virtual void setLocalScaling(const btVector3& scaling); + virtual const btVector3& getLocalScaling() const; + + btStridingMeshInterface* getMeshInterface() + { + return m_meshInterface; + } + + const btStridingMeshInterface* getMeshInterface() const + { + return m_meshInterface; + } + + + //debugging + virtual const char* getName()const {return "TRIANGLEMESH";} + + +}; + +#endif //TRIANGLE_MESH_SHAPE_H diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btTriangleShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleShape.h new file mode 100644 index 000000000..064c64fa6 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btTriangleShape.h @@ -0,0 +1,179 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef OBB_TRIANGLE_MINKOWSKI_H +#define OBB_TRIANGLE_MINKOWSKI_H + +#include "btConvexShape.h" +#include "btBoxShape.h" + +class btTriangleShape : public btPolyhedralConvexShape +{ + + +public: + + btVector3 m_vertices1[3]; + + + virtual int getNumVertices() const + { + return 3; + } + + const btVector3& getVertexPtr(int index) const + { + return m_vertices1[index]; + } + virtual void getVertex(int index,btVector3& vert) const + { + vert = m_vertices1[index]; + } + virtual int getShapeType() const + { + return TRIANGLE_SHAPE_PROXYTYPE; + } + + virtual int getNumEdges() const + { + return 3; + } + + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const + { + getVertex(i,pa); + getVertex((i+1)%3,pb); + } + + + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax)const + { +// btAssert(0); + getAabbSlow(t,aabbMin,aabbMax); + } + + btVector3 localGetSupportingVertexWithoutMargin(const btVector3& dir)const + { + btVector3 dots(dir.dot(m_vertices1[0]), dir.dot(m_vertices1[1]), dir.dot(m_vertices1[2])); + return m_vertices1[dots.maxAxis()]; + + } + + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const + { + for (int i=0;i= -tolerance && dist <= tolerance) + { + //inside check on edge-planes + int i; + for (i=0;i<3;i++) + { + btPoint3 pa,pb; + getEdge(i,pa,pb); + btVector3 edge = pb-pa; + btVector3 edgeNormal = edge.cross(normal); + edgeNormal.normalize(); + btScalar dist = pt.dot( edgeNormal); + btScalar edgeConst = pa.dot(edgeNormal); + dist -= edgeConst; + if (dist < -tolerance) + return false; + } + + return true; + } + + return false; + } + //debugging + virtual const char* getName()const + { + return "Triangle"; + } + + virtual int getNumPreferredPenetrationDirections() const + { + return 2; + } + + virtual void getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const + { + calcNormal(penetrationVector); + if (index) + penetrationVector *= btScalar(-1.); + } + + +}; + +#endif //OBB_TRIANGLE_MINKOWSKI_H + diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp b/src/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp new file mode 100644 index 000000000..ef340286c --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp @@ -0,0 +1,114 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2007 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btUniformScalingShape.h" + +btUniformScalingShape::btUniformScalingShape( btConvexShape* convexChildShape,btScalar uniformScalingFactor): +m_childConvexShape(convexChildShape), +m_uniformScalingFactor(uniformScalingFactor) +{ +} + +btUniformScalingShape::~btUniformScalingShape() +{ +} + + +btVector3 btUniformScalingShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const +{ + btVector3 tmpVertex; + tmpVertex = m_childConvexShape->localGetSupportingVertexWithoutMargin(vec); + return tmpVertex*m_uniformScalingFactor; +} + +void btUniformScalingShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +{ + m_childConvexShape->batchedUnitVectorGetSupportingVertexWithoutMargin(vectors,supportVerticesOut,numVectors); + int i; + for (i=0;ilocalGetSupportingVertex(vec); + return tmpVertex*m_uniformScalingFactor; +} + + +void btUniformScalingShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const +{ + + ///this linear upscaling is not realistic, but we don't deal with large mass ratios... + btVector3 tmpInertia; + m_childConvexShape->calculateLocalInertia(mass,tmpInertia); + inertia = tmpInertia * m_uniformScalingFactor; +} + + + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version +void btUniformScalingShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const +{ + m_childConvexShape->getAabb(t,aabbMin,aabbMax); + btVector3 aabbCenter = (aabbMax+aabbMin)*btScalar(0.5); + btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*btScalar(0.5)*m_uniformScalingFactor; + + aabbMin = aabbCenter - scaledAabbHalfExtends; + aabbMax = aabbCenter + scaledAabbHalfExtends; + +} + +void btUniformScalingShape::getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const +{ + m_childConvexShape->getAabbSlow(t,aabbMin,aabbMax); + btVector3 aabbCenter = (aabbMax+aabbMin)*btScalar(0.5); + btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*btScalar(0.5)*m_uniformScalingFactor; + + aabbMin = aabbCenter - scaledAabbHalfExtends; + aabbMax = aabbCenter + scaledAabbHalfExtends; +} + +void btUniformScalingShape::setLocalScaling(const btVector3& scaling) +{ + m_childConvexShape->setLocalScaling(scaling); +} + +const btVector3& btUniformScalingShape::getLocalScaling() const +{ + return m_childConvexShape->getLocalScaling(); +} + +void btUniformScalingShape::setMargin(btScalar margin) +{ + m_childConvexShape->setMargin(margin); +} +btScalar btUniformScalingShape::getMargin() const +{ + return m_childConvexShape->getMargin() * m_uniformScalingFactor; +} + +int btUniformScalingShape::getNumPreferredPenetrationDirections() const +{ + return m_childConvexShape->getNumPreferredPenetrationDirections(); +} + +void btUniformScalingShape::getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const +{ + m_childConvexShape->getPreferredPenetrationDirection(index,penetrationVector); +} diff --git a/src/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.h b/src/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.h new file mode 100644 index 000000000..3a0ecf021 --- /dev/null +++ b/src/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.h @@ -0,0 +1,86 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_UNIFORM_SCALING_SHAPE_H +#define BT_UNIFORM_SCALING_SHAPE_H + +#include "btConvexShape.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types + +class btUniformScalingShape : public btConvexShape +{ + btConvexShape* m_childConvexShape; + + btScalar m_uniformScalingFactor; + + public: + + btUniformScalingShape( btConvexShape* convexChildShape, btScalar uniformScalingFactor); + + virtual ~btUniformScalingShape(); + + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + + virtual btVector3 localGetSupportingVertex(const btVector3& vec)const; + + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const; + + btScalar getUniformScalingFactor() const + { + return m_uniformScalingFactor; + } + + btConvexShape* getChildShape() + { + return m_childConvexShape; + } + + const btConvexShape* getChildShape() const + { + return m_childConvexShape; + } + + virtual const char* getName()const + { + return "UniformScalingShape"; + } + + virtual int getShapeType() const { return UNIFORM_SCALING_SHAPE_PROXYTYPE; } + + + /////////////////////////// + + + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version + void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + + virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + + virtual void setLocalScaling(const btVector3& scaling) ; + virtual const btVector3& getLocalScaling() const ; + + virtual void setMargin(btScalar margin); + virtual btScalar getMargin() const; + + virtual int getNumPreferredPenetrationDirections() const; + + virtual void getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const; + + +}; + +#endif //BT_UNIFORM_SCALING_SHAPE_H diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp new file mode 100644 index 000000000..c6a2b396d --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp @@ -0,0 +1,210 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btContinuousConvexCollision.h" +#include "BulletCollision/CollisionShapes/btConvexShape.h" +#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h" +#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h" +#include "LinearMath/btTransformUtil.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" + +#include "btGjkPairDetector.h" +#include "btPointCollector.h" + + + +btContinuousConvexCollision::btContinuousConvexCollision ( const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* penetrationDepthSolver) +:m_simplexSolver(simplexSolver), +m_penetrationDepthSolver(penetrationDepthSolver), +m_convexA(convexA),m_convexB(convexB) +{ +} + +/// This maximum should not be necessary. It allows for untested/degenerate cases in production code. +/// You don't want your game ever to lock-up. +#define MAX_ITERATIONS 1000 + +bool btContinuousConvexCollision::calcTimeOfImpact( + const btTransform& fromA, + const btTransform& toA, + const btTransform& fromB, + const btTransform& toB, + CastResult& result) +{ + + m_simplexSolver->reset(); + + /// compute linear and angular velocity for this interval, to interpolate + btVector3 linVelA,angVelA,linVelB,angVelB; + btTransformUtil::calculateVelocity(fromA,toA,btScalar(1.),linVelA,angVelA); + btTransformUtil::calculateVelocity(fromB,toB,btScalar(1.),linVelB,angVelB); + + btScalar boundingRadiusA = m_convexA->getAngularMotionDisc(); + btScalar boundingRadiusB = m_convexB->getAngularMotionDisc(); + + btScalar maxAngularProjectedVelocity = angVelA.length() * boundingRadiusA + angVelB.length() * boundingRadiusB; + + btScalar radius = btScalar(0.001); + + btScalar lambda = btScalar(0.); + btVector3 v(1,0,0); + + int maxIter = MAX_ITERATIONS; + + btVector3 n; + n.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); + bool hasResult = false; + btVector3 c; + + btScalar lastLambda = lambda; + //btScalar epsilon = btScalar(0.001); + + int numIter = 0; + //first solution, using GJK + + + btTransform identityTrans; + identityTrans.setIdentity(); + + btSphereShape raySphere(btScalar(0.0)); + raySphere.setMargin(btScalar(0.)); + + +// result.drawCoordSystem(sphereTr); + + btPointCollector pointCollector1; + + { + + btGjkPairDetector gjk(m_convexA,m_convexB,m_simplexSolver,m_penetrationDepthSolver); + btGjkPairDetector::ClosestPointInput input; + + //we don't use margins during CCD + // gjk.setIgnoreMargin(true); + + input.m_transformA = fromA; + input.m_transformB = fromB; + gjk.getClosestPoints(input,pointCollector1,0); + + hasResult = pointCollector1.m_hasResult; + c = pointCollector1.m_pointInWorld; + } + + if (hasResult) + { + btScalar dist; + dist = pointCollector1.m_distance; + n = pointCollector1.m_normalOnBInWorld; + + + + //not close enough + while (dist > radius) + { + numIter++; + if (numIter > maxIter) + { + return false; //todo: report a failure + } + btScalar dLambda = btScalar(0.); + + btScalar projectedLinearVelocity = (linVelB-linVelA).dot(n); + + //calculate safe moving fraction from distance / (linear+rotational velocity) + + //btScalar clippedDist = GEN_min(angularConservativeRadius,dist); + //btScalar clippedDist = dist; + + + dLambda = dist / (projectedLinearVelocity+ maxAngularProjectedVelocity); + + lambda = lambda + dLambda; + + if (lambda > btScalar(1.)) + return false; + + if (lambda < btScalar(0.)) + return false; + + + //todo: next check with relative epsilon + if (lambda <= lastLambda) + { + return false; + //n.setValue(0,0,0); + break; + } + lastLambda = lambda; + + + + //interpolate to next lambda + btTransform interpolatedTransA,interpolatedTransB,relativeTrans; + + btTransformUtil::integrateTransform(fromA,linVelA,angVelA,lambda,interpolatedTransA); + btTransformUtil::integrateTransform(fromB,linVelB,angVelB,lambda,interpolatedTransB); + relativeTrans = interpolatedTransB.inverseTimes(interpolatedTransA); + + result.DebugDraw( lambda ); + + btPointCollector pointCollector; + btGjkPairDetector gjk(m_convexA,m_convexB,m_simplexSolver,m_penetrationDepthSolver); + btGjkPairDetector::ClosestPointInput input; + input.m_transformA = interpolatedTransA; + input.m_transformB = interpolatedTransB; + gjk.getClosestPoints(input,pointCollector,0); + if (pointCollector.m_hasResult) + { + if (pointCollector.m_distance < btScalar(0.)) + { + //degenerate ?! + result.m_fraction = lastLambda; + n = pointCollector.m_normalOnBInWorld; + result.m_normal=n;//.setValue(1,1,1);// = n; + return true; + } + c = pointCollector.m_pointInWorld; + n = pointCollector.m_normalOnBInWorld; + dist = pointCollector.m_distance; + } else + { + //?? + return false; + } + + } + + result.m_fraction = lambda; + result.m_normal = n; + return true; + } + + return false; + +/* +//todo: + //if movement away from normal, discard result + btVector3 move = transBLocalTo.getOrigin() - transBLocalFrom.getOrigin(); + if (result.m_fraction < btScalar(1.)) + { + if (move.dot(result.m_normal) <= btScalar(0.)) + { + } + } +*/ + +} + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h new file mode 100644 index 000000000..28c2b4d61 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h @@ -0,0 +1,52 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef CONTINUOUS_COLLISION_CONVEX_CAST_H +#define CONTINUOUS_COLLISION_CONVEX_CAST_H + +#include "btConvexCast.h" +#include "btSimplexSolverInterface.h" +class btConvexPenetrationDepthSolver; +class btConvexShape; + +/// btContinuousConvexCollision implements angular and linear time of impact for convex objects. +/// Based on Brian Mirtich's Conservative Advancement idea (PhD thesis). +/// Algorithm operates in worldspace, in order to keep inbetween motion globally consistent. +/// It uses GJK at the moment. Future improvement would use minkowski sum / supporting vertex, merging innerloops +class btContinuousConvexCollision : public btConvexCast +{ + btSimplexSolverInterface* m_simplexSolver; + btConvexPenetrationDepthSolver* m_penetrationDepthSolver; + const btConvexShape* m_convexA; + const btConvexShape* m_convexB; + + +public: + + btContinuousConvexCollision (const btConvexShape* shapeA,const btConvexShape* shapeB ,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver); + + virtual bool calcTimeOfImpact( + const btTransform& fromA, + const btTransform& toA, + const btTransform& fromB, + const btTransform& toB, + CastResult& result); + + +}; + +#endif //CONTINUOUS_COLLISION_CONVEX_CAST_H + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp new file mode 100644 index 000000000..d2a1310b2 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp @@ -0,0 +1,20 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btConvexCast.h" + +btConvexCast::~btConvexCast() +{ +} diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h new file mode 100644 index 000000000..cc80f0aa8 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h @@ -0,0 +1,71 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef CONVEX_CAST_H +#define CONVEX_CAST_H + +#include "LinearMath/btTransform.h" +#include "LinearMath/btVector3.h" +#include "LinearMath/btScalar.h" +class btMinkowskiSumShape; +#include "LinearMath/btIDebugDraw.h" + +/// btConvexCast is an interface for Casting +class btConvexCast +{ +public: + + + virtual ~btConvexCast(); + + ///RayResult stores the closest result + /// alternatively, add a callback method to decide about closest/all results + struct CastResult + { + //virtual bool addRayResult(const btVector3& normal,btScalar fraction) = 0; + + virtual void DebugDraw(btScalar fraction) {(void)fraction;} + virtual void drawCoordSystem(const btTransform& trans) {(void)trans;} + + CastResult() + :m_fraction(btScalar(1e30)), + m_debugDrawer(0) + { + } + + + virtual ~CastResult() {}; + + btVector3 m_normal; + btScalar m_fraction; + btTransform m_hitTransformA; + btTransform m_hitTransformB; + + btIDebugDraw* m_debugDrawer; + + }; + + + /// cast a convex against another convex object + virtual bool calcTimeOfImpact( + const btTransform& fromA, + const btTransform& toA, + const btTransform& fromB, + const btTransform& toB, + CastResult& result) = 0; +}; + +#endif //CONVEX_CAST_H diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h new file mode 100644 index 000000000..996909213 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h @@ -0,0 +1,43 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef CONVEX_PENETRATION_DEPTH_H +#define CONVEX_PENETRATION_DEPTH_H + +class btStackAlloc; +class btVector3; +#include "btSimplexSolverInterface.h" +class btConvexShape; +#include "LinearMath/btPoint3.h" +class btTransform; + +///ConvexPenetrationDepthSolver provides an interface for penetration depth calculation. +class btConvexPenetrationDepthSolver +{ +public: + + virtual ~btConvexPenetrationDepthSolver() {}; + virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver, + const btConvexShape* convexA,const btConvexShape* convexB, + const btTransform& transA,const btTransform& transB, + btVector3& v, btPoint3& pa, btPoint3& pb, + class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc + ) = 0; + + +}; +#endif //CONVEX_PENETRATION_DEPTH_H + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h new file mode 100644 index 000000000..f11c8bd12 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h @@ -0,0 +1,88 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef DISCRETE_COLLISION_DETECTOR1_INTERFACE_H +#define DISCRETE_COLLISION_DETECTOR1_INTERFACE_H +#include "LinearMath/btTransform.h" +#include "LinearMath/btVector3.h" +class btStackAlloc; + +/// This interface is made to be used by an iterative approach to do TimeOfImpact calculations +/// This interface allows to query for closest points and penetration depth between two (convex) objects +/// the closest point is on the second object (B), and the normal points from the surface on B towards A. +/// distance is between closest points on B and closest point on A. So you can calculate closest point on A +/// by taking closestPointInA = closestPointInB + m_distance * m_normalOnSurfaceB +struct btDiscreteCollisionDetectorInterface +{ + + struct Result + { + + virtual ~Result(){} + + ///setShapeIdentifiers provides experimental support for per-triangle material / custom material combiner + virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1)=0; + virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)=0; + }; + + struct ClosestPointInput + { + ClosestPointInput() + :m_maximumDistanceSquared(btScalar(1e30)), + m_stackAlloc(0) + { + } + + btTransform m_transformA; + btTransform m_transformB; + btScalar m_maximumDistanceSquared; + btStackAlloc* m_stackAlloc; + }; + + virtual ~btDiscreteCollisionDetectorInterface() {}; + + // + // give either closest points (distance > 0) or penetration (distance) + // the normal always points from B towards A + // + virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) = 0; + +}; + +struct btStorageResult : public btDiscreteCollisionDetectorInterface::Result +{ + btVector3 m_normalOnSurfaceB; + btVector3 m_closestPointInB; + btScalar m_distance; //negative means penetration ! + + btStorageResult() : m_distance(btScalar(1e30)) + { + + } + virtual ~btStorageResult() {}; + + virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth) + { + if (depth < m_distance) + { + m_normalOnSurfaceB = normalOnBInWorld; + m_closestPointInB = pointInWorld; + m_distance = depth; + } + } +}; + +#endif //DISCRETE_COLLISION_DETECTOR_INTERFACE1_H diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp new file mode 100644 index 000000000..da2a02b98 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp @@ -0,0 +1,174 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#include "btGjkConvexCast.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" +#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h" +#include "btGjkPairDetector.h" +#include "btPointCollector.h" + + +btGjkConvexCast::btGjkConvexCast(const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver) +:m_simplexSolver(simplexSolver), +m_convexA(convexA), +m_convexB(convexB) +{ +} + +bool btGjkConvexCast::calcTimeOfImpact( + const btTransform& fromA, + const btTransform& toA, + const btTransform& fromB, + const btTransform& toB, + CastResult& result) +{ + + + btMinkowskiSumShape combi(m_convexA,m_convexB); + btMinkowskiSumShape* convex = &combi; + + btTransform rayFromLocalA; + btTransform rayToLocalA; + + rayFromLocalA = fromA.inverse()* fromB; + rayToLocalA = toA.inverse()* toB; + + + btTransform trA,trB; + trA = btTransform(fromA); + trB = btTransform(fromB); + trA.setOrigin(btPoint3(0,0,0)); + trB.setOrigin(btPoint3(0,0,0)); + + convex->setTransformA(trA); + convex->setTransformB(trB); + + + + + btScalar radius = btScalar(0.01); + + btScalar lambda = btScalar(0.); + btVector3 s = rayFromLocalA.getOrigin(); + btVector3 r = rayToLocalA.getOrigin()-rayFromLocalA.getOrigin(); + btVector3 x = s; + btVector3 n; + n.setValue(0,0,0); + bool hasResult = false; + btVector3 c; + + btScalar lastLambda = lambda; + + //first solution, using GJK + + //no penetration support for now, perhaps pass a pointer when we really want it + btConvexPenetrationDepthSolver* penSolverPtr = 0; + + btTransform identityTrans; + identityTrans.setIdentity(); + + btSphereShape raySphere(btScalar(0.0)); + raySphere.setMargin(btScalar(0.)); + + btTransform sphereTr; + sphereTr.setIdentity(); + sphereTr.setOrigin( rayFromLocalA.getOrigin()); + + result.drawCoordSystem(sphereTr); + { + btPointCollector pointCollector1; + btGjkPairDetector gjk(&raySphere,convex,m_simplexSolver,penSolverPtr); + + btGjkPairDetector::ClosestPointInput input; + input.m_transformA = sphereTr; + input.m_transformB = identityTrans; + gjk.getClosestPoints(input,pointCollector1,0); + + hasResult = pointCollector1.m_hasResult; + c = pointCollector1.m_pointInWorld; + n = pointCollector1.m_normalOnBInWorld; + } + + + + if (hasResult) + { + btScalar dist; + dist = (c-x).length(); + if (dist < radius) + { + //penetration + lastLambda = btScalar(1.); + } + + //not close enough + while (dist > radius) + { + + n = x - c; + btScalar nDotr = n.dot(r); + + if (nDotr >= -(SIMD_EPSILON*SIMD_EPSILON)) + return false; + + lambda = lambda - n.dot(n) / nDotr; + if (lambda <= lastLambda) + break; + + lastLambda = lambda; + + x = s + lambda * r; + + sphereTr.setOrigin( x ); + result.drawCoordSystem(sphereTr); + btPointCollector pointCollector; + btGjkPairDetector gjk(&raySphere,convex,m_simplexSolver,penSolverPtr); + btGjkPairDetector::ClosestPointInput input; + input.m_transformA = sphereTr; + input.m_transformB = identityTrans; + gjk.getClosestPoints(input,pointCollector,0); + if (pointCollector.m_hasResult) + { + if (pointCollector.m_distance < btScalar(0.)) + { + //degeneracy, report a hit + result.m_fraction = lastLambda; + result.m_normal = n; + return true; + } + c = pointCollector.m_pointInWorld; + dist = (c-x).length(); + } else + { + //?? + return false; + } + + } + + if (lastLambda < btScalar(1.)) + { + + result.m_fraction = lastLambda; + result.m_normal = n; + return true; + } + } + + return false; +} + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h new file mode 100644 index 000000000..a977c9e83 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h @@ -0,0 +1,50 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef GJK_CONVEX_CAST_H +#define GJK_CONVEX_CAST_H + +#include "BulletCollision/CollisionShapes/btCollisionMargin.h" + +#include "LinearMath/btVector3.h" +#include "btConvexCast.h" +class btConvexShape; +class btMinkowskiSumShape; +#include "btSimplexSolverInterface.h" + +///GjkConvexCast performs a raycast on a convex object using support mapping. +class btGjkConvexCast : public btConvexCast +{ + btSimplexSolverInterface* m_simplexSolver; + const btConvexShape* m_convexA; + const btConvexShape* m_convexB; + +public: + + btGjkConvexCast(const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver); + + /// cast a convex against another convex object + virtual bool calcTimeOfImpact( + const btTransform& fromA, + const btTransform& toA, + const btTransform& fromB, + const btTransform& toB, + CastResult& result); + +}; + +#endif //GJK_CONVEX_CAST_H diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa.cpp new file mode 100644 index 000000000..14f2c0e07 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa.cpp @@ -0,0 +1,628 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the +use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not +claim that you wrote the original software. If you use this software in a +product, an acknowledgment in the product documentation would be appreciated +but is not required. +2. Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +/* +GJK-EPA collision solver by Nathanael Presson +Nov.2006 +*/ + +#include "btGjkEpa.h" +#include //for memset +#include + +#if defined(DEBUG) || defined (_DEBUG) +#include //for debug printf +#ifdef __SPU__ +#include +#define printf spu_printf +#endif //__SPU__ +#endif + +namespace gjkepa_impl +{ + +// +// Port. typedefs +// + +typedef btScalar F; +typedef bool Z; +typedef int I; +typedef unsigned int U; +typedef unsigned char U1; +typedef unsigned short U2; + +typedef btVector3 Vector3; +typedef btMatrix3x3 Rotation; + +// +// Config +// + +#if 0 +#define BTLOCALSUPPORT localGetSupportingVertexWithoutMargin +#else +#define BTLOCALSUPPORT localGetSupportingVertex +#endif + +// +// Const +// + + +#define cstInf SIMD_INFINITY +#define cstPi SIMD_PI +#define cst2Pi SIMD_2_PI +#define GJK_maxiterations (128) +#define GJK_hashsize (1<<6) +#define GJK_hashmask (GJK_hashsize-1) +#define GJK_insimplex_eps F(0.0001) +#define GJK_sqinsimplex_eps (GJK_insimplex_eps*GJK_insimplex_eps) +#define EPA_maxiterations 256 +#define EPA_inface_eps F(0.01) +#define EPA_accuracy F(0.001) + +// +// Utils +// + +static inline F Abs(F v) { return(v<0?-v:v); } +static inline F Sign(F v) { return(F(v<0?-1:1)); } +template static inline void Swap(T& a,T& b) { T +t(a);a=b;b=t; } +template static inline T Min(const T& a,const T& b) { +return(a static inline T Max(const T& a,const T& b) { +return(a>b?a:b); } +static inline void ClearMemory(void* p,U sz) { memset(p,0,(size_t)sz); +} +#if 0 +template static inline void Raise(const T& object) { +throw(object); } +#else +template static inline void Raise(const T&) {} +#endif + + + +// +// GJK +// +struct GJK + { + struct Mkv + { + Vector3 w; /* Minkowski vertice */ + Vector3 r; /* Ray */ + }; + struct He + { + Vector3 v; + He* n; + }; + btStackAlloc* sa; + btBlock* sablock; + He* table[GJK_hashsize]; + Rotation wrotations[2]; + Vector3 positions[2]; + const btConvexShape* shapes[2]; + Mkv simplex[5]; + Vector3 ray; + U order; + U iterations; + F margin; + Z failed; + // + GJK(btStackAlloc* psa, + const Rotation& wrot0,const Vector3& pos0,const btConvexShape* shape0, + const Rotation& wrot1,const Vector3& pos1,const btConvexShape* shape1, + F pmargin=0) + { + wrotations[0]=wrot0;positions[0]=pos0;shapes[0]=shape0; + wrotations[1]=wrot1;positions[1]=pos1;shapes[1]=shape1; + sa =psa; + sablock =sa->beginBlock(); + margin =pmargin; + failed =false; + } + // + ~GJK() + { + sa->endBlock(sablock); + } + // vdh : very dumm hash + static inline U Hash(const Vector3& v) + { + //this doesn't compile under GCC 3.3.5, so add the ()... + //const U h(U(v[0]*15461)^U(v[1]*83003)^U(v[2]*15473)); + //return(((*((const U*)&h))*169639)&GJK_hashmask); + const U h((U)(v[0]*15461)^(U)(v[1]*83003)^(U)(v[2]*15473)); + return(((*((const U*)&h))*169639)&GJK_hashmask); + } + // + inline Vector3 LocalSupport(const Vector3& d,U i) const + { + return(wrotations[i]*shapes[i]->BTLOCALSUPPORT(d*wrotations[i])+positions[i]); + } + // + inline void Support(const Vector3& d,Mkv& v) const + { + v.r = d; + v.w = LocalSupport(d,0)-LocalSupport(-d,1)+d*margin; + } + #define SPX(_i_) simplex[_i_] + #define SPXW(_i_) simplex[_i_].w + // + inline Z FetchSupport() + { + const U h(Hash(ray)); + He* e = (He*)(table[h]); + while(e) { if(e->v==ray) { --order;return(false); } else e=e->n; } + e=(He*)sa->allocate(sizeof(He));e->v=ray;e->n=table[h];table[h]=e; + Support(ray,simplex[++order]); + return(ray.dot(SPXW(order))>0); + } + // + inline Z SolveSimplex2(const Vector3& ao,const Vector3& ab) + { + if(ab.dot(ao)>=0) + { + const Vector3 cabo(cross(ab,ao)); + if(cabo.length2()>GJK_sqinsimplex_eps) + { ray=cross(cabo,ab); } + else + { return(true); } + } + else + { order=0;SPX(0)=SPX(1);ray=ao; } + return(false); + } + // + inline Z SolveSimplex3(const Vector3& ao,const Vector3& ab,const Vector3& +ac) + { + return(SolveSimplex3a(ao,ab,ac,cross(ab,ac))); + } + // + inline Z SolveSimplex3a(const Vector3& ao,const Vector3& ab,const Vector3& +ac,const Vector3& cabc) + { + if((cross(cabc,ab)).dot(ao)<-GJK_insimplex_eps) + { order=1;SPX(0)=SPX(1);SPX(1)=SPX(2);return(SolveSimplex2(ao,ab)); } + else if((cross(cabc,ac)).dot(ao)>+GJK_insimplex_eps) + { order=1;SPX(1)=SPX(2);return(SolveSimplex2(ao,ac)); } + else + { + const F d(cabc.dot(ao)); + if(Abs(d)>GJK_insimplex_eps) + { + if(d>0) + { ray=cabc; } + else + { ray=-cabc;Swap(SPX(0),SPX(1)); } + return(false); + } else return(true); + } + } + // + inline Z SolveSimplex4(const Vector3& ao,const Vector3& ab,const Vector3& +ac,const Vector3& ad) + { + Vector3 crs; + if((crs=cross(ab,ac)).dot(ao)>GJK_insimplex_eps) + { +order=2;SPX(0)=SPX(1);SPX(1)=SPX(2);SPX(2)=SPX(3);return(SolveSimplex3a(ao,ab,ac,crs)); +} + else if((crs=cross(ac,ad)).dot(ao)>GJK_insimplex_eps) + { order=2;SPX(2)=SPX(3);return(SolveSimplex3a(ao,ac,ad,crs)); } + else if((crs=cross(ad,ab)).dot(ao)>GJK_insimplex_eps) + { +order=2;SPX(1)=SPX(0);SPX(0)=SPX(2);SPX(2)=SPX(3);return(SolveSimplex3a(ao,ad,ab,crs)); +} + else return(true); + } + // + inline Z SearchOrigin(const Vector3& initray=Vector3(1,0,0)) + { + iterations = 0; + order = (U)-1; + failed = false; + ray = initray.normalized(); + ClearMemory(table,sizeof(void*)*GJK_hashsize); + FetchSupport(); + ray = -SPXW(0); + for(;iterations0?rl:1; + if(FetchSupport()) + { + Z found(false); + switch(order) + { + case 1: found=SolveSimplex2(-SPXW(1),SPXW(0)-SPXW(1));break; + case 2: found=SolveSimplex3(-SPXW(2),SPXW(1)-SPXW(2),SPXW(0)-SPXW(2));break; + case 3: found=SolveSimplex4(-SPXW(3),SPXW(2)-SPXW(3),SPXW(1)-SPXW(3),SPXW(0)-SPXW(3));break; + } + if(found) return(true); + } else return(false); + } + failed=true; + return(false); + } + // + inline Z EncloseOrigin() + { + switch(order) + { + /* Point */ + case 0: break; + /* Line */ + case 1: + { + const Vector3 ab(SPXW(1)-SPXW(0)); + const Vector3 b[]={ cross(ab,Vector3(1,0,0)), + cross(ab,Vector3(0,1,0)), + cross(ab,Vector3(0,0,1))}; + const F m[]={b[0].length2(),b[1].length2(),b[2].length2()}; + const Rotation r(btQuaternion(ab.normalized(),cst2Pi/3)); + Vector3 w(b[m[0]>m[1]?m[0]>m[2]?0:2:m[1]>m[2]?1:2]); + Support(w.normalized(),simplex[4]);w=r*w; + Support(w.normalized(),simplex[2]);w=r*w; + Support(w.normalized(),simplex[3]);w=r*w; + order=4; + return(true); + } + break; + /* Triangle */ + case 2: + { + const +Vector3 n(cross((SPXW(1)-SPXW(0)),(SPXW(2)-SPXW(0))).normalized()); + Support( n,simplex[3]); + Support(-n,simplex[4]); + order=4; + return(true); + } + break; + /* Tetrahedron */ + case 3: return(true); + /* Hexahedron */ + case 4: return(true); + } + return(false); + } + #undef SPX + #undef SPXW + }; + +// +// EPA +// +struct EPA + { + // + struct Face + { + const GJK::Mkv* v[3]; + Face* f[3]; + U e[3]; + Vector3 n; + F d; + U mark; + Face* prev; + Face* next; + Face() {} + }; + // + GJK* gjk; + btStackAlloc* sa; + Face* root; + U nfaces; + U iterations; + Vector3 features[2][3]; + Vector3 nearest[2]; + Vector3 normal; + F depth; + Z failed; + // + EPA(GJK* pgjk) + { + gjk = pgjk; + sa = pgjk->sa; + } + // + ~EPA() + { + } + // + inline Vector3 GetCoordinates(const Face* face) const + { + const Vector3 o(face->n*-face->d); + const F a[]={ cross(face->v[0]->w-o,face->v[1]->w-o).length(), + cross(face->v[1]->w-o,face->v[2]->w-o).length(), + cross(face->v[2]->w-o,face->v[0]->w-o).length()}; + const F sm(a[0]+a[1]+a[2]); + return(Vector3(a[1],a[2],a[0])/(sm>0?sm:1)); + } + // + inline Face* FindBest() const + { + Face* bf = 0; + if(root) + { + Face* cf = root; + F bd(cstInf); + do { + if(cf->dd;bf=cf; } + } while(0!=(cf=cf->next)); + } + return(bf); + } + // + inline Z Set(Face* f,const GJK::Mkv* a,const GJK::Mkv* b,const GJK::Mkv* +c) const + { + const Vector3 nrm(cross(b->w-a->w,c->w-a->w)); + const F len(nrm.length()); + const Z valid( (cross(a->w,b->w).dot(nrm)>=-EPA_inface_eps)&& + (cross(b->w,c->w).dot(nrm)>=-EPA_inface_eps)&& + (cross(c->w,a->w).dot(nrm)>=-EPA_inface_eps)); + f->v[0] = a; + f->v[1] = b; + f->v[2] = c; + f->mark = 0; + f->n = nrm/(len>0?len:cstInf); + f->d = Max(0,-f->n.dot(a->w)); + return(valid); + } + // + inline Face* NewFace(const GJK::Mkv* a,const GJK::Mkv* b,const GJK::Mkv* c) + { + Face* pf = (Face*)sa->allocate(sizeof(Face)); + if(Set(pf,a,b,c)) + { + if(root) root->prev=pf; + pf->prev=0; + pf->next=root; + root =pf; + ++nfaces; + } + else + { + pf->prev=pf->next=0; + } + return(pf); + } + // + inline void Detach(Face* face) + { + if(face->prev||face->next) + { + --nfaces; + if(face==root) + { root=face->next;root->prev=0; } + else + { + if(face->next==0) + { face->prev->next=0; } + else + { face->prev->next=face->next;face->next->prev=face->prev; } + } + face->prev=face->next=0; + } + } + // + inline void Link(Face* f0,U e0,Face* f1,U e1) const + { + f0->f[e0]=f1;f1->e[e1]=e0; + f1->f[e1]=f0;f0->e[e0]=e1; + } + // + GJK::Mkv* Support(const Vector3& w) const + { + GJK::Mkv* v =(GJK::Mkv*)sa->allocate(sizeof(GJK::Mkv)); + gjk->Support(w,*v); + return(v); + } + // + U BuildHorizon(U markid,const GJK::Mkv* w,Face& f,U e,Face*& cf,Face*& +ff) + { + static const U mod3[]={0,1,2,0,1}; + U ne(0); + if(f.mark!=markid) + { + const U e1(mod3[e+1]); + if((f.n.dot(w->w)+f.d)>0) + { + Face* nf = NewFace(f.v[e1],f.v[e],w); + Link(nf,0,&f,e); + if(cf) Link(cf,1,nf,2); else ff=nf; + cf=nf;ne=1; + } + else + { + const U e2(mod3[e+2]); + Detach(&f); + f.mark = markid; + ne += BuildHorizon(markid,w,*f.f[e1],f.e[e1],cf,ff); + ne += BuildHorizon(markid,w,*f.f[e2],f.e[e2],cf,ff); + } + } + return(ne); + } + // + inline F EvaluatePD(F accuracy=EPA_accuracy) + { + btBlock* sablock = sa->beginBlock(); + Face* bestface = 0; + U markid(1); + depth = -cstInf; + normal = Vector3(0,0,0); + root = 0; + nfaces = 0; + iterations = 0; + failed = false; + /* Prepare hull */ + if(gjk->EncloseOrigin()) + { + const U* pfidx = 0; + U nfidx= 0; + const U* peidx = 0; + U neidx = 0; + GJK::Mkv* basemkv[5]; + Face* basefaces[6]; + switch(gjk->order) + { + /* Tetrahedron */ + case 3: { + static const U fidx[4][3]={{2,1,0},{3,0,1},{3,1,2},{3,2,0}}; + static const +U eidx[6][4]={{0,0,2,1},{0,1,1,1},{0,2,3,1},{1,0,3,2},{2,0,1,2},{3,0,2,2}}; + pfidx=(const U*)fidx;nfidx=4;peidx=(const U*)eidx;neidx=6; + } break; + /* Hexahedron */ + case 4: { + static const +U fidx[6][3]={{2,0,4},{4,1,2},{1,4,0},{0,3,1},{0,2,3},{1,3,2}}; + static const +U eidx[9][4]={{0,0,4,0},{0,1,2,1},{0,2,1,2},{1,1,5,2},{1,0,2,0},{2,2,3,2},{3,1,5,0},{3,0,4,2},{5,1,4,1}}; + pfidx=(const U*)fidx;nfidx=6;peidx=(const U*)eidx;neidx=9; + } break; + } + U i; + + for( i=0;i<=gjk->order;++i) { +basemkv[i]=(GJK::Mkv*)sa->allocate(sizeof(GJK::Mkv));*basemkv[i]=gjk->simplex[i]; +} + for( i=0;iendBlock(sablock); + return(depth); + } + /* Expand hull */ + for(;iterationsn); + const F d(bf->n.dot(w->w)+bf->d); + bestface = bf; + if(d<-accuracy) + { + Face* cf =0; + Face* ff =0; + U nf = 0; + Detach(bf); + bf->mark=++markid; + for(U i=0;i<3;++i) { +nf+=BuildHorizon(markid,w,*bf->f[i],bf->e[i],cf,ff); } + if(nf<=2) { break; } + Link(cf,1,ff,2); + } else break; + } else break; + } + /* Extract contact */ + if(bestface) + { + const Vector3 b(GetCoordinates(bestface)); + normal = bestface->n; + depth = Max(0,bestface->d); + for(U i=0;i<2;++i) + { + const F s(F(i?-1:1)); + for(U j=0;j<3;++j) + { + features[i][j]=gjk->LocalSupport(s*bestface->v[j]->r,i); + } + } + nearest[0] = features[0][0]*b.x()+features[0][1]*b.y()+features[0][2]*b.z(); + nearest[1] = features[1][0]*b.x()+features[1][1]*b.y()+features[1][2]*b.z(); + } else failed=true; + sa->endBlock(sablock); + return(depth); + } + }; +} + +// +// Api +// + +using namespace gjkepa_impl; + + + +// +bool btGjkEpaSolver::Collide(const btConvexShape *shape0,const btTransform &wtrs0, + const btConvexShape *shape1,const btTransform &wtrs1, + btScalar radialmargin, + btStackAlloc* stackAlloc, + sResults& results) +{ + + +/* Initialize */ +results.witnesses[0] = +results.witnesses[1] = +results.normal = Vector3(0,0,0); +results.depth = 0; +results.status = sResults::Separated; +results.epa_iterations = 0; +results.gjk_iterations = 0; +/* Use GJK to locate origin */ +GJK gjk(stackAlloc, + wtrs0.getBasis(),wtrs0.getOrigin(),shape0, + wtrs1.getBasis(),wtrs1.getOrigin(),shape1, + radialmargin+EPA_accuracy); +const Z collide(gjk.SearchOrigin()); +results.gjk_iterations = gjk.iterations+1; +if(collide) + { + /* Then EPA for penetration depth */ + EPA epa(&gjk); + const F pd(epa.EvaluatePD()); + results.epa_iterations = epa.iterations+1; + if(pd>0) + { + results.status = sResults::Penetrating; + results.normal = epa.normal; + results.depth = pd; + results.witnesses[0] = epa.nearest[0]; + results.witnesses[1] = epa.nearest[1]; + return(true); + } else { if(epa.failed) results.status=sResults::EPA_Failed; } + } else { if(gjk.failed) results.status=sResults::GJK_Failed; } +return(false); +} + + + + + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa.h new file mode 100644 index 000000000..1338e2714 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa.h @@ -0,0 +1,53 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +/* +GJK-EPA collision solver by Nathanael Presson +Nov.2006 +*/ + + +#ifndef _05E48D53_04E0_49ad_BB0A_D74FE62E7366_ +#define _05E48D53_04E0_49ad_BB0A_D74FE62E7366_ +#include "BulletCollision/CollisionShapes/btConvexShape.h" + +class btStackAlloc; + +///btGjkEpaSolver contributed under zlib by Nathanael Presson +struct btGjkEpaSolver +{ +struct sResults + { + enum eStatus + { + Separated, /* Shapes doesnt penetrate */ + Penetrating, /* Shapes are penetrating */ + GJK_Failed, /* GJK phase fail, no big issue, shapes are probably just 'touching' */ + EPA_Failed, /* EPA phase fail, bigger problem, need to save parameters, and debug */ + } status; + btVector3 witnesses[2]; + btVector3 normal; + btScalar depth; + int epa_iterations; + int gjk_iterations; + }; +static bool Collide(const btConvexShape* shape0,const btTransform& wtrs0, + const btConvexShape* shape1,const btTransform& wtrs1, + btScalar radialmargin, + btStackAlloc* stackAlloc, + sResults& results); +}; + +#endif diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp new file mode 100644 index 000000000..f4cf11dd8 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp @@ -0,0 +1,50 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +EPA Copyright (c) Ricardo Padrela 2006 + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "BulletCollision/CollisionShapes/btConvexShape.h" +#include "btGjkEpaPenetrationDepthSolver.h" +#include "BulletCollision/NarrowPhaseCollision/btGjkEpa.h" + +bool btGjkEpaPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& simplexSolver, + const btConvexShape* pConvexA, const btConvexShape* pConvexB, + const btTransform& transformA, const btTransform& transformB, + btVector3& v, btPoint3& wWitnessOnA, btPoint3& wWitnessOnB, + class btIDebugDraw* debugDraw, btStackAlloc* stackAlloc ) +{ + + (void)debugDraw; + (void)v; + (void)simplexSolver; + + const btScalar radialmargin(btScalar(0.)); + + btGjkEpaSolver::sResults results; + if(btGjkEpaSolver::Collide( pConvexA,transformA, + pConvexB,transformB, + radialmargin,stackAlloc,results)) + { + // debugDraw->drawLine(results.witnesses[1],results.witnesses[1]+results.normal,btVector3(255,0,0)); + //resultOut->addContactPoint(results.normal,results.witnesses[1],-results.depth); + wWitnessOnA = results.witnesses[0]; + wWitnessOnB = results.witnesses[1]; + return true; + } + + return false; +} + + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h new file mode 100644 index 000000000..2dc069ce5 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h @@ -0,0 +1,39 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +EPA Copyright (c) Ricardo Padrela 2006 + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef BT_GJP_EPA_PENETRATION_DEPTH_H +#define BT_GJP_EPA_PENETRATION_DEPTH_H + +#include "btConvexPenetrationDepthSolver.h" + +///EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to +///calculate the penetration depth between two convex shapes. +class btGjkEpaPenetrationDepthSolver : public btConvexPenetrationDepthSolver +{ + public : + + bool calcPenDepth( btSimplexSolverInterface& simplexSolver, + const btConvexShape* pConvexA, const btConvexShape* pConvexB, + const btTransform& transformA, const btTransform& transformB, + btVector3& v, btPoint3& wWitnessOnA, btPoint3& wWitnessOnB, + class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc ); + + private : + +}; + +#endif // BT_GJP_EPA_PENETRATION_DEPTH_H + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp new file mode 100644 index 000000000..c5f50d4dd --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp @@ -0,0 +1,299 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btGjkPairDetector.h" +#include "BulletCollision/CollisionShapes/btConvexShape.h" +#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h" +#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h" + +#if defined(DEBUG) || defined (_DEBUG) +#include //for debug printf +#ifdef __SPU__ +#include +#define printf spu_printf +#endif //__SPU__ +#endif + +//must be above the machine epsilon +#define REL_ERROR2 btScalar(1.0e-6) + +//temp globals, to improve GJK/EPA/penetration calculations +int gNumDeepPenetrationChecks = 0; +int gNumGjkChecks = 0; + + + +btGjkPairDetector::btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver) +:m_cachedSeparatingAxis(btScalar(0.),btScalar(0.),btScalar(1.)), +m_penetrationDepthSolver(penetrationDepthSolver), +m_simplexSolver(simplexSolver), +m_minkowskiA(objectA), +m_minkowskiB(objectB), +m_ignoreMargin(false), +m_lastUsedMethod(-1), +m_catchDegeneracies(1) +{ +} + +void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) +{ + btScalar distance=btScalar(0.); + btVector3 normalInB(btScalar(0.),btScalar(0.),btScalar(0.)); + btVector3 pointOnA,pointOnB; + btTransform localTransA = input.m_transformA; + btTransform localTransB = input.m_transformB; + btVector3 positionOffset = (localTransA.getOrigin() + localTransB.getOrigin()) * btScalar(0.5); + localTransA.getOrigin() -= positionOffset; + localTransB.getOrigin() -= positionOffset; + + btScalar marginA = m_minkowskiA->getMargin(); + btScalar marginB = m_minkowskiB->getMargin(); + + gNumGjkChecks++; + + //for CCD we don't use margins + if (m_ignoreMargin) + { + marginA = btScalar(0.); + marginB = btScalar(0.); + } + + m_curIter = 0; + int gGjkMaxIter = 1000;//this is to catch invalid input, perhaps check for #NaN? + m_cachedSeparatingAxis.setValue(0,1,0); + + bool isValid = false; + bool checkSimplex = false; + bool checkPenetration = true; + m_degenerateSimplex = 0; + + m_lastUsedMethod = -1; + + { + btScalar squaredDistance = SIMD_INFINITY; + btScalar delta = btScalar(0.); + + btScalar margin = marginA + marginB; + + + + m_simplexSolver->reset(); + + for ( ; ; ) + //while (true) + { + + btVector3 seperatingAxisInA = (-m_cachedSeparatingAxis)* input.m_transformA.getBasis(); + btVector3 seperatingAxisInB = m_cachedSeparatingAxis* input.m_transformB.getBasis(); + + btVector3 pInA = m_minkowskiA->localGetSupportingVertexWithoutMargin(seperatingAxisInA); + btVector3 qInB = m_minkowskiB->localGetSupportingVertexWithoutMargin(seperatingAxisInB); + btPoint3 pWorld = localTransA(pInA); + btPoint3 qWorld = localTransB(qInB); + + btVector3 w = pWorld - qWorld; + delta = m_cachedSeparatingAxis.dot(w); + + // potential exit, they don't overlap + if ((delta > btScalar(0.0)) && (delta * delta > squaredDistance * input.m_maximumDistanceSquared)) + { + checkPenetration = false; + break; + } + + //exit 0: the new point is already in the simplex, or we didn't come any closer + if (m_simplexSolver->inSimplex(w)) + { + m_degenerateSimplex = 1; + checkSimplex = true; + break; + } + // are we getting any closer ? + btScalar f0 = squaredDistance - delta; + btScalar f1 = squaredDistance * REL_ERROR2; + + if (f0 <= f1) + { + if (f0 <= btScalar(0.)) + { + m_degenerateSimplex = 2; + } + checkSimplex = true; + break; + } + //add current vertex to simplex + m_simplexSolver->addVertex(w, pWorld, qWorld); + + //calculate the closest point to the origin (update vector v) + if (!m_simplexSolver->closest(m_cachedSeparatingAxis)) + { + m_degenerateSimplex = 3; + checkSimplex = true; + break; + } + + btScalar previousSquaredDistance = squaredDistance; + squaredDistance = m_cachedSeparatingAxis.length2(); + + //redundant m_simplexSolver->compute_points(pointOnA, pointOnB); + + //are we getting any closer ? + if (previousSquaredDistance - squaredDistance <= SIMD_EPSILON * previousSquaredDistance) + { + m_simplexSolver->backup_closest(m_cachedSeparatingAxis); + checkSimplex = true; + break; + } + + //degeneracy, this is typically due to invalid/uninitialized worldtransforms for a btCollisionObject + if (m_curIter++ > gGjkMaxIter) + { + #if defined(DEBUG) || defined (_DEBUG) + + printf("btGjkPairDetector maxIter exceeded:%i\n",m_curIter); + printf("sepAxis=(%f,%f,%f), squaredDistance = %f, shapeTypeA=%i,shapeTypeB=%i\n", + m_cachedSeparatingAxis.getX(), + m_cachedSeparatingAxis.getY(), + m_cachedSeparatingAxis.getZ(), + squaredDistance, + m_minkowskiA->getShapeType(), + m_minkowskiB->getShapeType()); + + #endif + break; + + } + + + bool check = (!m_simplexSolver->fullSimplex()); + //bool check = (!m_simplexSolver->fullSimplex() && squaredDistance > SIMD_EPSILON * m_simplexSolver->maxVertex()); + + if (!check) + { + //do we need this backup_closest here ? + m_simplexSolver->backup_closest(m_cachedSeparatingAxis); + break; + } + } + + if (checkSimplex) + { + m_simplexSolver->compute_points(pointOnA, pointOnB); + normalInB = pointOnA-pointOnB; + btScalar lenSqr = m_cachedSeparatingAxis.length2(); + //valid normal + if (lenSqr < 0.0001) + { + m_degenerateSimplex = 5; + } + if (lenSqr > SIMD_EPSILON*SIMD_EPSILON) + { + btScalar rlen = btScalar(1.) / btSqrt(lenSqr ); + normalInB *= rlen; //normalize + btScalar s = btSqrt(squaredDistance); + + btAssert(s > btScalar(0.0)); + pointOnA -= m_cachedSeparatingAxis * (marginA / s); + pointOnB += m_cachedSeparatingAxis * (marginB / s); + distance = ((btScalar(1.)/rlen) - margin); + isValid = true; + + m_lastUsedMethod = 1; + } else + { + m_lastUsedMethod = 2; + } + } + + bool catchDegeneratePenetrationCase = + (m_catchDegeneracies && m_penetrationDepthSolver && m_degenerateSimplex && ((distance+margin) < 0.01)); + + //if (checkPenetration && !isValid) + if (checkPenetration && (!isValid || catchDegeneratePenetrationCase )) + { + //penetration case + + //if there is no way to handle penetrations, bail out + if (m_penetrationDepthSolver) + { + // Penetration depth case. + btVector3 tmpPointOnA,tmpPointOnB; + + gNumDeepPenetrationChecks++; + + bool isValid2 = m_penetrationDepthSolver->calcPenDepth( + *m_simplexSolver, + m_minkowskiA,m_minkowskiB, + localTransA,localTransB, + m_cachedSeparatingAxis, tmpPointOnA, tmpPointOnB, + debugDraw,input.m_stackAlloc + ); + + if (isValid2) + { + btVector3 tmpNormalInB = tmpPointOnB-tmpPointOnA; + btScalar lenSqr = tmpNormalInB.length2(); + if (lenSqr > (SIMD_EPSILON*SIMD_EPSILON)) + { + tmpNormalInB /= btSqrt(lenSqr); + btScalar distance2 = -(tmpPointOnA-tmpPointOnB).length(); + //only replace valid penetrations when the result is deeper (check) + if (!isValid || (distance2 < distance)) + { + distance = distance2; + pointOnA = tmpPointOnA; + pointOnB = tmpPointOnB; + normalInB = tmpNormalInB; + isValid = true; + m_lastUsedMethod = 3; + } else + { + + } + } else + { + //isValid = false; + m_lastUsedMethod = 4; + } + } else + { + m_lastUsedMethod = 5; + } + + } + } + } + + if (isValid) + { +#ifdef __SPU__ + //spu_printf("distance\n"); +#endif //__CELLOS_LV2__ + + + output.addContactPoint( + normalInB, + pointOnB+positionOffset, + distance); + //printf("gjk add:%f",distance); + } + + +} + + + + + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h new file mode 100644 index 000000000..1ec51f740 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h @@ -0,0 +1,85 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + + +#ifndef GJK_PAIR_DETECTOR_H +#define GJK_PAIR_DETECTOR_H + +#include "btDiscreteCollisionDetectorInterface.h" +#include "LinearMath/btPoint3.h" +#include "BulletCollision/CollisionShapes/btCollisionMargin.h" + +class btConvexShape; +#include "btSimplexSolverInterface.h" +class btConvexPenetrationDepthSolver; + +/// btGjkPairDetector uses GJK to implement the btDiscreteCollisionDetectorInterface +class btGjkPairDetector : public btDiscreteCollisionDetectorInterface +{ + + + btVector3 m_cachedSeparatingAxis; + btConvexPenetrationDepthSolver* m_penetrationDepthSolver; + btSimplexSolverInterface* m_simplexSolver; + const btConvexShape* m_minkowskiA; + const btConvexShape* m_minkowskiB; + bool m_ignoreMargin; + + +public: + + //some debugging to fix degeneracy problems + int m_lastUsedMethod; + int m_curIter; + int m_degenerateSimplex; + int m_catchDegeneracies; + + + btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver); + virtual ~btGjkPairDetector() {}; + + virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw); + + void setMinkowskiA(btConvexShape* minkA) + { + m_minkowskiA = minkA; + } + + void setMinkowskiB(btConvexShape* minkB) + { + m_minkowskiB = minkB; + } + void setCachedSeperatingAxis(const btVector3& seperatingAxis) + { + m_cachedSeparatingAxis = seperatingAxis; + } + + void setPenetrationDepthSolver(btConvexPenetrationDepthSolver* penetrationDepthSolver) + { + m_penetrationDepthSolver = penetrationDepthSolver; + } + + ///don't use setIgnoreMargin, it's for Bullet's internal use + void setIgnoreMargin(bool ignoreMargin) + { + m_ignoreMargin = ignoreMargin; + } + + +}; + +#endif //GJK_PAIR_DETECTOR_H diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h new file mode 100644 index 000000000..1933d378f --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h @@ -0,0 +1,99 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef MANIFOLD_CONTACT_POINT_H +#define MANIFOLD_CONTACT_POINT_H + +#include "LinearMath/btVector3.h" +#include "LinearMath/btTransformUtil.h" + + + + + +/// ManifoldContactPoint collects and maintains persistent contactpoints. +/// used to improve stability and performance of rigidbody dynamics response. +class btManifoldPoint + { + public: + btManifoldPoint() + :m_userPersistentData(0), + m_lifeTime(0) + { + } + + btManifoldPoint( const btVector3 &pointA, const btVector3 &pointB, + const btVector3 &normal, + btScalar distance ) : + m_localPointA( pointA ), + m_localPointB( pointB ), + m_normalWorldOnB( normal ), + m_distance1( distance ), + m_combinedFriction(btScalar(0.)), + m_combinedRestitution(btScalar(0.)), + m_userPersistentData(0), + m_lifeTime(0) + { + + + } + + + + btVector3 m_localPointA; + btVector3 m_localPointB; + btVector3 m_positionWorldOnB; + ///m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity + btVector3 m_positionWorldOnA; + btVector3 m_normalWorldOnB; + + btScalar m_distance1; + btScalar m_combinedFriction; + btScalar m_combinedRestitution; + + + mutable void* m_userPersistentData; + + int m_lifeTime;//lifetime of the contactpoint in frames + + btScalar getDistance() const + { + return m_distance1; + } + int getLifeTime() const + { + return m_lifeTime; + } + + const btVector3& getPositionWorldOnA() const { + return m_positionWorldOnA; +// return m_positionWorldOnB + m_normalWorldOnB * m_distance1; + } + + const btVector3& getPositionWorldOnB() const + { + return m_positionWorldOnB; + } + + void setDistance(btScalar dist) + { + m_distance1 = dist; + } + + + + }; + +#endif //MANIFOLD_CONTACT_POINT_H diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp new file mode 100644 index 000000000..100bc2407 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp @@ -0,0 +1,333 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btMinkowskiPenetrationDepthSolver.h" +#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h" +#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h" +#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h" +#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h" + + + + +#define NUM_UNITSPHERE_POINTS 42 +static btVector3 sPenetrationDirections[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2] = +{ +btVector3(btScalar(0.000000) , btScalar(-0.000000),btScalar(-1.000000)), +btVector3(btScalar(0.723608) , btScalar(-0.525725),btScalar(-0.447219)), +btVector3(btScalar(-0.276388) , btScalar(-0.850649),btScalar(-0.447219)), +btVector3(btScalar(-0.894426) , btScalar(-0.000000),btScalar(-0.447216)), +btVector3(btScalar(-0.276388) , btScalar(0.850649),btScalar(-0.447220)), +btVector3(btScalar(0.723608) , btScalar(0.525725),btScalar(-0.447219)), +btVector3(btScalar(0.276388) , btScalar(-0.850649),btScalar(0.447220)), +btVector3(btScalar(-0.723608) , btScalar(-0.525725),btScalar(0.447219)), +btVector3(btScalar(-0.723608) , btScalar(0.525725),btScalar(0.447219)), +btVector3(btScalar(0.276388) , btScalar(0.850649),btScalar(0.447219)), +btVector3(btScalar(0.894426) , btScalar(0.000000),btScalar(0.447216)), +btVector3(btScalar(-0.000000) , btScalar(0.000000),btScalar(1.000000)), +btVector3(btScalar(0.425323) , btScalar(-0.309011),btScalar(-0.850654)), +btVector3(btScalar(-0.162456) , btScalar(-0.499995),btScalar(-0.850654)), +btVector3(btScalar(0.262869) , btScalar(-0.809012),btScalar(-0.525738)), +btVector3(btScalar(0.425323) , btScalar(0.309011),btScalar(-0.850654)), +btVector3(btScalar(0.850648) , btScalar(-0.000000),btScalar(-0.525736)), +btVector3(btScalar(-0.525730) , btScalar(-0.000000),btScalar(-0.850652)), +btVector3(btScalar(-0.688190) , btScalar(-0.499997),btScalar(-0.525736)), +btVector3(btScalar(-0.162456) , btScalar(0.499995),btScalar(-0.850654)), +btVector3(btScalar(-0.688190) , btScalar(0.499997),btScalar(-0.525736)), +btVector3(btScalar(0.262869) , btScalar(0.809012),btScalar(-0.525738)), +btVector3(btScalar(0.951058) , btScalar(0.309013),btScalar(0.000000)), +btVector3(btScalar(0.951058) , btScalar(-0.309013),btScalar(0.000000)), +btVector3(btScalar(0.587786) , btScalar(-0.809017),btScalar(0.000000)), +btVector3(btScalar(0.000000) , btScalar(-1.000000),btScalar(0.000000)), +btVector3(btScalar(-0.587786) , btScalar(-0.809017),btScalar(0.000000)), +btVector3(btScalar(-0.951058) , btScalar(-0.309013),btScalar(-0.000000)), +btVector3(btScalar(-0.951058) , btScalar(0.309013),btScalar(-0.000000)), +btVector3(btScalar(-0.587786) , btScalar(0.809017),btScalar(-0.000000)), +btVector3(btScalar(-0.000000) , btScalar(1.000000),btScalar(-0.000000)), +btVector3(btScalar(0.587786) , btScalar(0.809017),btScalar(-0.000000)), +btVector3(btScalar(0.688190) , btScalar(-0.499997),btScalar(0.525736)), +btVector3(btScalar(-0.262869) , btScalar(-0.809012),btScalar(0.525738)), +btVector3(btScalar(-0.850648) , btScalar(0.000000),btScalar(0.525736)), +btVector3(btScalar(-0.262869) , btScalar(0.809012),btScalar(0.525738)), +btVector3(btScalar(0.688190) , btScalar(0.499997),btScalar(0.525736)), +btVector3(btScalar(0.525730) , btScalar(0.000000),btScalar(0.850652)), +btVector3(btScalar(0.162456) , btScalar(-0.499995),btScalar(0.850654)), +btVector3(btScalar(-0.425323) , btScalar(-0.309011),btScalar(0.850654)), +btVector3(btScalar(-0.425323) , btScalar(0.309011),btScalar(0.850654)), +btVector3(btScalar(0.162456) , btScalar(0.499995),btScalar(0.850654)) +}; + + +bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& simplexSolver, + const btConvexShape* convexA,const btConvexShape* convexB, + const btTransform& transA,const btTransform& transB, + btVector3& v, btPoint3& pa, btPoint3& pb, + class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc + ) +{ + + (void)stackAlloc; + (void)v; + + + struct btIntermediateResult : public btDiscreteCollisionDetectorInterface::Result + { + + btIntermediateResult():m_hasResult(false) + { + } + + btVector3 m_normalOnBInWorld; + btVector3 m_pointInWorld; + btScalar m_depth; + bool m_hasResult; + + virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1) + { + (void)partId0; + (void)index0; + (void)partId1; + (void)index1; + } + void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth) + { + m_normalOnBInWorld = normalOnBInWorld; + m_pointInWorld = pointInWorld; + m_depth = depth; + m_hasResult = true; + } + }; + + //just take fixed number of orientation, and sample the penetration depth in that direction + btScalar minProj = btScalar(1e30); + btVector3 minNorm(btScalar(0.), btScalar(0.), btScalar(0.)); + btVector3 minA,minB; + btVector3 seperatingAxisInA,seperatingAxisInB; + btVector3 pInA,qInB,pWorld,qWorld,w; + +#define USE_BATCHED_SUPPORT 1 +#ifdef USE_BATCHED_SUPPORT + + btVector3 supportVerticesABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2]; + btVector3 supportVerticesBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2]; + btVector3 seperatingAxisInABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2]; + btVector3 seperatingAxisInBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2]; + int i; + + int numSampleDirections = NUM_UNITSPHERE_POINTS; + + for (i=0;igetNumPreferredPenetrationDirections(); + if (numPDA) + { + for (int i=0;igetPreferredPenetrationDirection(i,norm); + norm = transA.getBasis() * norm; + sPenetrationDirections[numSampleDirections] = norm; + seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis(); + seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis(); + numSampleDirections++; + } + } + } + + { + int numPDB = convexB->getNumPreferredPenetrationDirections(); + if (numPDB) + { + for (int i=0;igetPreferredPenetrationDirection(i,norm); + norm = transB.getBasis() * norm; + sPenetrationDirections[numSampleDirections] = norm; + seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis(); + seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis(); + numSampleDirections++; + } + } + } + + + + convexA->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInABatch,supportVerticesABatch,numSampleDirections); + convexB->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInBBatch,supportVerticesBBatch,numSampleDirections); + + for (i=0;igetNumPreferredPenetrationDirections(); + if (numPDA) + { + for (int i=0;igetPreferredPenetrationDirection(i,norm); + norm = transA.getBasis() * norm; + sPenetrationDirections[numSampleDirections] = norm; + numSampleDirections++; + } + } + } + + { + int numPDB = convexB->getNumPreferredPenetrationDirections(); + if (numPDB) + { + for (int i=0;igetPreferredPenetrationDirection(i,norm); + norm = transB.getBasis() * norm; + sPenetrationDirections[numSampleDirections] = norm; + numSampleDirections++; + } + } + } + + for (int i=0;ilocalGetSupportingVertexWithoutMargin(seperatingAxisInA); + qInB = convexB->localGetSupportingVertexWithoutMargin(seperatingAxisInB); + pWorld = transA(pInA); + qWorld = transB(qInB); + w = qWorld - pWorld; + btScalar delta = norm.dot(w); + //find smallest delta + if (delta < minProj) + { + minProj = delta; + minNorm = norm; + minA = pWorld; + minB = qWorld; + } + } +#endif //USE_BATCHED_SUPPORT + + //add the margins + + minA += minNorm*convexA->getMargin(); + minB -= minNorm*convexB->getMargin(); + //no penetration + if (minProj < btScalar(0.)) + return false; + + minProj += (convexA->getMargin() + convexB->getMargin()); + + + + + +//#define DEBUG_DRAW 1 +#ifdef DEBUG_DRAW + if (debugDraw) + { + btVector3 color(0,1,0); + debugDraw->drawLine(minA,minB,color); + color = btVector3 (1,1,1); + btVector3 vec = minB-minA; + btScalar prj2 = minNorm.dot(vec); + debugDraw->drawLine(minA,minA+(minNorm*minProj),color); + + } +#endif //DEBUG_DRAW + + + + btGjkPairDetector gjkdet(convexA,convexB,&simplexSolver,0); + + btScalar offsetDist = minProj; + btVector3 offset = minNorm * offsetDist; + + + + btGjkPairDetector::ClosestPointInput input; + + btVector3 newOrg = transA.getOrigin() + offset; + + btTransform displacedTrans = transA; + displacedTrans.setOrigin(newOrg); + + input.m_transformA = displacedTrans; + input.m_transformB = transB; + input.m_maximumDistanceSquared = btScalar(1e30);//minProj; + + btIntermediateResult res; + gjkdet.getClosestPoints(input,res,debugDraw); + + btScalar correctedMinNorm = minProj - res.m_depth; + + + //the penetration depth is over-estimated, relax it + btScalar penetration_relaxation= btScalar(1.); + minNorm*=penetration_relaxation; + + if (res.m_hasResult) + { + + pa = res.m_pointInWorld - minNorm * correctedMinNorm; + pb = res.m_pointInWorld; + +#ifdef DEBUG_DRAW + if (debugDraw) + { + btVector3 color(1,0,0); + debugDraw->drawLine(pa,pb,color); + } +#endif//DEBUG_DRAW + + + } + return res.m_hasResult; +} + + + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h new file mode 100644 index 000000000..27b42c2b4 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h @@ -0,0 +1,37 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef MINKOWSKI_PENETRATION_DEPTH_SOLVER_H +#define MINKOWSKI_PENETRATION_DEPTH_SOLVER_H + +#include "btConvexPenetrationDepthSolver.h" + +///MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation. +///Implementation is based on sampling the depth using support mapping, and using GJK step to get the witness points. +class btMinkowskiPenetrationDepthSolver : public btConvexPenetrationDepthSolver +{ +public: + + virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver, + const btConvexShape* convexA,const btConvexShape* convexB, + const btTransform& transA,const btTransform& transB, + btVector3& v, btPoint3& pa, btPoint3& pb, + class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc + ); + +}; + +#endif //MINKOWSKI_PENETRATION_DEPTH_SOLVER_H + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp new file mode 100644 index 000000000..ee94ee011 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp @@ -0,0 +1,248 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btPersistentManifold.h" +#include "LinearMath/btTransform.h" +#include + +btScalar gContactBreakingThreshold = btScalar(0.02); +ContactDestroyedCallback gContactDestroyedCallback = 0; + + + +btPersistentManifold::btPersistentManifold() +:m_body0(0), +m_body1(0), +m_cachedPoints (0), +m_index1a(0) +{ +} + + + + +#ifdef DEBUG_PERSISTENCY +#include +void btPersistentManifold::DebugPersistency() +{ + int i; + printf("DebugPersistency : numPoints %d\n",m_cachedPoints); + for (i=0;i1) + printf("error in clearUserCache\n"); + } + } + assert(occurance<=0); +#endif //DEBUG_PERSISTENCY + + if (pt.m_userPersistentData && gContactDestroyedCallback) + { + (*gContactDestroyedCallback)(pt.m_userPersistentData); + pt.m_userPersistentData = 0; + } + +#ifdef DEBUG_PERSISTENCY + DebugPersistency(); +#endif + } + + +} + + +int btPersistentManifold::sortCachedPoints(const btManifoldPoint& pt) +{ + + //calculate 4 possible cases areas, and take biggest area + //also need to keep 'deepest' + + int maxPenetrationIndex = -1; +#define KEEP_DEEPEST_POINT 1 +#ifdef KEEP_DEEPEST_POINT + btScalar maxPenetration = pt.getDistance(); + for (int i=0;i<4;i++) + { + if (m_pointCache[i].getDistance() < maxPenetration) + { + maxPenetrationIndex = i; + maxPenetration = m_pointCache[i].getDistance(); + } + } +#endif //KEEP_DEEPEST_POINT + + btScalar res0(btScalar(0.)),res1(btScalar(0.)),res2(btScalar(0.)),res3(btScalar(0.)); + if (maxPenetrationIndex != 0) + { + btVector3 a0 = pt.m_localPointA-m_pointCache[1].m_localPointA; + btVector3 b0 = m_pointCache[3].m_localPointA-m_pointCache[2].m_localPointA; + btVector3 cross = a0.cross(b0); + res0 = cross.length2(); + } + if (maxPenetrationIndex != 1) + { + btVector3 a1 = pt.m_localPointA-m_pointCache[0].m_localPointA; + btVector3 b1 = m_pointCache[3].m_localPointA-m_pointCache[2].m_localPointA; + btVector3 cross = a1.cross(b1); + res1 = cross.length2(); + } + + if (maxPenetrationIndex != 2) + { + btVector3 a2 = pt.m_localPointA-m_pointCache[0].m_localPointA; + btVector3 b2 = m_pointCache[3].m_localPointA-m_pointCache[1].m_localPointA; + btVector3 cross = a2.cross(b2); + res2 = cross.length2(); + } + + if (maxPenetrationIndex != 3) + { + btVector3 a3 = pt.m_localPointA-m_pointCache[0].m_localPointA; + btVector3 b3 = m_pointCache[2].m_localPointA-m_pointCache[1].m_localPointA; + btVector3 cross = a3.cross(b3); + res3 = cross.length2(); + } + + btVector4 maxvec(res0,res1,res2,res3); + int biggestarea = maxvec.closestAxis4(); + return biggestarea; +} + + +int btPersistentManifold::getCacheEntry(const btManifoldPoint& newPoint) const +{ + btScalar shortestDist = getContactBreakingThreshold() * getContactBreakingThreshold(); + int size = getNumContacts(); + int nearestPoint = -1; + for( int i = 0; i < size; i++ ) + { + const btManifoldPoint &mp = m_pointCache[i]; + + btVector3 diffA = mp.m_localPointA- newPoint.m_localPointA; + const btScalar distToManiPoint = diffA.dot(diffA); + if( distToManiPoint < shortestDist ) + { + shortestDist = distToManiPoint; + nearestPoint = i; + } + } + return nearestPoint; +} + +void btPersistentManifold::AddManifoldPoint(const btManifoldPoint& newPoint) +{ + assert(validContactDistance(newPoint)); + + int insertIndex = getNumContacts(); + if (insertIndex == MANIFOLD_CACHE_SIZE) + { +#if MANIFOLD_CACHE_SIZE >= 4 + //sort cache so best points come first, based on area + insertIndex = sortCachedPoints(newPoint); +#else + insertIndex = 0; +#endif + + + } else + { + m_cachedPoints++; + + + } + replaceContactPoint(newPoint,insertIndex); +} + +btScalar btPersistentManifold::getContactBreakingThreshold() const +{ + return gContactBreakingThreshold; +} + + + +void btPersistentManifold::refreshContactPoints(const btTransform& trA,const btTransform& trB) +{ + int i; +#ifdef DEBUG_PERSISTENCY + printf("refreshContactPoints posA = (%f,%f,%f) posB = (%f,%f,%f)\n", + trA.getOrigin().getX(), + trA.getOrigin().getY(), + trA.getOrigin().getZ(), + trB.getOrigin().getX(), + trB.getOrigin().getY(), + trB.getOrigin().getZ()); +#endif //DEBUG_PERSISTENCY + /// first refresh worldspace positions and distance + for (i=getNumContacts()-1;i>=0;i--) + { + btManifoldPoint &manifoldPoint = m_pointCache[i]; + manifoldPoint.m_positionWorldOnA = trA( manifoldPoint.m_localPointA ); + manifoldPoint.m_positionWorldOnB = trB( manifoldPoint.m_localPointB ); + manifoldPoint.m_distance1 = (manifoldPoint.m_positionWorldOnA - manifoldPoint.m_positionWorldOnB).dot(manifoldPoint.m_normalWorldOnB); + manifoldPoint.m_lifeTime++; + } + + /// then + btScalar distance2d; + btVector3 projectedDifference,projectedPoint; + for (i=getNumContacts()-1;i>=0;i--) + { + + btManifoldPoint &manifoldPoint = m_pointCache[i]; + //contact becomes invalid when signed distance exceeds margin (projected on contactnormal direction) + if (!validContactDistance(manifoldPoint)) + { + removeContactPoint(i); + } else + { + //contact also becomes invalid when relative movement orthogonal to normal exceeds margin + projectedPoint = manifoldPoint.m_positionWorldOnA - manifoldPoint.m_normalWorldOnB * manifoldPoint.m_distance1; + projectedDifference = manifoldPoint.m_positionWorldOnB - projectedPoint; + distance2d = projectedDifference.dot(projectedDifference); + if (distance2d > getContactBreakingThreshold()*getContactBreakingThreshold() ) + { + removeContactPoint(i); + } + } + } +#ifdef DEBUG_PERSISTENCY + DebugPersistency(); +#endif // +} + + + + + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h new file mode 100644 index 000000000..f0b1ce58d --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h @@ -0,0 +1,179 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef PERSISTENT_MANIFOLD_H +#define PERSISTENT_MANIFOLD_H + + +#include "LinearMath/btVector3.h" +#include "LinearMath/btTransform.h" +#include "btManifoldPoint.h" +#include "LinearMath/btAlignedAllocator.h" + +struct btCollisionResult; + +///contact breaking and merging threshold +extern btScalar gContactBreakingThreshold; + +typedef bool (*ContactDestroyedCallback)(void* userPersistentData); +extern ContactDestroyedCallback gContactDestroyedCallback; + + + + +#define MANIFOLD_CACHE_SIZE 4 + +///btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping in the broadphase. +///Those contact points are created by the collision narrow phase. +///The cache can be empty, or hold 1,2,3 or 4 points. Some collision algorithms (GJK) might only add one point at a time. +///updates/refreshes old contact points, and throw them away if necessary (distance becomes too large) +///reduces the cache to 4 points, when more then 4 points are added, using following rules: +///the contact point with deepest penetration is always kept, and it tries to maximuze the area covered by the points +///note that some pairs of objects might have more then one contact manifold. +ATTRIBUTE_ALIGNED16( class) btPersistentManifold +{ + + btManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE]; + + /// this two body pointers can point to the physics rigidbody class. + /// void* will allow any rigidbody class + void* m_body0; + void* m_body1; + int m_cachedPoints; + + + /// sort cached points so most isolated points come first + int sortCachedPoints(const btManifoldPoint& pt); + + int findContactPoint(const btManifoldPoint* unUsed, int numUnused,const btManifoldPoint& pt); + +public: + + BT_DECLARE_ALIGNED_ALLOCATOR(); + + int m_index1a; + + btPersistentManifold(); + + btPersistentManifold(void* body0,void* body1,int bla) + : m_body0(body0),m_body1(body1),m_cachedPoints(0) + { + } + + SIMD_FORCE_INLINE void* getBody0() { return m_body0;} + SIMD_FORCE_INLINE void* getBody1() { return m_body1;} + + SIMD_FORCE_INLINE const void* getBody0() const { return m_body0;} + SIMD_FORCE_INLINE const void* getBody1() const { return m_body1;} + + void setBodies(void* body0,void* body1) + { + m_body0 = body0; + m_body1 = body1; + } + + void clearUserCache(btManifoldPoint& pt); + +#ifdef DEBUG_PERSISTENCY + void DebugPersistency(); +#endif // + + SIMD_FORCE_INLINE int getNumContacts() const { return m_cachedPoints;} + + SIMD_FORCE_INLINE const btManifoldPoint& getContactPoint(int index) const + { + btAssert(index < m_cachedPoints); + return m_pointCache[index]; + } + + SIMD_FORCE_INLINE btManifoldPoint& getContactPoint(int index) + { + btAssert(index < m_cachedPoints); + return m_pointCache[index]; + } + + /// todo: get this margin from the current physics / collision environment + btScalar getContactBreakingThreshold() const; + + int getCacheEntry(const btManifoldPoint& newPoint) const; + + void AddManifoldPoint( const btManifoldPoint& newPoint); + + void removeContactPoint (int index) + { + clearUserCache(m_pointCache[index]); + + int lastUsedIndex = getNumContacts() - 1; +// m_pointCache[index] = m_pointCache[lastUsedIndex]; + if(index != lastUsedIndex) + { + m_pointCache[index] = m_pointCache[lastUsedIndex]; + //get rid of duplicated userPersistentData pointer + m_pointCache[lastUsedIndex].m_userPersistentData = 0; + m_pointCache[lastUsedIndex].m_lifeTime = 0; + } + + btAssert(m_pointCache[lastUsedIndex].m_userPersistentData==0); + m_cachedPoints--; + } + void replaceContactPoint(const btManifoldPoint& newPoint,int insertIndex) + { + btAssert(validContactDistance(newPoint)); + +#define MAINTAIN_PERSISTENCY 1 +#ifdef MAINTAIN_PERSISTENCY + int lifeTime = m_pointCache[insertIndex].getLifeTime(); + btAssert(lifeTime>=0); + void* cache = m_pointCache[insertIndex].m_userPersistentData; + + m_pointCache[insertIndex] = newPoint; + + m_pointCache[insertIndex].m_userPersistentData = cache; + m_pointCache[insertIndex].m_lifeTime = lifeTime; +#else + clearUserCache(m_pointCache[insertIndex]); + m_pointCache[insertIndex] = newPoint; + +#endif + } + + bool validContactDistance(const btManifoldPoint& pt) const + { + return pt.m_distance1 <= getContactBreakingThreshold(); + } + /// calculated new worldspace coordinates and depth, and reject points that exceed the collision margin + void refreshContactPoints( const btTransform& trA,const btTransform& trB); + + + SIMD_FORCE_INLINE void clearManifold() + { + int i; + for (i=0;i= btScalar(0.0) ) + { + return ; // same sign + } + + const btScalar proj_length=dist_a-dist_b; + const btScalar distance = (dist_a)/(proj_length); + // Now we have the intersection point on the plane, we'll see if it's inside the triangle + // Add an epsilon as a tolerance for the raycast, + // in case the ray hits exacly on the edge of the triangle. + // It must be scaled for the triangle size. + + if(distance < m_hitFraction) + { + + + btScalar edge_tolerance =triangleNormal.length2(); + edge_tolerance *= btScalar(-0.0001); + btVector3 point; point.setInterpolate3( m_from, m_to, distance); + { + btVector3 v0p; v0p = vert0 - point; + btVector3 v1p; v1p = vert1 - point; + btVector3 cp0; cp0 = v0p.cross( v1p ); + + if ( (btScalar)(cp0.dot(triangleNormal)) >=edge_tolerance) + { + + + btVector3 v2p; v2p = vert2 - point; + btVector3 cp1; + cp1 = v1p.cross( v2p); + if ( (btScalar)(cp1.dot(triangleNormal)) >=edge_tolerance) + { + btVector3 cp2; + cp2 = v2p.cross(v0p); + + if ( (btScalar)(cp2.dot(triangleNormal)) >=edge_tolerance) + { + + if ( dist_a > 0 ) + { + m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex); + } + else + { + m_hitFraction = reportHit(-triangleNormal,distance,partId,triangleIndex); + } + } + } + } + } + } +} diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h new file mode 100644 index 000000000..87490a345 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h @@ -0,0 +1,42 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef RAYCAST_TRI_CALLBACK_H +#define RAYCAST_TRI_CALLBACK_H + +#include "BulletCollision/CollisionShapes/btTriangleCallback.h" +struct btBroadphaseProxy; + + +class btTriangleRaycastCallback: public btTriangleCallback +{ +public: + + //input + btVector3 m_from; + btVector3 m_to; + + btScalar m_hitFraction; + + btTriangleRaycastCallback(const btVector3& from,const btVector3& to); + + virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex); + + virtual btScalar reportHit(const btVector3& hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex ) = 0; + +}; + +#endif //RAYCAST_TRI_CALLBACK_H + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h new file mode 100644 index 000000000..cf65f4650 --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h @@ -0,0 +1,64 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef SIMPLEX_SOLVER_INTERFACE_H +#define SIMPLEX_SOLVER_INTERFACE_H + +#include "LinearMath/btVector3.h" +#include "LinearMath/btPoint3.h" + +#define NO_VIRTUAL_INTERFACE 1 +#ifdef NO_VIRTUAL_INTERFACE +#include "btVoronoiSimplexSolver.h" +#define btSimplexSolverInterface btVoronoiSimplexSolver +#else + +/// btSimplexSolverInterface can incrementally calculate distance between origin and up to 4 vertices +/// Used by GJK or Linear Casting. Can be implemented by the Johnson-algorithm or alternative approaches based on +/// voronoi regions or barycentric coordinates +class btSimplexSolverInterface +{ + public: + virtual ~btSimplexSolverInterface() {}; + + virtual void reset() = 0; + + virtual void addVertex(const btVector3& w, const btPoint3& p, const btPoint3& q) = 0; + + virtual bool closest(btVector3& v) = 0; + + virtual btScalar maxVertex() = 0; + + virtual bool fullSimplex() const = 0; + + virtual int getSimplex(btPoint3 *pBuf, btPoint3 *qBuf, btVector3 *yBuf) const = 0; + + virtual bool inSimplex(const btVector3& w) = 0; + + virtual void backup_closest(btVector3& v) = 0; + + virtual bool emptySimplex() const = 0; + + virtual void compute_points(btPoint3& p1, btPoint3& p2) = 0; + + virtual int numVertices() const =0; + + +}; +#endif +#endif //SIMPLEX_SOLVER_INTERFACE_H + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp new file mode 100644 index 000000000..687738b7f --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp @@ -0,0 +1,139 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btSubSimplexConvexCast.h" +#include "BulletCollision/CollisionShapes/btConvexShape.h" +#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h" +#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h" + + +btSubsimplexConvexCast::btSubsimplexConvexCast (const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver) +:m_simplexSolver(simplexSolver), +m_convexA(convexA),m_convexB(convexB) +{ +} + +///Typically the conservative advancement reaches solution in a few iterations, clip it to 32 for degenerate cases. +///See discussion about this here http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=565 +#ifdef BT_USE_DOUBLE_PRECISION +#define MAX_ITERATIONS 64 +#else +#define MAX_ITERATIONS 32 +#endif +bool btSubsimplexConvexCast::calcTimeOfImpact( + const btTransform& fromA, + const btTransform& toA, + const btTransform& fromB, + const btTransform& toB, + CastResult& result) +{ + + btMinkowskiSumShape combi(m_convexA,m_convexB); + btMinkowskiSumShape* convex = &combi; + + btTransform rayFromLocalA; + btTransform rayToLocalA; + + rayFromLocalA = fromA.inverse()* fromB; + rayToLocalA = toA.inverse()* toB; + + + m_simplexSolver->reset(); + + convex->setTransformB(btTransform(rayFromLocalA.getBasis())); + + //btScalar radius = btScalar(0.01); + + btScalar lambda = btScalar(0.); + //todo: need to verify this: + //because of minkowski difference, we need the inverse direction + + btVector3 s = -rayFromLocalA.getOrigin(); + btVector3 r = -(rayToLocalA.getOrigin()-rayFromLocalA.getOrigin()); + btVector3 x = s; + btVector3 v; + btVector3 arbitraryPoint = convex->localGetSupportingVertex(r); + + v = x - arbitraryPoint; + + int maxIter = MAX_ITERATIONS; + + btVector3 n; + n.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); + bool hasResult = false; + btVector3 c; + + btScalar lastLambda = lambda; + + + btScalar dist2 = v.length2(); +#ifdef BT_USE_DOUBLE_PRECISION + btScalar epsilon = btScalar(0.0001); +#else + btScalar epsilon = btScalar(0.0001); +#endif //BT_USE_DOUBLE_PRECISION + btVector3 w,p; + btScalar VdotR; + + while ( (dist2 > epsilon) && maxIter--) + { + p = convex->localGetSupportingVertex( v); + w = x - p; + + btScalar VdotW = v.dot(w); + + if ( VdotW > btScalar(0.)) + { + VdotR = v.dot(r); + + if (VdotR >= -(SIMD_EPSILON*SIMD_EPSILON)) + return false; + else + { + lambda = lambda - VdotW / VdotR; + x = s + lambda * r; + m_simplexSolver->reset(); + //check next line + w = x-p; + lastLambda = lambda; + n = v; + hasResult = true; + } + } + m_simplexSolver->addVertex( w, x , p); + if (m_simplexSolver->closest(v)) + { + dist2 = v.length2(); + hasResult = true; + //printf("V=%f , %f, %f\n",v[0],v[1],v[2]); + //printf("DIST2=%f\n",dist2); + //printf("numverts = %i\n",m_simplexSolver->numVertices()); + } else + { + dist2 = btScalar(0.); + } + } + + //int numiter = MAX_ITERATIONS - maxIter; +// printf("number of iterations: %d", numiter); + result.m_fraction = lambda; + result.m_normal = n; + + return true; +} + + + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h new file mode 100644 index 000000000..05662db5d --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h @@ -0,0 +1,50 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef SUBSIMPLEX_CONVEX_CAST_H +#define SUBSIMPLEX_CONVEX_CAST_H + +#include "btConvexCast.h" +#include "btSimplexSolverInterface.h" +class btConvexShape; + +/// btSubsimplexConvexCast implements Gino van den Bergens' paper +///"Ray Casting against bteral Convex Objects with Application to Continuous Collision Detection" +/// GJK based Ray Cast, optimized version +/// Objects should not start in overlap, otherwise results are not defined. +class btSubsimplexConvexCast : public btConvexCast +{ + btSimplexSolverInterface* m_simplexSolver; + const btConvexShape* m_convexA; + const btConvexShape* m_convexB; + +public: + + btSubsimplexConvexCast (const btConvexShape* shapeA,const btConvexShape* shapeB,btSimplexSolverInterface* simplexSolver); + + //virtual ~btSubsimplexConvexCast(); + ///SimsimplexConvexCast calculateTimeOfImpact calculates the time of impact+normal for the linear cast (sweep) between two moving objects. + ///Precondition is that objects should not penetration/overlap at the start from the interval. Overlap can be tested using btGjkPairDetector. + virtual bool calcTimeOfImpact( + const btTransform& fromA, + const btTransform& toA, + const btTransform& fromB, + const btTransform& toB, + CastResult& result); + +}; + +#endif //SUBSIMPLEX_CONVEX_CAST_H diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp new file mode 100644 index 000000000..105b7ecce --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp @@ -0,0 +1,607 @@ + +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + + Elsevier CDROM license agreements grants nonexclusive license to use the software + for any purpose, commercial or non-commercial as long as the following credit is included + identifying the original source of the software: + + Parts of the source are "from the book Real-Time Collision Detection by + Christer Ericson, published by Morgan Kaufmann Publishers, + (c) 2005 Elsevier Inc." + +*/ + + +#include "btVoronoiSimplexSolver.h" +#include +#include + +#define VERTA 0 +#define VERTB 1 +#define VERTC 2 +#define VERTD 3 + +#define CATCH_DEGENERATE_TETRAHEDRON 1 +void btVoronoiSimplexSolver::removeVertex(int index) +{ + + assert(m_numVertices>0); + m_numVertices--; + m_simplexVectorW[index] = m_simplexVectorW[m_numVertices]; + m_simplexPointsP[index] = m_simplexPointsP[m_numVertices]; + m_simplexPointsQ[index] = m_simplexPointsQ[m_numVertices]; +} + +void btVoronoiSimplexSolver::reduceVertices (const btUsageBitfield& usedVerts) +{ + if ((numVertices() >= 4) && (!usedVerts.usedVertexD)) + removeVertex(3); + + if ((numVertices() >= 3) && (!usedVerts.usedVertexC)) + removeVertex(2); + + if ((numVertices() >= 2) && (!usedVerts.usedVertexB)) + removeVertex(1); + + if ((numVertices() >= 1) && (!usedVerts.usedVertexA)) + removeVertex(0); + +} + + + + + +//clear the simplex, remove all the vertices +void btVoronoiSimplexSolver::reset() +{ + m_cachedValidClosest = false; + m_numVertices = 0; + m_needsUpdate = true; + m_lastW = btVector3(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + m_cachedBC.reset(); +} + + + + //add a vertex +void btVoronoiSimplexSolver::addVertex(const btVector3& w, const btPoint3& p, const btPoint3& q) +{ + m_lastW = w; + m_needsUpdate = true; + + m_simplexVectorW[m_numVertices] = w; + m_simplexPointsP[m_numVertices] = p; + m_simplexPointsQ[m_numVertices] = q; + + m_numVertices++; +} + +bool btVoronoiSimplexSolver::updateClosestVectorAndPoints() +{ + + if (m_needsUpdate) + { + m_cachedBC.reset(); + + m_needsUpdate = false; + + switch (numVertices()) + { + case 0: + m_cachedValidClosest = false; + break; + case 1: + { + m_cachedP1 = m_simplexPointsP[0]; + m_cachedP2 = m_simplexPointsQ[0]; + m_cachedV = m_cachedP1-m_cachedP2; //== m_simplexVectorW[0] + m_cachedBC.reset(); + m_cachedBC.setBarycentricCoordinates(btScalar(1.),btScalar(0.),btScalar(0.),btScalar(0.)); + m_cachedValidClosest = m_cachedBC.isValid(); + break; + }; + case 2: + { + //closest point origin from line segment + const btVector3& from = m_simplexVectorW[0]; + const btVector3& to = m_simplexVectorW[1]; + btVector3 nearest; + + btVector3 p (btScalar(0.),btScalar(0.),btScalar(0.)); + btVector3 diff = p - from; + btVector3 v = to - from; + btScalar t = v.dot(diff); + + if (t > 0) { + btScalar dotVV = v.dot(v); + if (t < dotVV) { + t /= dotVV; + diff -= t*v; + m_cachedBC.m_usedVertices.usedVertexA = true; + m_cachedBC.m_usedVertices.usedVertexB = true; + } else { + t = 1; + diff -= v; + //reduce to 1 point + m_cachedBC.m_usedVertices.usedVertexB = true; + } + } else + { + t = 0; + //reduce to 1 point + m_cachedBC.m_usedVertices.usedVertexA = true; + } + m_cachedBC.setBarycentricCoordinates(1-t,t); + nearest = from + t*v; + + m_cachedP1 = m_simplexPointsP[0] + t * (m_simplexPointsP[1] - m_simplexPointsP[0]); + m_cachedP2 = m_simplexPointsQ[0] + t * (m_simplexPointsQ[1] - m_simplexPointsQ[0]); + m_cachedV = m_cachedP1 - m_cachedP2; + + reduceVertices(m_cachedBC.m_usedVertices); + + m_cachedValidClosest = m_cachedBC.isValid(); + break; + } + case 3: + { + //closest point origin from triangle + btVector3 p (btScalar(0.),btScalar(0.),btScalar(0.)); + + const btVector3& a = m_simplexVectorW[0]; + const btVector3& b = m_simplexVectorW[1]; + const btVector3& c = m_simplexVectorW[2]; + + closestPtPointTriangle(p,a,b,c,m_cachedBC); + m_cachedP1 = m_simplexPointsP[0] * m_cachedBC.m_barycentricCoords[0] + + m_simplexPointsP[1] * m_cachedBC.m_barycentricCoords[1] + + m_simplexPointsP[2] * m_cachedBC.m_barycentricCoords[2]; + + m_cachedP2 = m_simplexPointsQ[0] * m_cachedBC.m_barycentricCoords[0] + + m_simplexPointsQ[1] * m_cachedBC.m_barycentricCoords[1] + + m_simplexPointsQ[2] * m_cachedBC.m_barycentricCoords[2]; + + m_cachedV = m_cachedP1-m_cachedP2; + + reduceVertices (m_cachedBC.m_usedVertices); + m_cachedValidClosest = m_cachedBC.isValid(); + + break; + } + case 4: + { + + + btVector3 p (btScalar(0.),btScalar(0.),btScalar(0.)); + + const btVector3& a = m_simplexVectorW[0]; + const btVector3& b = m_simplexVectorW[1]; + const btVector3& c = m_simplexVectorW[2]; + const btVector3& d = m_simplexVectorW[3]; + + bool hasSeperation = closestPtPointTetrahedron(p,a,b,c,d,m_cachedBC); + + if (hasSeperation) + { + + m_cachedP1 = m_simplexPointsP[0] * m_cachedBC.m_barycentricCoords[0] + + m_simplexPointsP[1] * m_cachedBC.m_barycentricCoords[1] + + m_simplexPointsP[2] * m_cachedBC.m_barycentricCoords[2] + + m_simplexPointsP[3] * m_cachedBC.m_barycentricCoords[3]; + + m_cachedP2 = m_simplexPointsQ[0] * m_cachedBC.m_barycentricCoords[0] + + m_simplexPointsQ[1] * m_cachedBC.m_barycentricCoords[1] + + m_simplexPointsQ[2] * m_cachedBC.m_barycentricCoords[2] + + m_simplexPointsQ[3] * m_cachedBC.m_barycentricCoords[3]; + + m_cachedV = m_cachedP1-m_cachedP2; + reduceVertices (m_cachedBC.m_usedVertices); + } else + { +// printf("sub distance got penetration\n"); + + if (m_cachedBC.m_degenerate) + { + m_cachedValidClosest = false; + } else + { + m_cachedValidClosest = true; + //degenerate case == false, penetration = true + zero + m_cachedV.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); + } + break; + } + + m_cachedValidClosest = m_cachedBC.isValid(); + + //closest point origin from tetrahedron + break; + } + default: + { + m_cachedValidClosest = false; + } + }; + } + + return m_cachedValidClosest; + +} + +//return/calculate the closest vertex +bool btVoronoiSimplexSolver::closest(btVector3& v) +{ + bool succes = updateClosestVectorAndPoints(); + v = m_cachedV; + return succes; +} + + + +btScalar btVoronoiSimplexSolver::maxVertex() +{ + int i, numverts = numVertices(); + btScalar maxV = btScalar(0.); + for (i=0;i= btScalar(0.0) && d4 <= d3) + { + result.m_closestPointOnSimplex = b; + result.m_usedVertices.usedVertexB = true; + result.setBarycentricCoordinates(0,1,0); + + return true; // b; // barycentric coordinates (0,1,0) + } + // Check if P in edge region of AB, if so return projection of P onto AB + btScalar vc = d1*d4 - d3*d2; + if (vc <= btScalar(0.0) && d1 >= btScalar(0.0) && d3 <= btScalar(0.0)) { + btScalar v = d1 / (d1 - d3); + result.m_closestPointOnSimplex = a + v * ab; + result.m_usedVertices.usedVertexA = true; + result.m_usedVertices.usedVertexB = true; + result.setBarycentricCoordinates(1-v,v,0); + return true; + //return a + v * ab; // barycentric coordinates (1-v,v,0) + } + + // Check if P in vertex region outside C + btVector3 cp = p - c; + btScalar d5 = ab.dot(cp); + btScalar d6 = ac.dot(cp); + if (d6 >= btScalar(0.0) && d5 <= d6) + { + result.m_closestPointOnSimplex = c; + result.m_usedVertices.usedVertexC = true; + result.setBarycentricCoordinates(0,0,1); + return true;//c; // barycentric coordinates (0,0,1) + } + + // Check if P in edge region of AC, if so return projection of P onto AC + btScalar vb = d5*d2 - d1*d6; + if (vb <= btScalar(0.0) && d2 >= btScalar(0.0) && d6 <= btScalar(0.0)) { + btScalar w = d2 / (d2 - d6); + result.m_closestPointOnSimplex = a + w * ac; + result.m_usedVertices.usedVertexA = true; + result.m_usedVertices.usedVertexC = true; + result.setBarycentricCoordinates(1-w,0,w); + return true; + //return a + w * ac; // barycentric coordinates (1-w,0,w) + } + + // Check if P in edge region of BC, if so return projection of P onto BC + btScalar va = d3*d6 - d5*d4; + if (va <= btScalar(0.0) && (d4 - d3) >= btScalar(0.0) && (d5 - d6) >= btScalar(0.0)) { + btScalar w = (d4 - d3) / ((d4 - d3) + (d5 - d6)); + + result.m_closestPointOnSimplex = b + w * (c - b); + result.m_usedVertices.usedVertexB = true; + result.m_usedVertices.usedVertexC = true; + result.setBarycentricCoordinates(0,1-w,w); + return true; + // return b + w * (c - b); // barycentric coordinates (0,1-w,w) + } + + // P inside face region. Compute Q through its barycentric coordinates (u,v,w) + btScalar denom = btScalar(1.0) / (va + vb + vc); + btScalar v = vb * denom; + btScalar w = vc * denom; + + result.m_closestPointOnSimplex = a + ab * v + ac * w; + result.m_usedVertices.usedVertexA = true; + result.m_usedVertices.usedVertexB = true; + result.m_usedVertices.usedVertexC = true; + result.setBarycentricCoordinates(1-v-w,v,w); + + return true; +// return a + ab * v + ac * w; // = u*a + v*b + w*c, u = va * denom = btScalar(1.0) - v - w + +} + + + + + +/// Test if point p and d lie on opposite sides of plane through abc +int btVoronoiSimplexSolver::pointOutsideOfPlane(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d) +{ + btVector3 normal = (b-a).cross(c-a); + + btScalar signp = (p - a).dot(normal); // [AP AB AC] + btScalar signd = (d - a).dot( normal); // [AD AB AC] + +#ifdef CATCH_DEGENERATE_TETRAHEDRON +#ifdef BT_USE_DOUBLE_PRECISION +if (signd * signd < (btScalar(1e-8) * btScalar(1e-8))) + { + return -1; + } +#else + if (signd * signd < (btScalar(1e-4) * btScalar(1e-4))) + { +// printf("affine dependent/degenerate\n");// + return -1; + } +#endif + +#endif + // Points on opposite sides if expression signs are opposite + return signp * signd < btScalar(0.); +} + + +bool btVoronoiSimplexSolver::closestPtPointTetrahedron(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d, btSubSimplexClosestResult& finalResult) +{ + btSubSimplexClosestResult tempResult; + + // Start out assuming point inside all halfspaces, so closest to itself + finalResult.m_closestPointOnSimplex = p; + finalResult.m_usedVertices.reset(); + finalResult.m_usedVertices.usedVertexA = true; + finalResult.m_usedVertices.usedVertexB = true; + finalResult.m_usedVertices.usedVertexC = true; + finalResult.m_usedVertices.usedVertexD = true; + + int pointOutsideABC = pointOutsideOfPlane(p, a, b, c, d); + int pointOutsideACD = pointOutsideOfPlane(p, a, c, d, b); + int pointOutsideADB = pointOutsideOfPlane(p, a, d, b, c); + int pointOutsideBDC = pointOutsideOfPlane(p, b, d, c, a); + + if (pointOutsideABC < 0 || pointOutsideACD < 0 || pointOutsideADB < 0 || pointOutsideBDC < 0) + { + finalResult.m_degenerate = true; + return false; + } + + if (!pointOutsideABC && !pointOutsideACD && !pointOutsideADB && !pointOutsideBDC) + { + return false; + } + + + btScalar bestSqDist = FLT_MAX; + // If point outside face abc then compute closest point on abc + if (pointOutsideABC) + { + closestPtPointTriangle(p, a, b, c,tempResult); + btPoint3 q = tempResult.m_closestPointOnSimplex; + + btScalar sqDist = (q - p).dot( q - p); + // Update best closest point if (squared) distance is less than current best + if (sqDist < bestSqDist) { + bestSqDist = sqDist; + finalResult.m_closestPointOnSimplex = q; + //convert result bitmask! + finalResult.m_usedVertices.reset(); + finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA; + finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexB; + finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC; + finalResult.setBarycentricCoordinates( + tempResult.m_barycentricCoords[VERTA], + tempResult.m_barycentricCoords[VERTB], + tempResult.m_barycentricCoords[VERTC], + 0 + ); + + } + } + + + // Repeat test for face acd + if (pointOutsideACD) + { + closestPtPointTriangle(p, a, c, d,tempResult); + btPoint3 q = tempResult.m_closestPointOnSimplex; + //convert result bitmask! + + btScalar sqDist = (q - p).dot( q - p); + if (sqDist < bestSqDist) + { + bestSqDist = sqDist; + finalResult.m_closestPointOnSimplex = q; + finalResult.m_usedVertices.reset(); + finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA; + + finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexB; + finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexC; + finalResult.setBarycentricCoordinates( + tempResult.m_barycentricCoords[VERTA], + 0, + tempResult.m_barycentricCoords[VERTB], + tempResult.m_barycentricCoords[VERTC] + ); + + } + } + // Repeat test for face adb + + + if (pointOutsideADB) + { + closestPtPointTriangle(p, a, d, b,tempResult); + btPoint3 q = tempResult.m_closestPointOnSimplex; + //convert result bitmask! + + btScalar sqDist = (q - p).dot( q - p); + if (sqDist < bestSqDist) + { + bestSqDist = sqDist; + finalResult.m_closestPointOnSimplex = q; + finalResult.m_usedVertices.reset(); + finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA; + finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexC; + + finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB; + finalResult.setBarycentricCoordinates( + tempResult.m_barycentricCoords[VERTA], + tempResult.m_barycentricCoords[VERTC], + 0, + tempResult.m_barycentricCoords[VERTB] + ); + + } + } + // Repeat test for face bdc + + + if (pointOutsideBDC) + { + closestPtPointTriangle(p, b, d, c,tempResult); + btPoint3 q = tempResult.m_closestPointOnSimplex; + //convert result bitmask! + btScalar sqDist = (q - p).dot( q - p); + if (sqDist < bestSqDist) + { + bestSqDist = sqDist; + finalResult.m_closestPointOnSimplex = q; + finalResult.m_usedVertices.reset(); + // + finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexA; + finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC; + finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB; + + finalResult.setBarycentricCoordinates( + 0, + tempResult.m_barycentricCoords[VERTA], + tempResult.m_barycentricCoords[VERTC], + tempResult.m_barycentricCoords[VERTB] + ); + + } + } + + //help! we ended up full ! + + if (finalResult.m_usedVertices.usedVertexA && + finalResult.m_usedVertices.usedVertexB && + finalResult.m_usedVertices.usedVertexC && + finalResult.m_usedVertices.usedVertexD) + { + return true; + } + + return true; +} + diff --git a/src/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h new file mode 100644 index 000000000..356d335bc --- /dev/null +++ b/src/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h @@ -0,0 +1,157 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef btVoronoiSimplexSolver_H +#define btVoronoiSimplexSolver_H + +#include "btSimplexSolverInterface.h" + + + +#define VORONOI_SIMPLEX_MAX_VERTS 5 + +struct btUsageBitfield{ + btUsageBitfield() + { + reset(); + } + + void reset() + { + usedVertexA = false; + usedVertexB = false; + usedVertexC = false; + usedVertexD = false; + } + unsigned short usedVertexA : 1; + unsigned short usedVertexB : 1; + unsigned short usedVertexC : 1; + unsigned short usedVertexD : 1; + unsigned short unused1 : 1; + unsigned short unused2 : 1; + unsigned short unused3 : 1; + unsigned short unused4 : 1; +}; + + +struct btSubSimplexClosestResult +{ + btPoint3 m_closestPointOnSimplex; + //MASK for m_usedVertices + //stores the simplex vertex-usage, using the MASK, + // if m_usedVertices & MASK then the related vertex is used + btUsageBitfield m_usedVertices; + btScalar m_barycentricCoords[4]; + bool m_degenerate; + + void reset() + { + m_degenerate = false; + setBarycentricCoordinates(); + m_usedVertices.reset(); + } + bool isValid() + { + bool valid = (m_barycentricCoords[0] >= btScalar(0.)) && + (m_barycentricCoords[1] >= btScalar(0.)) && + (m_barycentricCoords[2] >= btScalar(0.)) && + (m_barycentricCoords[3] >= btScalar(0.)); + + + return valid; + } + void setBarycentricCoordinates(btScalar a=btScalar(0.),btScalar b=btScalar(0.),btScalar c=btScalar(0.),btScalar d=btScalar(0.)) + { + m_barycentricCoords[0] = a; + m_barycentricCoords[1] = b; + m_barycentricCoords[2] = c; + m_barycentricCoords[3] = d; + } + +}; + +/// btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points simplex to the origin. +/// Can be used with GJK, as an alternative to Johnson distance algorithm. +#ifdef NO_VIRTUAL_INTERFACE +class btVoronoiSimplexSolver +#else +class btVoronoiSimplexSolver : public btSimplexSolverInterface +#endif +{ +public: + + int m_numVertices; + + btVector3 m_simplexVectorW[VORONOI_SIMPLEX_MAX_VERTS]; + btPoint3 m_simplexPointsP[VORONOI_SIMPLEX_MAX_VERTS]; + btPoint3 m_simplexPointsQ[VORONOI_SIMPLEX_MAX_VERTS]; + + + + btPoint3 m_cachedP1; + btPoint3 m_cachedP2; + btVector3 m_cachedV; + btVector3 m_lastW; + bool m_cachedValidClosest; + + btSubSimplexClosestResult m_cachedBC; + + bool m_needsUpdate; + + void removeVertex(int index); + void reduceVertices (const btUsageBitfield& usedVerts); + bool updateClosestVectorAndPoints(); + + bool closestPtPointTetrahedron(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d, btSubSimplexClosestResult& finalResult); + int pointOutsideOfPlane(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d); + bool closestPtPointTriangle(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c,btSubSimplexClosestResult& result); + +public: + + void reset(); + + void addVertex(const btVector3& w, const btPoint3& p, const btPoint3& q); + + + bool closest(btVector3& v); + + btScalar maxVertex(); + + bool fullSimplex() const + { + return (m_numVertices == 4); + } + + int getSimplex(btPoint3 *pBuf, btPoint3 *qBuf, btVector3 *yBuf) const; + + bool inSimplex(const btVector3& w); + + void backup_closest(btVector3& v) ; + + bool emptySimplex() const ; + + void compute_points(btPoint3& p1, btPoint3& p2) ; + + int numVertices() const + { + return m_numVertices; + } + + +}; + +#endif //VoronoiSimplexSolver diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp b/src/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp new file mode 100644 index 000000000..a8a2c4f67 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp @@ -0,0 +1,286 @@ +/* +Bullet Continuous Collision Detection and Physics Library +btConeTwistConstraint is Copyright (c) 2007 Starbreeze Studios + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +Written by: Marcus Hennix +*/ + + +#include "btConeTwistConstraint.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "LinearMath/btTransformUtil.h" +#include "LinearMath/btMinMax.h" +#include + +btConeTwistConstraint::btConeTwistConstraint() +:btTypedConstraint(CONETWIST_CONSTRAINT_TYPE) +{ +} + + +btConeTwistConstraint::btConeTwistConstraint(btRigidBody& rbA,btRigidBody& rbB, + const btTransform& rbAFrame,const btTransform& rbBFrame) + :btTypedConstraint(CONETWIST_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame), + m_angularOnly(false) +{ + // flip axis for correct angles + m_rbBFrame.getBasis()[1][0] *= btScalar(-1.); + m_rbBFrame.getBasis()[1][1] *= btScalar(-1.); + m_rbBFrame.getBasis()[1][2] *= btScalar(-1.); + + m_swingSpan1 = btScalar(1e30); + m_swingSpan2 = btScalar(1e30); + m_twistSpan = btScalar(1e30); + m_biasFactor = 0.3f; + m_relaxationFactor = 1.0f; + + m_solveTwistLimit = false; + m_solveSwingLimit = false; + +} + +btConeTwistConstraint::btConeTwistConstraint(btRigidBody& rbA,const btTransform& rbAFrame) + :btTypedConstraint(CONETWIST_CONSTRAINT_TYPE,rbA),m_rbAFrame(rbAFrame), + m_angularOnly(false) +{ + m_rbBFrame = m_rbAFrame; + + // flip axis for correct angles + m_rbBFrame.getBasis()[1][0] *= btScalar(-1.); + m_rbBFrame.getBasis()[1][1] *= btScalar(-1.); + m_rbBFrame.getBasis()[1][2] *= btScalar(-1.); + + m_rbBFrame.getBasis()[2][0] *= btScalar(-1.); + m_rbBFrame.getBasis()[2][1] *= btScalar(-1.); + m_rbBFrame.getBasis()[2][2] *= btScalar(-1.); + + m_swingSpan1 = btScalar(1e30); + m_swingSpan2 = btScalar(1e30); + m_twistSpan = btScalar(1e30); + m_biasFactor = 0.3f; + m_relaxationFactor = 1.0f; + + m_solveTwistLimit = false; + m_solveSwingLimit = false; + +} + +void btConeTwistConstraint::buildJacobian() +{ + m_appliedImpulse = btScalar(0.); + + //set bias, sign, clear accumulator + m_swingCorrection = btScalar(0.); + m_twistLimitSign = btScalar(0.); + m_solveTwistLimit = false; + m_solveSwingLimit = false; + m_accTwistLimitImpulse = btScalar(0.); + m_accSwingLimitImpulse = btScalar(0.); + + if (!m_angularOnly) + { + btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin(); + btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin(); + btVector3 relPos = pivotBInW - pivotAInW; + + btVector3 normal[3]; + if (relPos.length2() > SIMD_EPSILON) + { + normal[0] = relPos.normalized(); + } + else + { + normal[0].setValue(btScalar(1.0),0,0); + } + + btPlaneSpace1(normal[0], normal[1], normal[2]); + + for (int i=0;i<3;i++) + { + new (&m_jac[i]) btJacobianEntry( + m_rbA.getCenterOfMassTransform().getBasis().transpose(), + m_rbB.getCenterOfMassTransform().getBasis().transpose(), + pivotAInW - m_rbA.getCenterOfMassPosition(), + pivotBInW - m_rbB.getCenterOfMassPosition(), + normal[i], + m_rbA.getInvInertiaDiagLocal(), + m_rbA.getInvMass(), + m_rbB.getInvInertiaDiagLocal(), + m_rbB.getInvMass()); + } + } + + btVector3 b1Axis1,b1Axis2,b1Axis3; + btVector3 b2Axis1,b2Axis2; + + b1Axis1 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(0); + b2Axis1 = getRigidBodyB().getCenterOfMassTransform().getBasis() * this->m_rbBFrame.getBasis().getColumn(0); + + btScalar swing1=btScalar(0.),swing2 = btScalar(0.); + + // Get Frame into world space + if (m_swingSpan1 >= btScalar(0.05f)) + { + b1Axis2 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(1); + swing1 = btAtan2Fast( b2Axis1.dot(b1Axis2),b2Axis1.dot(b1Axis1) ); + } + + if (m_swingSpan2 >= btScalar(0.05f)) + { + b1Axis3 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(2); + swing2 = btAtan2Fast( b2Axis1.dot(b1Axis3),b2Axis1.dot(b1Axis1) ); + } + + btScalar RMaxAngle1Sq = 1.0f / (m_swingSpan1*m_swingSpan1); + btScalar RMaxAngle2Sq = 1.0f / (m_swingSpan2*m_swingSpan2); + btScalar EllipseAngle = btFabs(swing1)* RMaxAngle1Sq + btFabs(swing2) * RMaxAngle2Sq; + + if (EllipseAngle > 1.0f) + { + m_swingCorrection = EllipseAngle-1.0f; + m_solveSwingLimit = true; + + // Calculate necessary axis & factors + m_swingAxis = b2Axis1.cross(b1Axis2* b2Axis1.dot(b1Axis2) + b1Axis3* b2Axis1.dot(b1Axis3)); + m_swingAxis.normalize(); + + btScalar swingAxisSign = (b2Axis1.dot(b1Axis1) >= 0.0f) ? 1.0f : -1.0f; + m_swingAxis *= swingAxisSign; + + m_kSwing = btScalar(1.) / (getRigidBodyA().computeAngularImpulseDenominator(m_swingAxis) + + getRigidBodyB().computeAngularImpulseDenominator(m_swingAxis)); + + } + + // Twist limits + if (m_twistSpan >= btScalar(0.)) + { + btVector3 b2Axis2 = getRigidBodyB().getCenterOfMassTransform().getBasis() * this->m_rbBFrame.getBasis().getColumn(1); + btQuaternion rotationArc = shortestArcQuat(b2Axis1,b1Axis1); + btVector3 TwistRef = quatRotate(rotationArc,b2Axis2); + btScalar twist = btAtan2Fast( TwistRef.dot(b1Axis3), TwistRef.dot(b1Axis2) ); + + btScalar lockedFreeFactor = (m_twistSpan > btScalar(0.05f)) ? m_limitSoftness : btScalar(0.); + if (twist <= -m_twistSpan*lockedFreeFactor) + { + m_twistCorrection = -(twist + m_twistSpan); + m_solveTwistLimit = true; + + m_twistAxis = (b2Axis1 + b1Axis1) * 0.5f; + m_twistAxis.normalize(); + m_twistAxis *= -1.0f; + + m_kTwist = btScalar(1.) / (getRigidBodyA().computeAngularImpulseDenominator(m_twistAxis) + + getRigidBodyB().computeAngularImpulseDenominator(m_twistAxis)); + + } else + if (twist > m_twistSpan*lockedFreeFactor) + { + m_twistCorrection = (twist - m_twistSpan); + m_solveTwistLimit = true; + + m_twistAxis = (b2Axis1 + b1Axis1) * 0.5f; + m_twistAxis.normalize(); + + m_kTwist = btScalar(1.) / (getRigidBodyA().computeAngularImpulseDenominator(m_twistAxis) + + getRigidBodyB().computeAngularImpulseDenominator(m_twistAxis)); + + } + } +} + +void btConeTwistConstraint::solveConstraint(btScalar timeStep) +{ + + btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin(); + btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin(); + + btScalar tau = btScalar(0.3); + + //linear part + if (!m_angularOnly) + { + btVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition(); + btVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition(); + + btVector3 vel1 = m_rbA.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = m_rbB.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + for (int i=0;i<3;i++) + { + const btVector3& normal = m_jac[i].m_linearJointAxis; + btScalar jacDiagABInv = btScalar(1.) / m_jac[i].getDiagonal(); + + btScalar rel_vel; + rel_vel = normal.dot(vel); + //positional error (zeroth order error) + btScalar depth = -(pivotAInW - pivotBInW).dot(normal); //this is the error projected on the normal + btScalar impulse = depth*tau/timeStep * jacDiagABInv - rel_vel * jacDiagABInv; + m_appliedImpulse += impulse; + btVector3 impulse_vector = normal * impulse; + m_rbA.applyImpulse(impulse_vector, pivotAInW - m_rbA.getCenterOfMassPosition()); + m_rbB.applyImpulse(-impulse_vector, pivotBInW - m_rbB.getCenterOfMassPosition()); + } + } + + { + ///solve angular part + const btVector3& angVelA = getRigidBodyA().getAngularVelocity(); + const btVector3& angVelB = getRigidBodyB().getAngularVelocity(); + + // solve swing limit + if (m_solveSwingLimit) + { + btScalar amplitude = ((angVelB - angVelA).dot( m_swingAxis )*m_relaxationFactor*m_relaxationFactor + m_swingCorrection*(btScalar(1.)/timeStep)*m_biasFactor); + btScalar impulseMag = amplitude * m_kSwing; + + // Clamp the accumulated impulse + btScalar temp = m_accSwingLimitImpulse; + m_accSwingLimitImpulse = btMax(m_accSwingLimitImpulse + impulseMag, btScalar(0.0) ); + impulseMag = m_accSwingLimitImpulse - temp; + + btVector3 impulse = m_swingAxis * impulseMag; + + m_rbA.applyTorqueImpulse(impulse); + m_rbB.applyTorqueImpulse(-impulse); + + } + + // solve twist limit + if (m_solveTwistLimit) + { + btScalar amplitude = ((angVelB - angVelA).dot( m_twistAxis )*m_relaxationFactor*m_relaxationFactor + m_twistCorrection*(btScalar(1.)/timeStep)*m_biasFactor ); + btScalar impulseMag = amplitude * m_kTwist; + + // Clamp the accumulated impulse + btScalar temp = m_accTwistLimitImpulse; + m_accTwistLimitImpulse = btMax(m_accTwistLimitImpulse + impulseMag, btScalar(0.0) ); + impulseMag = m_accTwistLimitImpulse - temp; + + btVector3 impulse = m_twistAxis * impulseMag; + + m_rbA.applyTorqueImpulse(impulse); + m_rbB.applyTorqueImpulse(-impulse); + + } + + } + +} + +void btConeTwistConstraint::updateRHS(btScalar timeStep) +{ + (void)timeStep; + +} diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h new file mode 100644 index 000000000..f121919c8 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h @@ -0,0 +1,126 @@ +/* +Bullet Continuous Collision Detection and Physics Library +btConeTwistConstraint is Copyright (c) 2007 Starbreeze Studios + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +Written by: Marcus Hennix +*/ + + + +#ifndef CONETWISTCONSTRAINT_H +#define CONETWISTCONSTRAINT_H + +#include "../../LinearMath/btVector3.h" +#include "btJacobianEntry.h" +#include "btTypedConstraint.h" + +class btRigidBody; + + +///btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc) +class btConeTwistConstraint : public btTypedConstraint +{ +#ifdef IN_PARALLELL_SOLVER +public: +#endif + btJacobianEntry m_jac[3]; //3 orthogonal linear constraints + + btTransform m_rbAFrame; + btTransform m_rbBFrame; + + btScalar m_limitSoftness; + btScalar m_biasFactor; + btScalar m_relaxationFactor; + + btScalar m_swingSpan1; + btScalar m_swingSpan2; + btScalar m_twistSpan; + + btVector3 m_swingAxis; + btVector3 m_twistAxis; + + btScalar m_kSwing; + btScalar m_kTwist; + + btScalar m_twistLimitSign; + btScalar m_swingCorrection; + btScalar m_twistCorrection; + + btScalar m_accSwingLimitImpulse; + btScalar m_accTwistLimitImpulse; + + bool m_angularOnly; + bool m_solveTwistLimit; + bool m_solveSwingLimit; + + +public: + + btConeTwistConstraint(btRigidBody& rbA,btRigidBody& rbB,const btTransform& rbAFrame, const btTransform& rbBFrame); + + btConeTwistConstraint(btRigidBody& rbA,const btTransform& rbAFrame); + + btConeTwistConstraint(); + + virtual void buildJacobian(); + + virtual void solveConstraint(btScalar timeStep); + + void updateRHS(btScalar timeStep); + + const btRigidBody& getRigidBodyA() const + { + return m_rbA; + } + const btRigidBody& getRigidBodyB() const + { + return m_rbB; + } + + void setAngularOnly(bool angularOnly) + { + m_angularOnly = angularOnly; + } + + void setLimit(btScalar _swingSpan1,btScalar _swingSpan2,btScalar _twistSpan, btScalar _softness = 0.8f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f) + { + m_swingSpan1 = _swingSpan1; + m_swingSpan2 = _swingSpan2; + m_twistSpan = _twistSpan; + + m_limitSoftness = _softness; + m_biasFactor = _biasFactor; + m_relaxationFactor = _relaxationFactor; + } + + const btTransform& getAFrame() { return m_rbAFrame; }; + const btTransform& getBFrame() { return m_rbBFrame; }; + + inline int getSolveTwistLimit() + { + return m_solveTwistLimit; + } + + inline int getSolveSwingLimit() + { + return m_solveTwistLimit; + } + + inline btScalar getTwistLimitSign() + { + return m_twistLimitSign; + } + +}; + +#endif //CONETWISTCONSTRAINT_H diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h new file mode 100644 index 000000000..addfb67a8 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h @@ -0,0 +1,52 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONSTRAINT_SOLVER_H +#define CONSTRAINT_SOLVER_H + +#include "LinearMath/btScalar.h" + +class btPersistentManifold; +class btRigidBody; +class btCollisionObject; +class btTypedConstraint; +struct btContactSolverInfo; +struct btBroadphaseProxy; +class btIDebugDraw; +class btStackAlloc; +class btDispatcher; +/// btConstraintSolver provides solver interface +class btConstraintSolver +{ + +public: + + virtual ~btConstraintSolver() {} + + virtual void prepareSolve (int numBodies, int numManifolds) {;} + + ///solve a group of constraints + virtual btScalar solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifold,int numManifolds,btTypedConstraint** constraints,int numConstraints, const btContactSolverInfo& info,class btIDebugDraw* debugDrawer, btStackAlloc* stackAlloc,btDispatcher* dispatcher) = 0; + + virtual void allSolved (const btContactSolverInfo& info,class btIDebugDraw* debugDrawer, btStackAlloc* stackAlloc) {;} + + ///clear internal cached data and reset random seed + virtual void reset() = 0; +}; + + + + +#endif //CONSTRAINT_SOLVER_H diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp b/src/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp new file mode 100644 index 000000000..158842850 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp @@ -0,0 +1,417 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btContactConstraint.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "LinearMath/btVector3.h" +#include "btJacobianEntry.h" +#include "btContactSolverInfo.h" +#include "LinearMath/btMinMax.h" +#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h" + +#define ASSERT2 assert + +#define USE_INTERNAL_APPLY_IMPULSE 1 + + +//bilateral constraint between two dynamic objects +void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1, + btRigidBody& body2, const btVector3& pos2, + btScalar distance, const btVector3& normal,btScalar& impulse ,btScalar timeStep) +{ + (void)timeStep; + (void)distance; + + + btScalar normalLenSqr = normal.length2(); + ASSERT2(btFabs(normalLenSqr) < btScalar(1.1)); + if (normalLenSqr > btScalar(1.1)) + { + impulse = btScalar(0.); + return; + } + btVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition(); + btVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition(); + //this jacobian entry could be re-used for all iterations + + btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + + btJacobianEntry jac(body1.getCenterOfMassTransform().getBasis().transpose(), + body2.getCenterOfMassTransform().getBasis().transpose(), + rel_pos1,rel_pos2,normal,body1.getInvInertiaDiagLocal(),body1.getInvMass(), + body2.getInvInertiaDiagLocal(),body2.getInvMass()); + + btScalar jacDiagAB = jac.getDiagonal(); + btScalar jacDiagABInv = btScalar(1.) / jacDiagAB; + + btScalar rel_vel = jac.getRelativeVelocity( + body1.getLinearVelocity(), + body1.getCenterOfMassTransform().getBasis().transpose() * body1.getAngularVelocity(), + body2.getLinearVelocity(), + body2.getCenterOfMassTransform().getBasis().transpose() * body2.getAngularVelocity()); + btScalar a; + a=jacDiagABInv; + + + rel_vel = normal.dot(vel); + + //todo: move this into proper structure + btScalar contactDamping = btScalar(0.2); + +#ifdef ONLY_USE_LINEAR_MASS + btScalar massTerm = btScalar(1.) / (body1.getInvMass() + body2.getInvMass()); + impulse = - contactDamping * rel_vel * massTerm; +#else + btScalar velocityImpulse = -contactDamping * rel_vel * jacDiagABInv; + impulse = velocityImpulse; +#endif +} + + + +//response between two dynamic objects with friction +btScalar resolveSingleCollision( + btRigidBody& body1, + btRigidBody& body2, + btManifoldPoint& contactPoint, + const btContactSolverInfo& solverInfo) +{ + + const btVector3& pos1_ = contactPoint.getPositionWorldOnA(); + const btVector3& pos2_ = contactPoint.getPositionWorldOnB(); + const btVector3& normal = contactPoint.m_normalWorldOnB; + + //constant over all iterations + btVector3 rel_pos1 = pos1_ - body1.getCenterOfMassPosition(); + btVector3 rel_pos2 = pos2_ - body2.getCenterOfMassPosition(); + + btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + btScalar rel_vel; + rel_vel = normal.dot(vel); + + btScalar Kfps = btScalar(1.) / solverInfo.m_timeStep ; + + // btScalar damping = solverInfo.m_damping ; + btScalar Kerp = solverInfo.m_erp; + btScalar Kcor = Kerp *Kfps; + + btConstraintPersistentData* cpd = (btConstraintPersistentData*) contactPoint.m_userPersistentData; + assert(cpd); + btScalar distance = cpd->m_penetration; + btScalar positionalError = Kcor *-distance; + btScalar velocityError = cpd->m_restitution - rel_vel;// * damping; + + btScalar penetrationImpulse = positionalError * cpd->m_jacDiagABInv; + + btScalar velocityImpulse = velocityError * cpd->m_jacDiagABInv; + + btScalar normalImpulse = penetrationImpulse+velocityImpulse; + + // See Erin Catto's GDC 2006 paper: Clamp the accumulated impulse + btScalar oldNormalImpulse = cpd->m_appliedImpulse; + btScalar sum = oldNormalImpulse + normalImpulse; + cpd->m_appliedImpulse = btScalar(0.) > sum ? btScalar(0.): sum; + + normalImpulse = cpd->m_appliedImpulse - oldNormalImpulse; + +#ifdef USE_INTERNAL_APPLY_IMPULSE + if (body1.getInvMass()) + { + body1.internalApplyImpulse(contactPoint.m_normalWorldOnB*body1.getInvMass(),cpd->m_angularComponentA,normalImpulse); + } + if (body2.getInvMass()) + { + body2.internalApplyImpulse(contactPoint.m_normalWorldOnB*body2.getInvMass(),cpd->m_angularComponentB,-normalImpulse); + } +#else //USE_INTERNAL_APPLY_IMPULSE + body1.applyImpulse(normal*(normalImpulse), rel_pos1); + body2.applyImpulse(-normal*(normalImpulse), rel_pos2); +#endif //USE_INTERNAL_APPLY_IMPULSE + + return normalImpulse; +} + + +btScalar resolveSingleFriction( + btRigidBody& body1, + btRigidBody& body2, + btManifoldPoint& contactPoint, + const btContactSolverInfo& solverInfo) +{ + + (void)solverInfo; + + const btVector3& pos1 = contactPoint.getPositionWorldOnA(); + const btVector3& pos2 = contactPoint.getPositionWorldOnB(); + + btVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition(); + btVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition(); + + btConstraintPersistentData* cpd = (btConstraintPersistentData*) contactPoint.m_userPersistentData; + assert(cpd); + + btScalar combinedFriction = cpd->m_friction; + + btScalar limit = cpd->m_appliedImpulse * combinedFriction; + + if (cpd->m_appliedImpulse>btScalar(0.)) + //friction + { + //apply friction in the 2 tangential directions + + // 1st tangent + btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + btScalar j1,j2; + + { + + btScalar vrel = cpd->m_frictionWorldTangential0.dot(vel); + + // calculate j that moves us to zero relative velocity + j1 = -vrel * cpd->m_jacDiagABInvTangent0; + btScalar oldTangentImpulse = cpd->m_accumulatedTangentImpulse0; + cpd->m_accumulatedTangentImpulse0 = oldTangentImpulse + j1; + btSetMin(cpd->m_accumulatedTangentImpulse0, limit); + btSetMax(cpd->m_accumulatedTangentImpulse0, -limit); + j1 = cpd->m_accumulatedTangentImpulse0 - oldTangentImpulse; + + } + { + // 2nd tangent + + btScalar vrel = cpd->m_frictionWorldTangential1.dot(vel); + + // calculate j that moves us to zero relative velocity + j2 = -vrel * cpd->m_jacDiagABInvTangent1; + btScalar oldTangentImpulse = cpd->m_accumulatedTangentImpulse1; + cpd->m_accumulatedTangentImpulse1 = oldTangentImpulse + j2; + btSetMin(cpd->m_accumulatedTangentImpulse1, limit); + btSetMax(cpd->m_accumulatedTangentImpulse1, -limit); + j2 = cpd->m_accumulatedTangentImpulse1 - oldTangentImpulse; + } + +#ifdef USE_INTERNAL_APPLY_IMPULSE + if (body1.getInvMass()) + { + body1.internalApplyImpulse(cpd->m_frictionWorldTangential0*body1.getInvMass(),cpd->m_frictionAngularComponent0A,j1); + body1.internalApplyImpulse(cpd->m_frictionWorldTangential1*body1.getInvMass(),cpd->m_frictionAngularComponent1A,j2); + } + if (body2.getInvMass()) + { + body2.internalApplyImpulse(cpd->m_frictionWorldTangential0*body2.getInvMass(),cpd->m_frictionAngularComponent0B,-j1); + body2.internalApplyImpulse(cpd->m_frictionWorldTangential1*body2.getInvMass(),cpd->m_frictionAngularComponent1B,-j2); + } +#else //USE_INTERNAL_APPLY_IMPULSE + body1.applyImpulse((j1 * cpd->m_frictionWorldTangential0)+(j2 * cpd->m_frictionWorldTangential1), rel_pos1); + body2.applyImpulse((j1 * -cpd->m_frictionWorldTangential0)+(j2 * -cpd->m_frictionWorldTangential1), rel_pos2); +#endif //USE_INTERNAL_APPLY_IMPULSE + + + } + return cpd->m_appliedImpulse; +} + + +btScalar resolveSingleFrictionOriginal( + btRigidBody& body1, + btRigidBody& body2, + btManifoldPoint& contactPoint, + const btContactSolverInfo& solverInfo) +{ + + (void)solverInfo; + + const btVector3& pos1 = contactPoint.getPositionWorldOnA(); + const btVector3& pos2 = contactPoint.getPositionWorldOnB(); + + btVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition(); + btVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition(); + + btConstraintPersistentData* cpd = (btConstraintPersistentData*) contactPoint.m_userPersistentData; + assert(cpd); + + btScalar combinedFriction = cpd->m_friction; + + btScalar limit = cpd->m_appliedImpulse * combinedFriction; + //if (contactPoint.m_appliedImpulse>btScalar(0.)) + //friction + { + //apply friction in the 2 tangential directions + + { + // 1st tangent + btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + btScalar vrel = cpd->m_frictionWorldTangential0.dot(vel); + + // calculate j that moves us to zero relative velocity + btScalar j = -vrel * cpd->m_jacDiagABInvTangent0; + btScalar total = cpd->m_accumulatedTangentImpulse0 + j; + btSetMin(total, limit); + btSetMax(total, -limit); + j = total - cpd->m_accumulatedTangentImpulse0; + cpd->m_accumulatedTangentImpulse0 = total; + body1.applyImpulse(j * cpd->m_frictionWorldTangential0, rel_pos1); + body2.applyImpulse(j * -cpd->m_frictionWorldTangential0, rel_pos2); + } + + + { + // 2nd tangent + btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + btScalar vrel = cpd->m_frictionWorldTangential1.dot(vel); + + // calculate j that moves us to zero relative velocity + btScalar j = -vrel * cpd->m_jacDiagABInvTangent1; + btScalar total = cpd->m_accumulatedTangentImpulse1 + j; + btSetMin(total, limit); + btSetMax(total, -limit); + j = total - cpd->m_accumulatedTangentImpulse1; + cpd->m_accumulatedTangentImpulse1 = total; + body1.applyImpulse(j * cpd->m_frictionWorldTangential1, rel_pos1); + body2.applyImpulse(j * -cpd->m_frictionWorldTangential1, rel_pos2); + } + } + return cpd->m_appliedImpulse; +} + + +//velocity + friction +//response between two dynamic objects with friction +btScalar resolveSingleCollisionCombined( + btRigidBody& body1, + btRigidBody& body2, + btManifoldPoint& contactPoint, + const btContactSolverInfo& solverInfo) +{ + + const btVector3& pos1 = contactPoint.getPositionWorldOnA(); + const btVector3& pos2 = contactPoint.getPositionWorldOnB(); + const btVector3& normal = contactPoint.m_normalWorldOnB; + + btVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition(); + btVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition(); + + btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + btScalar rel_vel; + rel_vel = normal.dot(vel); + + btScalar Kfps = btScalar(1.) / solverInfo.m_timeStep ; + + //btScalar damping = solverInfo.m_damping ; + btScalar Kerp = solverInfo.m_erp; + btScalar Kcor = Kerp *Kfps; + + btConstraintPersistentData* cpd = (btConstraintPersistentData*) contactPoint.m_userPersistentData; + assert(cpd); + btScalar distance = cpd->m_penetration; + btScalar positionalError = Kcor *-distance; + btScalar velocityError = cpd->m_restitution - rel_vel;// * damping; + + btScalar penetrationImpulse = positionalError * cpd->m_jacDiagABInv; + + btScalar velocityImpulse = velocityError * cpd->m_jacDiagABInv; + + btScalar normalImpulse = penetrationImpulse+velocityImpulse; + + // See Erin Catto's GDC 2006 paper: Clamp the accumulated impulse + btScalar oldNormalImpulse = cpd->m_appliedImpulse; + btScalar sum = oldNormalImpulse + normalImpulse; + cpd->m_appliedImpulse = btScalar(0.) > sum ? btScalar(0.): sum; + + normalImpulse = cpd->m_appliedImpulse - oldNormalImpulse; + + +#ifdef USE_INTERNAL_APPLY_IMPULSE + if (body1.getInvMass()) + { + body1.internalApplyImpulse(contactPoint.m_normalWorldOnB*body1.getInvMass(),cpd->m_angularComponentA,normalImpulse); + } + if (body2.getInvMass()) + { + body2.internalApplyImpulse(contactPoint.m_normalWorldOnB*body2.getInvMass(),cpd->m_angularComponentB,-normalImpulse); + } +#else //USE_INTERNAL_APPLY_IMPULSE + body1.applyImpulse(normal*(normalImpulse), rel_pos1); + body2.applyImpulse(-normal*(normalImpulse), rel_pos2); +#endif //USE_INTERNAL_APPLY_IMPULSE + + { + //friction + btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + rel_vel = normal.dot(vel); + + + btVector3 lat_vel = vel - normal * rel_vel; + btScalar lat_rel_vel = lat_vel.length(); + + btScalar combinedFriction = cpd->m_friction; + + if (cpd->m_appliedImpulse > 0) + if (lat_rel_vel > SIMD_EPSILON) + { + lat_vel /= lat_rel_vel; + btVector3 temp1 = body1.getInvInertiaTensorWorld() * rel_pos1.cross(lat_vel); + btVector3 temp2 = body2.getInvInertiaTensorWorld() * rel_pos2.cross(lat_vel); + btScalar friction_impulse = lat_rel_vel / + (body1.getInvMass() + body2.getInvMass() + lat_vel.dot(temp1.cross(rel_pos1) + temp2.cross(rel_pos2))); + btScalar normal_impulse = cpd->m_appliedImpulse * combinedFriction; + + btSetMin(friction_impulse, normal_impulse); + btSetMax(friction_impulse, -normal_impulse); + body1.applyImpulse(lat_vel * -friction_impulse, rel_pos1); + body2.applyImpulse(lat_vel * friction_impulse, rel_pos2); + } + } + + + + return normalImpulse; +} + +btScalar resolveSingleFrictionEmpty( + btRigidBody& body1, + btRigidBody& body2, + btManifoldPoint& contactPoint, + const btContactSolverInfo& solverInfo) +{ + (void)contactPoint; + (void)body1; + (void)body2; + (void)solverInfo; + + + return btScalar(0.); +}; + diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.h new file mode 100644 index 000000000..826e79f78 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.h @@ -0,0 +1,122 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONTACT_CONSTRAINT_H +#define CONTACT_CONSTRAINT_H + +//todo: make into a proper class working with the iterative constraint solver + +class btRigidBody; +#include "LinearMath/btVector3.h" +#include "LinearMath/btScalar.h" +struct btContactSolverInfo; +class btManifoldPoint; + +enum { + DEFAULT_CONTACT_SOLVER_TYPE=0, + CONTACT_SOLVER_TYPE1, + CONTACT_SOLVER_TYPE2, + USER_CONTACT_SOLVER_TYPE1, + MAX_CONTACT_SOLVER_TYPES +}; + + +typedef btScalar (*ContactSolverFunc)(btRigidBody& body1, + btRigidBody& body2, + class btManifoldPoint& contactPoint, + const btContactSolverInfo& info); + +///stores some extra information to each contact point. It is not in the contact point, because that want to keep the collision detection independent from the constraint solver. +struct btConstraintPersistentData +{ + inline btConstraintPersistentData() + :m_appliedImpulse(btScalar(0.)), + m_prevAppliedImpulse(btScalar(0.)), + m_accumulatedTangentImpulse0(btScalar(0.)), + m_accumulatedTangentImpulse1(btScalar(0.)), + m_jacDiagABInv(btScalar(0.)), + m_persistentLifeTime(0), + m_restitution(btScalar(0.)), + m_friction(btScalar(0.)), + m_penetration(btScalar(0.)), + m_contactSolverFunc(0), + m_frictionSolverFunc(0) + { + } + + + /// total applied impulse during most recent frame + btScalar m_appliedImpulse; + btScalar m_prevAppliedImpulse; + btScalar m_accumulatedTangentImpulse0; + btScalar m_accumulatedTangentImpulse1; + + btScalar m_jacDiagABInv; + btScalar m_jacDiagABInvTangent0; + btScalar m_jacDiagABInvTangent1; + int m_persistentLifeTime; + btScalar m_restitution; + btScalar m_friction; + btScalar m_penetration; + btVector3 m_frictionWorldTangential0; + btVector3 m_frictionWorldTangential1; + + btVector3 m_frictionAngularComponent0A; + btVector3 m_frictionAngularComponent0B; + btVector3 m_frictionAngularComponent1A; + btVector3 m_frictionAngularComponent1B; + + //some data doesn't need to be persistent over frames: todo: clean/reuse this + btVector3 m_angularComponentA; + btVector3 m_angularComponentB; + + ContactSolverFunc m_contactSolverFunc; + ContactSolverFunc m_frictionSolverFunc; + +}; + +///bilateral constraint between two dynamic objects +///positive distance = separation, negative distance = penetration +void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1, + btRigidBody& body2, const btVector3& pos2, + btScalar distance, const btVector3& normal,btScalar& impulse ,btScalar timeStep); + + +///contact constraint resolution: +///calculate and apply impulse to satisfy non-penetration and non-negative relative velocity constraint +///positive distance = separation, negative distance = penetration +btScalar resolveSingleCollision( + btRigidBody& body1, + btRigidBody& body2, + btManifoldPoint& contactPoint, + const btContactSolverInfo& info); + +btScalar resolveSingleFriction( + btRigidBody& body1, + btRigidBody& body2, + btManifoldPoint& contactPoint, + const btContactSolverInfo& solverInfo + ); + + + +btScalar resolveSingleCollisionCombined( + btRigidBody& body1, + btRigidBody& body2, + btManifoldPoint& contactPoint, + const btContactSolverInfo& solverInfo + ); + +#endif //CONTACT_CONSTRAINT_H diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h new file mode 100644 index 000000000..ad2c40e21 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h @@ -0,0 +1,51 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONTACT_SOLVER_INFO +#define CONTACT_SOLVER_INFO + +struct btContactSolverInfoData +{ + btScalar m_tau; + btScalar m_damping; + btScalar m_friction; + btScalar m_timeStep; + btScalar m_restitution; + int m_numIterations; + btScalar m_maxErrorReduction; + btScalar m_sor; + btScalar m_erp; + +}; + +struct btContactSolverInfo : public btContactSolverInfoData +{ + + inline btContactSolverInfo() + { + m_tau = btScalar(0.6); + m_damping = btScalar(1.0); + m_friction = btScalar(0.3); + m_restitution = btScalar(0.); + m_maxErrorReduction = btScalar(20.); + m_numIterations = 10; + m_erp = btScalar(0.4); + m_sor = btScalar(1.3); + } + + +}; + +#endif //CONTACT_SOLVER_INFO diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp b/src/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp new file mode 100644 index 000000000..96d48f9f7 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp @@ -0,0 +1,497 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +/* +2007-09-09 +Refactored by Francisco León +email: projectileman@yahoo.com +http://gimpact.sf.net +*/ + + +#include "btGeneric6DofConstraint.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "LinearMath/btTransformUtil.h" +#include + + +static const btScalar kSign[] = { btScalar(1.0), btScalar(-1.0), btScalar(1.0) }; +static const int kAxisA[] = { 1, 0, 0 }; +static const int kAxisB[] = { 2, 2, 1 }; +#define GENERIC_D6_DISABLE_WARMSTARTING 1 + +btScalar btGetMatrixElem(const btMatrix3x3& mat, int index) +{ + int i = index%3; + int j = index/3; + return mat[i][j]; +} + +///MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3.inl.html +bool matrixToEulerXYZ(const btMatrix3x3& mat,btVector3& xyz) +{ +// // rot = cy*cz -cy*sz sy +// // cz*sx*sy+cx*sz cx*cz-sx*sy*sz -cy*sx +// // -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy +// + + if (btGetMatrixElem(mat,2) < btScalar(1.0)) + { + if (btGetMatrixElem(mat,2) > btScalar(-1.0)) + { + xyz[0] = btAtan2(-btGetMatrixElem(mat,5),btGetMatrixElem(mat,8)); + xyz[1] = btAsin(btGetMatrixElem(mat,2)); + xyz[2] = btAtan2(-btGetMatrixElem(mat,1),btGetMatrixElem(mat,0)); + return true; + } + else + { + // WARNING. Not unique. XA - ZA = -atan2(r10,r11) + xyz[0] = -btAtan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4)); + xyz[1] = -SIMD_HALF_PI; + xyz[2] = btScalar(0.0); + return false; + } + } + else + { + // WARNING. Not unique. XAngle + ZAngle = atan2(r10,r11) + xyz[0] = btAtan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4)); + xyz[1] = SIMD_HALF_PI; + xyz[2] = 0.0; + + } + + + return false; +} + + + +//////////////////////////// btRotationalLimitMotor //////////////////////////////////// + + +int btRotationalLimitMotor::testLimitValue(btScalar test_value) +{ + if(m_loLimit>m_hiLimit) + { + m_currentLimit = 0;//Free from violation + return 0; + } + + if (test_value < m_loLimit) + { + m_currentLimit = 1;//low limit violation + m_currentLimitError = test_value - m_loLimit; + return 1; + } + else if (test_value> m_hiLimit) + { + m_currentLimit = 2;//High limit violation + m_currentLimitError = test_value - m_hiLimit; + return 2; + } + else + { + m_currentLimit = 0;//Free from violation + return 0; + } + return 0; +} + + +btScalar btRotationalLimitMotor::solveAngularLimits( + btScalar timeStep,btVector3& axis,btScalar jacDiagABInv, + btRigidBody * body0, btRigidBody * body1) +{ + if (needApplyTorques()==false) return 0.0f; + + btScalar target_velocity = m_targetVelocity; + btScalar maxMotorForce = m_maxMotorForce; + + //current error correction + if (m_currentLimit!=0) + { + target_velocity = -m_ERP*m_currentLimitError/(timeStep); + maxMotorForce = m_maxLimitForce; + } + + maxMotorForce *= timeStep; + + // current velocity difference + btVector3 vel_diff = body0->getAngularVelocity(); + if (body1) + { + vel_diff -= body1->getAngularVelocity(); + } + + + + btScalar rel_vel = axis.dot(vel_diff); + + // correction velocity + btScalar motor_relvel = m_limitSoftness*(target_velocity - m_damping*rel_vel); + + + if ( motor_relvel < SIMD_EPSILON && motor_relvel > -SIMD_EPSILON ) + { + return 0.0f;//no need for applying force + } + + + // correction impulse + btScalar unclippedMotorImpulse = (1+m_bounce)*motor_relvel*jacDiagABInv; + + // clip correction impulse + btScalar clippedMotorImpulse; + + //todo: should clip against accumulated impulse + if (unclippedMotorImpulse>0.0f) + { + clippedMotorImpulse = unclippedMotorImpulse > maxMotorForce? maxMotorForce: unclippedMotorImpulse; + } + else + { + clippedMotorImpulse = unclippedMotorImpulse < -maxMotorForce ? -maxMotorForce: unclippedMotorImpulse; + } + + + // sort with accumulated impulses + btScalar lo = btScalar(-1e30); + btScalar hi = btScalar(1e30); + + btScalar oldaccumImpulse = m_accumulatedImpulse; + btScalar sum = oldaccumImpulse + clippedMotorImpulse; + m_accumulatedImpulse = sum > hi ? btScalar(0.) : sum < lo ? btScalar(0.) : sum; + + clippedMotorImpulse = m_accumulatedImpulse - oldaccumImpulse; + + + + btVector3 motorImp = clippedMotorImpulse * axis; + + + body0->applyTorqueImpulse(motorImp); + if (body1) body1->applyTorqueImpulse(-motorImp); + + return clippedMotorImpulse; + + +} + +//////////////////////////// End btRotationalLimitMotor //////////////////////////////////// + +//////////////////////////// btTranslationalLimitMotor //////////////////////////////////// +btScalar btTranslationalLimitMotor::solveLinearAxis( + btScalar timeStep, + btScalar jacDiagABInv, + btRigidBody& body1,const btVector3 &pointInA, + btRigidBody& body2,const btVector3 &pointInB, + int limit_index, + const btVector3 & axis_normal_on_a) +{ + +///find relative velocity + btVector3 rel_pos1 = pointInA - body1.getCenterOfMassPosition(); + btVector3 rel_pos2 = pointInB - body2.getCenterOfMassPosition(); + + btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + btScalar rel_vel = axis_normal_on_a.dot(vel); + + + +/// apply displacement correction + +//positional error (zeroth order error) + btScalar depth = -(pointInA - pointInB).dot(axis_normal_on_a); + btScalar lo = btScalar(-1e30); + btScalar hi = btScalar(1e30); + + btScalar minLimit = m_lowerLimit[limit_index]; + btScalar maxLimit = m_upperLimit[limit_index]; + + //handle the limits + if (minLimit < maxLimit) + { + { + if (depth > maxLimit) + { + depth -= maxLimit; + lo = btScalar(0.); + + } + else + { + if (depth < minLimit) + { + depth -= minLimit; + hi = btScalar(0.); + } + else + { + return 0.0f; + } + } + } + } + + btScalar normalImpulse= m_limitSoftness*(m_restitution*depth/timeStep - m_damping*rel_vel) * jacDiagABInv; + + + + + btScalar oldNormalImpulse = m_accumulatedImpulse[limit_index]; + btScalar sum = oldNormalImpulse + normalImpulse; + m_accumulatedImpulse[limit_index] = sum > hi ? btScalar(0.) : sum < lo ? btScalar(0.) : sum; + normalImpulse = m_accumulatedImpulse[limit_index] - oldNormalImpulse; + + btVector3 impulse_vector = axis_normal_on_a * normalImpulse; + body1.applyImpulse( impulse_vector, rel_pos1); + body2.applyImpulse(-impulse_vector, rel_pos2); + return normalImpulse; +} + +//////////////////////////// btTranslationalLimitMotor //////////////////////////////////// + + +btGeneric6DofConstraint::btGeneric6DofConstraint() + :btTypedConstraint(D6_CONSTRAINT_TYPE), + m_useLinearReferenceFrameA(true) +{ +} + +btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA) + : btTypedConstraint(D6_CONSTRAINT_TYPE, rbA, rbB) + , m_frameInA(frameInA) + , m_frameInB(frameInB), + m_useLinearReferenceFrameA(useLinearReferenceFrameA) +{ + +} + + + + + +void btGeneric6DofConstraint::calculateAngleInfo() +{ + btMatrix3x3 relative_frame = m_calculatedTransformA.getBasis().inverse()*m_calculatedTransformB.getBasis(); + + matrixToEulerXYZ(relative_frame,m_calculatedAxisAngleDiff); + + + + // in euler angle mode we do not actually constrain the angular velocity + // along the axes axis[0] and axis[2] (although we do use axis[1]) : + // + // to get constrain w2-w1 along ...not + // ------ --------------------- ------ + // d(angle[0])/dt = 0 ax[1] x ax[2] ax[0] + // d(angle[1])/dt = 0 ax[1] + // d(angle[2])/dt = 0 ax[0] x ax[1] ax[2] + // + // constraining w2-w1 along an axis 'a' means that a'*(w2-w1)=0. + // to prove the result for angle[0], write the expression for angle[0] from + // GetInfo1 then take the derivative. to prove this for angle[2] it is + // easier to take the euler rate expression for d(angle[2])/dt with respect + // to the components of w and set that to 0. + + btVector3 axis0 = m_calculatedTransformB.getBasis().getColumn(0); + btVector3 axis2 = m_calculatedTransformA.getBasis().getColumn(2); + + m_calculatedAxis[1] = axis2.cross(axis0); + m_calculatedAxis[0] = m_calculatedAxis[1].cross(axis2); + m_calculatedAxis[2] = axis0.cross(m_calculatedAxis[1]); + + +// if(m_debugDrawer) +// { +// +// char buff[300]; +// sprintf(buff,"\n X: %.2f ; Y: %.2f ; Z: %.2f ", +// m_calculatedAxisAngleDiff[0], +// m_calculatedAxisAngleDiff[1], +// m_calculatedAxisAngleDiff[2]); +// m_debugDrawer->reportErrorWarning(buff); +// } + +} + +void btGeneric6DofConstraint::calculateTransforms() +{ + m_calculatedTransformA = m_rbA.getCenterOfMassTransform() * m_frameInA; + m_calculatedTransformB = m_rbB.getCenterOfMassTransform() * m_frameInB; + + calculateAngleInfo(); +} + + +void btGeneric6DofConstraint::buildLinearJacobian( + btJacobianEntry & jacLinear,const btVector3 & normalWorld, + const btVector3 & pivotAInW,const btVector3 & pivotBInW) +{ + new (&jacLinear) btJacobianEntry( + m_rbA.getCenterOfMassTransform().getBasis().transpose(), + m_rbB.getCenterOfMassTransform().getBasis().transpose(), + pivotAInW - m_rbA.getCenterOfMassPosition(), + pivotBInW - m_rbB.getCenterOfMassPosition(), + normalWorld, + m_rbA.getInvInertiaDiagLocal(), + m_rbA.getInvMass(), + m_rbB.getInvInertiaDiagLocal(), + m_rbB.getInvMass()); + +} + +void btGeneric6DofConstraint::buildAngularJacobian( + btJacobianEntry & jacAngular,const btVector3 & jointAxisW) +{ + new (&jacAngular) btJacobianEntry(jointAxisW, + m_rbA.getCenterOfMassTransform().getBasis().transpose(), + m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getInvInertiaDiagLocal(), + m_rbB.getInvInertiaDiagLocal()); + +} + +bool btGeneric6DofConstraint::testAngularLimitMotor(int axis_index) +{ + btScalar angle = m_calculatedAxisAngleDiff[axis_index]; + + //test limits + m_angularLimits[axis_index].testLimitValue(angle); + return m_angularLimits[axis_index].needApplyTorques(); +} + +void btGeneric6DofConstraint::buildJacobian() +{ + //calculates transform + calculateTransforms(); + + const btVector3& pivotAInW = m_calculatedTransformA.getOrigin(); + const btVector3& pivotBInW = m_calculatedTransformB.getOrigin(); + + + btVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition(); + btVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition(); + + btVector3 normalWorld; + int i; + //linear part + for (i=0;i<3;i++) + { + if (m_linearLimits.isLimited(i)) + { + if (m_useLinearReferenceFrameA) + normalWorld = m_calculatedTransformA.getBasis().getColumn(i); + else + normalWorld = m_calculatedTransformB.getBasis().getColumn(i); + + buildLinearJacobian( + m_jacLinear[i],normalWorld , + pivotAInW,pivotBInW); + + } + } + + // angular part + for (i=0;i<3;i++) + { + //calculates error angle + if (testAngularLimitMotor(i)) + { + normalWorld = this->getAxis(i); + // Create angular atom + buildAngularJacobian(m_jacAng[i],normalWorld); + } + } + + +} + + +void btGeneric6DofConstraint::solveConstraint(btScalar timeStep) +{ + m_timeStep = timeStep; + + //calculateTransforms(); + + int i; + + // linear + + btVector3 pointInA = m_calculatedTransformA.getOrigin(); + btVector3 pointInB = m_calculatedTransformB.getOrigin(); + + btScalar jacDiagABInv; + btVector3 linear_axis; + for (i=0;i<3;i++) + { + if (m_linearLimits.isLimited(i)) + { + jacDiagABInv = btScalar(1.) / m_jacLinear[i].getDiagonal(); + + if (m_useLinearReferenceFrameA) + linear_axis = m_calculatedTransformA.getBasis().getColumn(i); + else + linear_axis = m_calculatedTransformB.getBasis().getColumn(i); + + m_linearLimits.solveLinearAxis( + m_timeStep, + jacDiagABInv, + m_rbA,pointInA, + m_rbB,pointInB, + i,linear_axis); + + } + } + + // angular + btVector3 angular_axis; + btScalar angularJacDiagABInv; + for (i=0;i<3;i++) + { + if (m_angularLimits[i].needApplyTorques()) + { + + // get axis + angular_axis = getAxis(i); + + angularJacDiagABInv = btScalar(1.) / m_jacAng[i].getDiagonal(); + + m_angularLimits[i].solveAngularLimits(m_timeStep,angular_axis,angularJacDiagABInv, &m_rbA,&m_rbB); + } + } +} + +void btGeneric6DofConstraint::updateRHS(btScalar timeStep) +{ + (void)timeStep; + +} + +btVector3 btGeneric6DofConstraint::getAxis(int axis_index) const +{ + return m_calculatedAxis[axis_index]; +} + +btScalar btGeneric6DofConstraint::getAngle(int axis_index) const +{ + return m_calculatedAxisAngleDiff[axis_index]; +} + + diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h new file mode 100644 index 000000000..e4683b91b --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h @@ -0,0 +1,433 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +/* +2007-09-09 +btGeneric6DofConstraint Refactored by Francisco León +email: projectileman@yahoo.com +http://gimpact.sf.net +*/ + + +#ifndef GENERIC_6DOF_CONSTRAINT_H +#define GENERIC_6DOF_CONSTRAINT_H + +#include "LinearMath/btVector3.h" +#include "btJacobianEntry.h" +#include "btTypedConstraint.h" + +class btRigidBody; + + +//! Rotation Limit structure for generic joints +class btRotationalLimitMotor +{ +public: + //! limit_parameters + //!@{ + btScalar m_loLimit;//!< joint limit + btScalar m_hiLimit;//!< joint limit + btScalar m_targetVelocity;//!< target motor velocity + btScalar m_maxMotorForce;//!< max force on motor + btScalar m_maxLimitForce;//!< max force on limit + btScalar m_damping;//!< Damping. + btScalar m_limitSoftness;//! Relaxation factor + btScalar m_ERP;//!< Error tolerance factor when joint is at limit + btScalar m_bounce;//!< restitution factor + bool m_enableMotor; + + //!@} + + //! temp_variables + //!@{ + btScalar m_currentLimitError;//! How much is violated this limit + int m_currentLimit;//!< 0=free, 1=at lo limit, 2=at hi limit + btScalar m_accumulatedImpulse; + //!@} + + btRotationalLimitMotor() + { + m_accumulatedImpulse = 0.f; + m_targetVelocity = 0; + m_maxMotorForce = 0.1f; + m_maxLimitForce = 300.0f; + m_loLimit = -SIMD_INFINITY; + m_hiLimit = SIMD_INFINITY; + m_ERP = 0.5f; + m_bounce = 0.0f; + m_damping = 1.0f; + m_limitSoftness = 0.5f; + m_currentLimit = 0; + m_currentLimitError = 0; + m_enableMotor = false; + } + + btRotationalLimitMotor(const btRotationalLimitMotor & limot) + { + m_targetVelocity = limot.m_targetVelocity; + m_maxMotorForce = limot.m_maxMotorForce; + m_limitSoftness = limot.m_limitSoftness; + m_loLimit = limot.m_loLimit; + m_hiLimit = limot.m_hiLimit; + m_ERP = limot.m_ERP; + m_bounce = limot.m_bounce; + m_currentLimit = limot.m_currentLimit; + m_currentLimitError = limot.m_currentLimitError; + m_enableMotor = limot.m_enableMotor; + } + + + + //! Is limited + bool isLimited() + { + if(m_loLimit>=m_hiLimit) return false; + return true; + } + + //! Need apply correction + bool needApplyTorques() + { + if(m_currentLimit == 0 && m_enableMotor == false) return false; + return true; + } + + //! calculates error + /*! + calculates m_currentLimit and m_currentLimitError. + */ + int testLimitValue(btScalar test_value); + + //! apply the correction impulses for two bodies + btScalar solveAngularLimits(btScalar timeStep,btVector3& axis, btScalar jacDiagABInv,btRigidBody * body0, btRigidBody * body1); + + +}; + + + +class btTranslationalLimitMotor +{ +public: + btVector3 m_lowerLimit;//!< the constraint lower limits + btVector3 m_upperLimit;//!< the constraint upper limits + btVector3 m_accumulatedImpulse; + //! Linear_Limit_parameters + //!@{ + btScalar m_limitSoftness;//!< Softness for linear limit + btScalar m_damping;//!< Damping for linear limit + btScalar m_restitution;//! Bounce parameter for linear limit + //!@} + + btTranslationalLimitMotor() + { + m_lowerLimit.setValue(0.f,0.f,0.f); + m_upperLimit.setValue(0.f,0.f,0.f); + m_accumulatedImpulse.setValue(0.f,0.f,0.f); + + m_limitSoftness = 0.7f; + m_damping = btScalar(1.0f); + m_restitution = btScalar(0.5f); + } + + btTranslationalLimitMotor(const btTranslationalLimitMotor & other ) + { + m_lowerLimit = other.m_lowerLimit; + m_upperLimit = other.m_upperLimit; + m_accumulatedImpulse = other.m_accumulatedImpulse; + + m_limitSoftness = other.m_limitSoftness ; + m_damping = other.m_damping; + m_restitution = other.m_restitution; + } + + //! Test limit + /*! + - free means upper < lower, + - locked means upper == lower + - limited means upper > lower + - limitIndex: first 3 are linear, next 3 are angular + */ + inline bool isLimited(int limitIndex) + { + return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]); + } + + + btScalar solveLinearAxis( + btScalar timeStep, + btScalar jacDiagABInv, + btRigidBody& body1,const btVector3 &pointInA, + btRigidBody& body2,const btVector3 &pointInB, + int limit_index, + const btVector3 & axis_normal_on_a); + + +}; + +/// btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space +/*! +btGeneric6DofConstraint can leave any of the 6 degree of freedom 'free' or 'locked'. +currently this limit supports rotational motors
+
    +
  • For Linear limits, use btGeneric6DofConstraint.setLinearUpperLimit, btGeneric6DofConstraint.setLinearLowerLimit. You can set the parameters with the btTranslationalLimitMotor structure accsesible through the btGeneric6DofConstraint.getTranslationalLimitMotor method. +At this moment translational motors are not supported. May be in the future.
  • + +
  • For Angular limits, use the btRotationalLimitMotor structure for configuring the limit. +This is accessible through btGeneric6DofConstraint.getLimitMotor method, +This brings support for limit parameters and motors.
  • + +
  • Angulars limits have these possible ranges: + +AXIS + + + + + + + + + + + + +
    MIN ANGLEMAX ANGLEX-PIPIY-PI/2PI/2Z-PI/2PI/2
    +
  • +
+ +*/ +class btGeneric6DofConstraint : public btTypedConstraint +{ +protected: + + //! relative_frames + //!@{ + btTransform m_frameInA;//!< the constraint space w.r.t body A + btTransform m_frameInB;//!< the constraint space w.r.t body B + //!@} + + //! Jacobians + //!@{ + btJacobianEntry m_jacLinear[3];//!< 3 orthogonal linear constraints + btJacobianEntry m_jacAng[3];//!< 3 orthogonal angular constraints + //!@} + + //! Linear_Limit_parameters + //!@{ + btTranslationalLimitMotor m_linearLimits; + //!@} + + + //! hinge_parameters + //!@{ + btRotationalLimitMotor m_angularLimits[3]; + //!@} + + +protected: + //! temporal variables + //!@{ + btScalar m_timeStep; + btTransform m_calculatedTransformA; + btTransform m_calculatedTransformB; + btVector3 m_calculatedAxisAngleDiff; + btVector3 m_calculatedAxis[3]; + + bool m_useLinearReferenceFrameA; + + //!@} + + btGeneric6DofConstraint& operator=(btGeneric6DofConstraint& other) + { + btAssert(0); + (void) other; + return *this; + } + + + + void buildLinearJacobian( + btJacobianEntry & jacLinear,const btVector3 & normalWorld, + const btVector3 & pivotAInW,const btVector3 & pivotBInW); + + void buildAngularJacobian(btJacobianEntry & jacAngular,const btVector3 & jointAxisW); + + + //! calcs the euler angles between the two bodies. + void calculateAngleInfo(); + + + +public: + btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA); + + btGeneric6DofConstraint(); + + //! Calcs global transform of the offsets + /*! + Calcs the global transform for the joint offset for body A an B, and also calcs the agle differences between the bodies. + \sa btGeneric6DofConstraint.getCalculatedTransformA , btGeneric6DofConstraint.getCalculatedTransformB, btGeneric6DofConstraint.calculateAngleInfo + */ + void calculateTransforms(); + + //! Gets the global transform of the offset for body A + /*! + \sa btGeneric6DofConstraint.getFrameOffsetA, btGeneric6DofConstraint.getFrameOffsetB, btGeneric6DofConstraint.calculateAngleInfo. + */ + const btTransform & getCalculatedTransformA() const + { + return m_calculatedTransformA; + } + + //! Gets the global transform of the offset for body B + /*! + \sa btGeneric6DofConstraint.getFrameOffsetA, btGeneric6DofConstraint.getFrameOffsetB, btGeneric6DofConstraint.calculateAngleInfo. + */ + const btTransform & getCalculatedTransformB() const + { + return m_calculatedTransformB; + } + + const btTransform & getFrameOffsetA() const + { + return m_frameInA; + } + + const btTransform & getFrameOffsetB() const + { + return m_frameInB; + } + + + btTransform & getFrameOffsetA() + { + return m_frameInA; + } + + btTransform & getFrameOffsetB() + { + return m_frameInB; + } + + + //! performs Jacobian calculation, and also calculates angle differences and axis + virtual void buildJacobian(); + + virtual void solveConstraint(btScalar timeStep); + + void updateRHS(btScalar timeStep); + + //! Get the rotation axis in global coordinates + /*! + \pre btGeneric6DofConstraint.buildJacobian must be called previously. + */ + btVector3 getAxis(int axis_index) const; + + //! Get the relative Euler angle + /*! + \pre btGeneric6DofConstraint.buildJacobian must be called previously. + */ + btScalar getAngle(int axis_index) const; + + //! Test angular limit. + /*! + Calculates angular correction and returns true if limit needs to be corrected. + \pre btGeneric6DofConstraint.buildJacobian must be called previously. + */ + bool testAngularLimitMotor(int axis_index); + + void setLinearLowerLimit(const btVector3& linearLower) + { + m_linearLimits.m_lowerLimit = linearLower; + } + + void setLinearUpperLimit(const btVector3& linearUpper) + { + m_linearLimits.m_upperLimit = linearUpper; + } + + void setAngularLowerLimit(const btVector3& angularLower) + { + m_angularLimits[0].m_loLimit = angularLower.getX(); + m_angularLimits[1].m_loLimit = angularLower.getY(); + m_angularLimits[2].m_loLimit = angularLower.getZ(); + } + + void setAngularUpperLimit(const btVector3& angularUpper) + { + m_angularLimits[0].m_hiLimit = angularUpper.getX(); + m_angularLimits[1].m_hiLimit = angularUpper.getY(); + m_angularLimits[2].m_hiLimit = angularUpper.getZ(); + } + + //! Retrieves the angular limit informacion + btRotationalLimitMotor * getRotationalLimitMotor(int index) + { + return &m_angularLimits[index]; + } + + //! Retrieves the limit informacion + btTranslationalLimitMotor * getTranslationalLimitMotor() + { + return &m_linearLimits; + } + + //first 3 are linear, next 3 are angular + void setLimit(int axis, btScalar lo, btScalar hi) + { + if(axis<3) + { + m_linearLimits.m_lowerLimit[axis] = lo; + m_linearLimits.m_upperLimit[axis] = hi; + } + else + { + m_angularLimits[axis-3].m_loLimit = lo; + m_angularLimits[axis-3].m_hiLimit = hi; + } + } + + //! Test limit + /*! + - free means upper < lower, + - locked means upper == lower + - limited means upper > lower + - limitIndex: first 3 are linear, next 3 are angular + */ + bool isLimited(int limitIndex) + { + if(limitIndex<3) + { + return m_linearLimits.isLimited(limitIndex); + + } + return m_angularLimits[limitIndex-3].isLimited(); + } + + const btRigidBody& getRigidBodyA() const + { + return m_rbA; + } + const btRigidBody& getRigidBodyB() const + { + return m_rbB; + } + + +}; + +#endif //GENERIC_6DOF_CONSTRAINT_H diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp b/src/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp new file mode 100644 index 000000000..f71698fa6 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp @@ -0,0 +1,400 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btHingeConstraint.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "LinearMath/btTransformUtil.h" +#include "LinearMath/btMinMax.h" +#include + + +btHingeConstraint::btHingeConstraint() +: btTypedConstraint (HINGE_CONSTRAINT_TYPE), +m_enableAngularMotor(false) +{ +} + +btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB, + btVector3& axisInA,btVector3& axisInB) + :btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB), + m_angularOnly(false), + m_enableAngularMotor(false) +{ + m_rbAFrame.getOrigin() = pivotInA; + + // since no frame is given, assume this to be zero angle and just pick rb transform axis + btVector3 rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(0); + btScalar projection = rbAxisA1.dot(axisInA); + if (projection > SIMD_EPSILON) + rbAxisA1 = rbAxisA1*projection - axisInA; + else + rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(1); + + btVector3 rbAxisA2 = rbAxisA1.cross(axisInA); + + m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(), + rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(), + rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() ); + + btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB); + btVector3 rbAxisB1 = quatRotate(rotationArc,rbAxisA1); + btVector3 rbAxisB2 = rbAxisB1.cross(axisInB); + + + m_rbBFrame.getOrigin() = pivotInB; + m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),-axisInB.getX(), + rbAxisB1.getY(),rbAxisB2.getY(),-axisInB.getY(), + rbAxisB1.getZ(),rbAxisB2.getZ(),-axisInB.getZ() ); + + //start with free + m_lowerLimit = btScalar(1e30); + m_upperLimit = btScalar(-1e30); + m_biasFactor = 0.3f; + m_relaxationFactor = 1.0f; + m_limitSoftness = 0.9f; + m_solveLimit = false; + +} + + +btHingeConstraint::btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,btVector3& axisInA) +:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA), m_angularOnly(false), m_enableAngularMotor(false) +{ + + // since no frame is given, assume this to be zero angle and just pick rb transform axis + // fixed axis in worldspace + btVector3 rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(0); + btScalar projection = rbAxisA1.dot(axisInA); + if (projection > SIMD_EPSILON) + rbAxisA1 = rbAxisA1*projection - axisInA; + else + rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(1); + + btVector3 rbAxisA2 = axisInA.cross(rbAxisA1); + + m_rbAFrame.getOrigin() = pivotInA; + m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(), + rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(), + rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() ); + + + btVector3 axisInB = rbA.getCenterOfMassTransform().getBasis() * -axisInA; + + btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB); + btVector3 rbAxisB1 = quatRotate(rotationArc,rbAxisA1); + btVector3 rbAxisB2 = axisInB.cross(rbAxisB1); + + + m_rbBFrame.getOrigin() = rbA.getCenterOfMassTransform()(pivotInA); + m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(), + rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(), + rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() ); + + //start with free + m_lowerLimit = btScalar(1e30); + m_upperLimit = btScalar(-1e30); + m_biasFactor = 0.3f; + m_relaxationFactor = 1.0f; + m_limitSoftness = 0.9f; + m_solveLimit = false; +} + +btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, + const btTransform& rbAFrame, const btTransform& rbBFrame) +:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame), +m_angularOnly(false), +m_enableAngularMotor(false) +{ + // flip axis + m_rbBFrame.getBasis()[0][2] *= btScalar(-1.); + m_rbBFrame.getBasis()[1][2] *= btScalar(-1.); + m_rbBFrame.getBasis()[2][2] *= btScalar(-1.); + + //start with free + m_lowerLimit = btScalar(1e30); + m_upperLimit = btScalar(-1e30); + m_biasFactor = 0.3f; + m_relaxationFactor = 1.0f; + m_limitSoftness = 0.9f; + m_solveLimit = false; +} + + + +btHingeConstraint::btHingeConstraint(btRigidBody& rbA, const btTransform& rbAFrame) +:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA),m_rbAFrame(rbAFrame),m_rbBFrame(rbAFrame), +m_angularOnly(false), +m_enableAngularMotor(false) +{ + ///not providing rigidbody B means implicitly using worldspace for body B + + // flip axis + m_rbBFrame.getBasis()[0][2] *= btScalar(-1.); + m_rbBFrame.getBasis()[1][2] *= btScalar(-1.); + m_rbBFrame.getBasis()[2][2] *= btScalar(-1.); + + m_rbBFrame.getOrigin() = m_rbA.getCenterOfMassTransform()(m_rbAFrame.getOrigin()); + + //start with free + m_lowerLimit = btScalar(1e30); + m_upperLimit = btScalar(-1e30); + m_biasFactor = 0.3f; + m_relaxationFactor = 1.0f; + m_limitSoftness = 0.9f; + m_solveLimit = false; +} + +void btHingeConstraint::buildJacobian() +{ + m_appliedImpulse = btScalar(0.); + + if (!m_angularOnly) + { + btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin(); + btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin(); + btVector3 relPos = pivotBInW - pivotAInW; + + btVector3 normal[3]; + if (relPos.length2() > SIMD_EPSILON) + { + normal[0] = relPos.normalized(); + } + else + { + normal[0].setValue(btScalar(1.0),0,0); + } + + btPlaneSpace1(normal[0], normal[1], normal[2]); + + for (int i=0;i<3;i++) + { + new (&m_jac[i]) btJacobianEntry( + m_rbA.getCenterOfMassTransform().getBasis().transpose(), + m_rbB.getCenterOfMassTransform().getBasis().transpose(), + pivotAInW - m_rbA.getCenterOfMassPosition(), + pivotBInW - m_rbB.getCenterOfMassPosition(), + normal[i], + m_rbA.getInvInertiaDiagLocal(), + m_rbA.getInvMass(), + m_rbB.getInvInertiaDiagLocal(), + m_rbB.getInvMass()); + } + } + + //calculate two perpendicular jointAxis, orthogonal to hingeAxis + //these two jointAxis require equal angular velocities for both bodies + + //this is unused for now, it's a todo + btVector3 jointAxis0local; + btVector3 jointAxis1local; + + btPlaneSpace1(m_rbAFrame.getBasis().getColumn(2),jointAxis0local,jointAxis1local); + + getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(2); + btVector3 jointAxis0 = getRigidBodyA().getCenterOfMassTransform().getBasis() * jointAxis0local; + btVector3 jointAxis1 = getRigidBodyA().getCenterOfMassTransform().getBasis() * jointAxis1local; + btVector3 hingeAxisWorld = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(2); + + new (&m_jacAng[0]) btJacobianEntry(jointAxis0, + m_rbA.getCenterOfMassTransform().getBasis().transpose(), + m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getInvInertiaDiagLocal(), + m_rbB.getInvInertiaDiagLocal()); + + new (&m_jacAng[1]) btJacobianEntry(jointAxis1, + m_rbA.getCenterOfMassTransform().getBasis().transpose(), + m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getInvInertiaDiagLocal(), + m_rbB.getInvInertiaDiagLocal()); + + new (&m_jacAng[2]) btJacobianEntry(hingeAxisWorld, + m_rbA.getCenterOfMassTransform().getBasis().transpose(), + m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getInvInertiaDiagLocal(), + m_rbB.getInvInertiaDiagLocal()); + + + // Compute limit information + btScalar hingeAngle = getHingeAngle(); + + //set bias, sign, clear accumulator + m_correction = btScalar(0.); + m_limitSign = btScalar(0.); + m_solveLimit = false; + m_accLimitImpulse = btScalar(0.); + + if (m_lowerLimit < m_upperLimit) + { + if (hingeAngle <= m_lowerLimit*m_limitSoftness) + { + m_correction = (m_lowerLimit - hingeAngle); + m_limitSign = 1.0f; + m_solveLimit = true; + } + else if (hingeAngle >= m_upperLimit*m_limitSoftness) + { + m_correction = m_upperLimit - hingeAngle; + m_limitSign = -1.0f; + m_solveLimit = true; + } + } + + //Compute K = J*W*J' for hinge axis + btVector3 axisA = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(2); + m_kHinge = 1.0f / (getRigidBodyA().computeAngularImpulseDenominator(axisA) + + getRigidBodyB().computeAngularImpulseDenominator(axisA)); + +} + +void btHingeConstraint::solveConstraint(btScalar timeStep) +{ + + btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin(); + btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin(); + + btScalar tau = btScalar(0.3); + + //linear part + if (!m_angularOnly) + { + btVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition(); + btVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition(); + + btVector3 vel1 = m_rbA.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = m_rbB.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + for (int i=0;i<3;i++) + { + const btVector3& normal = m_jac[i].m_linearJointAxis; + btScalar jacDiagABInv = btScalar(1.) / m_jac[i].getDiagonal(); + + btScalar rel_vel; + rel_vel = normal.dot(vel); + //positional error (zeroth order error) + btScalar depth = -(pivotAInW - pivotBInW).dot(normal); //this is the error projected on the normal + btScalar impulse = depth*tau/timeStep * jacDiagABInv - rel_vel * jacDiagABInv; + m_appliedImpulse += impulse; + btVector3 impulse_vector = normal * impulse; + m_rbA.applyImpulse(impulse_vector, pivotAInW - m_rbA.getCenterOfMassPosition()); + m_rbB.applyImpulse(-impulse_vector, pivotBInW - m_rbB.getCenterOfMassPosition()); + } + } + + + { + ///solve angular part + + // get axes in world space + btVector3 axisA = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(2); + btVector3 axisB = getRigidBodyB().getCenterOfMassTransform().getBasis() * m_rbBFrame.getBasis().getColumn(2); + + const btVector3& angVelA = getRigidBodyA().getAngularVelocity(); + const btVector3& angVelB = getRigidBodyB().getAngularVelocity(); + + btVector3 angVelAroundHingeAxisA = axisA * axisA.dot(angVelA); + btVector3 angVelAroundHingeAxisB = axisB * axisB.dot(angVelB); + + btVector3 angAorthog = angVelA - angVelAroundHingeAxisA; + btVector3 angBorthog = angVelB - angVelAroundHingeAxisB; + btVector3 velrelOrthog = angAorthog-angBorthog; + { + //solve orthogonal angular velocity correction + btScalar relaxation = btScalar(1.); + btScalar len = velrelOrthog.length(); + if (len > btScalar(0.00001)) + { + btVector3 normal = velrelOrthog.normalized(); + btScalar denom = getRigidBodyA().computeAngularImpulseDenominator(normal) + + getRigidBodyB().computeAngularImpulseDenominator(normal); + // scale for mass and relaxation + //todo: expose this 0.9 factor to developer + velrelOrthog *= (btScalar(1.)/denom) * m_relaxationFactor; + } + + //solve angular positional correction + btVector3 angularError = -axisA.cross(axisB) *(btScalar(1.)/timeStep); + btScalar len2 = angularError.length(); + if (len2>btScalar(0.00001)) + { + btVector3 normal2 = angularError.normalized(); + btScalar denom2 = getRigidBodyA().computeAngularImpulseDenominator(normal2) + + getRigidBodyB().computeAngularImpulseDenominator(normal2); + angularError *= (btScalar(1.)/denom2) * relaxation; + } + + m_rbA.applyTorqueImpulse(-velrelOrthog+angularError); + m_rbB.applyTorqueImpulse(velrelOrthog-angularError); + + // solve limit + if (m_solveLimit) + { + btScalar amplitude = ( (angVelB - angVelA).dot( axisA )*m_relaxationFactor + m_correction* (btScalar(1.)/timeStep)*m_biasFactor ) * m_limitSign; + + btScalar impulseMag = amplitude * m_kHinge; + + // Clamp the accumulated impulse + btScalar temp = m_accLimitImpulse; + m_accLimitImpulse = btMax(m_accLimitImpulse + impulseMag, btScalar(0) ); + impulseMag = m_accLimitImpulse - temp; + + + btVector3 impulse = axisA * impulseMag * m_limitSign; + m_rbA.applyTorqueImpulse(impulse); + m_rbB.applyTorqueImpulse(-impulse); + } + } + + //apply motor + if (m_enableAngularMotor) + { + //todo: add limits too + btVector3 angularLimit(0,0,0); + + btVector3 velrel = angVelAroundHingeAxisA - angVelAroundHingeAxisB; + btScalar projRelVel = velrel.dot(axisA); + + btScalar desiredMotorVel = m_motorTargetVelocity; + btScalar motor_relvel = desiredMotorVel - projRelVel; + + btScalar unclippedMotorImpulse = m_kHinge * motor_relvel;; + //todo: should clip against accumulated impulse + btScalar clippedMotorImpulse = unclippedMotorImpulse > m_maxMotorImpulse ? m_maxMotorImpulse : unclippedMotorImpulse; + clippedMotorImpulse = clippedMotorImpulse < -m_maxMotorImpulse ? -m_maxMotorImpulse : clippedMotorImpulse; + btVector3 motorImp = clippedMotorImpulse * axisA; + + m_rbA.applyTorqueImpulse(motorImp+angularLimit); + m_rbB.applyTorqueImpulse(-motorImp-angularLimit); + + } + } + +} + +void btHingeConstraint::updateRHS(btScalar timeStep) +{ + (void)timeStep; + +} + +btScalar btHingeConstraint::getHingeAngle() +{ + const btVector3 refAxis0 = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(0); + const btVector3 refAxis1 = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(1); + const btVector3 swingAxis = getRigidBodyB().getCenterOfMassTransform().getBasis() * m_rbBFrame.getBasis().getColumn(1); + + return btAtan2Fast( swingAxis.dot(refAxis0), swingAxis.dot(refAxis1) ); +} diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h new file mode 100644 index 000000000..8d8adfe92 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h @@ -0,0 +1,130 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +/* Hinge Constraint by Dirk Gregorius. Limits added by Marcus Hennix at Starbreeze Studios */ + +#ifndef HINGECONSTRAINT_H +#define HINGECONSTRAINT_H + +#include "LinearMath/btVector3.h" +#include "btJacobianEntry.h" +#include "btTypedConstraint.h" + +class btRigidBody; + +/// hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space +/// axis defines the orientation of the hinge axis +class btHingeConstraint : public btTypedConstraint +{ +#ifdef IN_PARALLELL_SOLVER +public: +#endif + btJacobianEntry m_jac[3]; //3 orthogonal linear constraints + btJacobianEntry m_jacAng[3]; //2 orthogonal angular constraints+ 1 for limit/motor + + btTransform m_rbAFrame; // constraint axii. Assumes z is hinge axis. + btTransform m_rbBFrame; + + btScalar m_motorTargetVelocity; + btScalar m_maxMotorImpulse; + + btScalar m_limitSoftness; + btScalar m_biasFactor; + btScalar m_relaxationFactor; + + btScalar m_lowerLimit; + btScalar m_upperLimit; + + btScalar m_kHinge; + + btScalar m_limitSign; + btScalar m_correction; + + btScalar m_accLimitImpulse; + + bool m_angularOnly; + bool m_enableAngularMotor; + bool m_solveLimit; + + +public: + + btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB, btVector3& axisInA,btVector3& axisInB); + + btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,btVector3& axisInA); + + btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btTransform& rbAFrame, const btTransform& rbBFrame); + + btHingeConstraint(btRigidBody& rbA,const btTransform& rbAFrame); + + btHingeConstraint(); + + virtual void buildJacobian(); + + virtual void solveConstraint(btScalar timeStep); + + void updateRHS(btScalar timeStep); + + const btRigidBody& getRigidBodyA() const + { + return m_rbA; + } + const btRigidBody& getRigidBodyB() const + { + return m_rbB; + } + + void setAngularOnly(bool angularOnly) + { + m_angularOnly = angularOnly; + } + + void enableAngularMotor(bool enableMotor,btScalar targetVelocity,btScalar maxMotorImpulse) + { + m_enableAngularMotor = enableMotor; + m_motorTargetVelocity = targetVelocity; + m_maxMotorImpulse = maxMotorImpulse; + } + + void setLimit(btScalar low,btScalar high,btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f) + { + m_lowerLimit = low; + m_upperLimit = high; + + m_limitSoftness = _softness; + m_biasFactor = _biasFactor; + m_relaxationFactor = _relaxationFactor; + + } + + btScalar getHingeAngle(); + + + const btTransform& getAFrame() { return m_rbAFrame; }; + const btTransform& getBFrame() { return m_rbBFrame; }; + + inline int getSolveLimit() + { + return m_solveLimit; + } + + inline btScalar getLimitSign() + { + return m_limitSign; + } + +}; + +#endif //HINGECONSTRAINT_H diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h new file mode 100644 index 000000000..bfeb24c2d --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h @@ -0,0 +1,156 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef JACOBIAN_ENTRY_H +#define JACOBIAN_ENTRY_H + +#include "LinearMath/btVector3.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" + + +//notes: +// Another memory optimization would be to store m_1MinvJt in the remaining 3 w components +// which makes the btJacobianEntry memory layout 16 bytes +// if you only are interested in angular part, just feed massInvA and massInvB zero + +/// Jacobian entry is an abstraction that allows to describe constraints +/// it can be used in combination with a constraint solver +/// Can be used to relate the effect of an impulse to the constraint error +class btJacobianEntry +{ +public: + btJacobianEntry() {}; + //constraint between two different rigidbodies + btJacobianEntry( + const btMatrix3x3& world2A, + const btMatrix3x3& world2B, + const btVector3& rel_pos1,const btVector3& rel_pos2, + const btVector3& jointAxis, + const btVector3& inertiaInvA, + const btScalar massInvA, + const btVector3& inertiaInvB, + const btScalar massInvB) + :m_linearJointAxis(jointAxis) + { + m_aJ = world2A*(rel_pos1.cross(m_linearJointAxis)); + m_bJ = world2B*(rel_pos2.cross(-m_linearJointAxis)); + m_0MinvJt = inertiaInvA * m_aJ; + m_1MinvJt = inertiaInvB * m_bJ; + m_Adiag = massInvA + m_0MinvJt.dot(m_aJ) + massInvB + m_1MinvJt.dot(m_bJ); + + btAssert(m_Adiag > btScalar(0.0)); + } + + //angular constraint between two different rigidbodies + btJacobianEntry(const btVector3& jointAxis, + const btMatrix3x3& world2A, + const btMatrix3x3& world2B, + const btVector3& inertiaInvA, + const btVector3& inertiaInvB) + :m_linearJointAxis(btVector3(btScalar(0.),btScalar(0.),btScalar(0.))) + { + m_aJ= world2A*jointAxis; + m_bJ = world2B*-jointAxis; + m_0MinvJt = inertiaInvA * m_aJ; + m_1MinvJt = inertiaInvB * m_bJ; + m_Adiag = m_0MinvJt.dot(m_aJ) + m_1MinvJt.dot(m_bJ); + + btAssert(m_Adiag > btScalar(0.0)); + } + + //angular constraint between two different rigidbodies + btJacobianEntry(const btVector3& axisInA, + const btVector3& axisInB, + const btVector3& inertiaInvA, + const btVector3& inertiaInvB) + : m_linearJointAxis(btVector3(btScalar(0.),btScalar(0.),btScalar(0.))) + , m_aJ(axisInA) + , m_bJ(-axisInB) + { + m_0MinvJt = inertiaInvA * m_aJ; + m_1MinvJt = inertiaInvB * m_bJ; + m_Adiag = m_0MinvJt.dot(m_aJ) + m_1MinvJt.dot(m_bJ); + + btAssert(m_Adiag > btScalar(0.0)); + } + + //constraint on one rigidbody + btJacobianEntry( + const btMatrix3x3& world2A, + const btVector3& rel_pos1,const btVector3& rel_pos2, + const btVector3& jointAxis, + const btVector3& inertiaInvA, + const btScalar massInvA) + :m_linearJointAxis(jointAxis) + { + m_aJ= world2A*(rel_pos1.cross(jointAxis)); + m_bJ = world2A*(rel_pos2.cross(-jointAxis)); + m_0MinvJt = inertiaInvA * m_aJ; + m_1MinvJt = btVector3(btScalar(0.),btScalar(0.),btScalar(0.)); + m_Adiag = massInvA + m_0MinvJt.dot(m_aJ); + + btAssert(m_Adiag > btScalar(0.0)); + } + + btScalar getDiagonal() const { return m_Adiag; } + + // for two constraints on the same rigidbody (for example vehicle friction) + btScalar getNonDiagonal(const btJacobianEntry& jacB, const btScalar massInvA) const + { + const btJacobianEntry& jacA = *this; + btScalar lin = massInvA * jacA.m_linearJointAxis.dot(jacB.m_linearJointAxis); + btScalar ang = jacA.m_0MinvJt.dot(jacB.m_aJ); + return lin + ang; + } + + + + // for two constraints on sharing two same rigidbodies (for example two contact points between two rigidbodies) + btScalar getNonDiagonal(const btJacobianEntry& jacB,const btScalar massInvA,const btScalar massInvB) const + { + const btJacobianEntry& jacA = *this; + btVector3 lin = jacA.m_linearJointAxis * jacB.m_linearJointAxis; + btVector3 ang0 = jacA.m_0MinvJt * jacB.m_aJ; + btVector3 ang1 = jacA.m_1MinvJt * jacB.m_bJ; + btVector3 lin0 = massInvA * lin ; + btVector3 lin1 = massInvB * lin; + btVector3 sum = ang0+ang1+lin0+lin1; + return sum[0]+sum[1]+sum[2]; + } + + btScalar getRelativeVelocity(const btVector3& linvelA,const btVector3& angvelA,const btVector3& linvelB,const btVector3& angvelB) + { + btVector3 linrel = linvelA - linvelB; + btVector3 angvela = angvelA * m_aJ; + btVector3 angvelb = angvelB * m_bJ; + linrel *= m_linearJointAxis; + angvela += angvelb; + angvela += linrel; + btScalar rel_vel2 = angvela[0]+angvela[1]+angvela[2]; + return rel_vel2 + SIMD_EPSILON; + } +//private: + + btVector3 m_linearJointAxis; + btVector3 m_aJ; + btVector3 m_bJ; + btVector3 m_0MinvJt; + btVector3 m_1MinvJt; + //Optimization: can be stored in the w/last component of one of the vectors + btScalar m_Adiag; + +}; + +#endif //JACOBIAN_ENTRY_H diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp b/src/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp new file mode 100644 index 000000000..ff918ea56 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp @@ -0,0 +1,117 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btPoint2PointConstraint.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include + + + +btPoint2PointConstraint::btPoint2PointConstraint() +:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE) +{ +} + +btPoint2PointConstraint::btPoint2PointConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB) +:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE,rbA,rbB),m_pivotInA(pivotInA),m_pivotInB(pivotInB) +{ + +} + + +btPoint2PointConstraint::btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA) +:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE,rbA),m_pivotInA(pivotInA),m_pivotInB(rbA.getCenterOfMassTransform()(pivotInA)) +{ + +} + +void btPoint2PointConstraint::buildJacobian() +{ + m_appliedImpulse = btScalar(0.); + + btVector3 normal(0,0,0); + + for (int i=0;i<3;i++) + { + normal[i] = 1; + new (&m_jac[i]) btJacobianEntry( + m_rbA.getCenterOfMassTransform().getBasis().transpose(), + m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getCenterOfMassTransform()*m_pivotInA - m_rbA.getCenterOfMassPosition(), + m_rbB.getCenterOfMassTransform()*m_pivotInB - m_rbB.getCenterOfMassPosition(), + normal, + m_rbA.getInvInertiaDiagLocal(), + m_rbA.getInvMass(), + m_rbB.getInvInertiaDiagLocal(), + m_rbB.getInvMass()); + normal[i] = 0; + } + +} + +void btPoint2PointConstraint::solveConstraint(btScalar timeStep) +{ + btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_pivotInA; + btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_pivotInB; + + + btVector3 normal(0,0,0); + + +// btVector3 angvelA = m_rbA.getCenterOfMassTransform().getBasis().transpose() * m_rbA.getAngularVelocity(); +// btVector3 angvelB = m_rbB.getCenterOfMassTransform().getBasis().transpose() * m_rbB.getAngularVelocity(); + + for (int i=0;i<3;i++) + { + normal[i] = 1; + btScalar jacDiagABInv = btScalar(1.) / m_jac[i].getDiagonal(); + + btVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition(); + btVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition(); + //this jacobian entry could be re-used for all iterations + + btVector3 vel1 = m_rbA.getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = m_rbB.getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + btScalar rel_vel; + rel_vel = normal.dot(vel); + + /* + //velocity error (first order error) + btScalar rel_vel = m_jac[i].getRelativeVelocity(m_rbA.getLinearVelocity(),angvelA, + m_rbB.getLinearVelocity(),angvelB); + */ + + //positional error (zeroth order error) + btScalar depth = -(pivotAInW - pivotBInW).dot(normal); //this is the error projected on the normal + + btScalar impulse = depth*m_setting.m_tau/timeStep * jacDiagABInv - m_setting.m_damping * rel_vel * jacDiagABInv; + m_appliedImpulse+=impulse; + btVector3 impulse_vector = normal * impulse; + m_rbA.applyImpulse(impulse_vector, pivotAInW - m_rbA.getCenterOfMassPosition()); + m_rbB.applyImpulse(-impulse_vector, pivotBInW - m_rbB.getCenterOfMassPosition()); + + normal[i] = 0; + } +} + +void btPoint2PointConstraint::updateRHS(btScalar timeStep) +{ + (void)timeStep; + +} + diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h new file mode 100644 index 000000000..27872b9c8 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h @@ -0,0 +1,89 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef POINT2POINTCONSTRAINT_H +#define POINT2POINTCONSTRAINT_H + +#include "LinearMath/btVector3.h" +#include "btJacobianEntry.h" +#include "btTypedConstraint.h" + +class btRigidBody; + +struct btConstraintSetting +{ + btConstraintSetting() : + m_tau(btScalar(0.3)), + m_damping(btScalar(1.)) + { + } + btScalar m_tau; + btScalar m_damping; +}; + +/// point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocket' location in local space +class btPoint2PointConstraint : public btTypedConstraint +{ +#ifdef IN_PARALLELL_SOLVER +public: +#endif + btJacobianEntry m_jac[3]; //3 orthogonal linear constraints + + btVector3 m_pivotInA; + btVector3 m_pivotInB; + + + +public: + + btConstraintSetting m_setting; + + btPoint2PointConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB); + + btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA); + + btPoint2PointConstraint(); + + virtual void buildJacobian(); + + + virtual void solveConstraint(btScalar timeStep); + + void updateRHS(btScalar timeStep); + + void setPivotA(const btVector3& pivotA) + { + m_pivotInA = pivotA; + } + + void setPivotB(const btVector3& pivotB) + { + m_pivotInB = pivotB; + } + + const btVector3& getPivotInA() const + { + return m_pivotInA; + } + + const btVector3& getPivotInB() const + { + return m_pivotInB; + } + + +}; + +#endif //POINT2POINTCONSTRAINT_H diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/src/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp new file mode 100644 index 000000000..7d4ed7856 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp @@ -0,0 +1,1266 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +//#define COMPUTE_IMPULSE_DENOM 1 +//It is not necessary (redundant) to refresh contact manifolds, this refresh has been moved to the collision algorithms. +//#define FORCE_REFESH_CONTACT_MANIFOLDS 1 + +#include "btSequentialImpulseConstraintSolver.h" +#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "btContactConstraint.h" +#include "btSolve2LinearConstraint.h" +#include "btContactSolverInfo.h" +#include "LinearMath/btIDebugDraw.h" +#include "btJacobianEntry.h" +#include "LinearMath/btMinMax.h" +#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h" +#include +#include "LinearMath/btStackAlloc.h" +#include "LinearMath/btQuickprof.h" +#include "btSolverBody.h" +#include "btSolverConstraint.h" + +#include "LinearMath/btAlignedObjectArray.h" + +#ifdef USE_PROFILE +#include "LinearMath/btQuickprof.h" +#endif //USE_PROFILE + +int totalCpd = 0; + +int gTotalContactPoints = 0; + +struct btOrderIndex +{ + int m_manifoldIndex; + int m_pointIndex; +}; + + + +#define SEQUENTIAL_IMPULSE_MAX_SOLVER_POINTS 16384 +static btOrderIndex gOrder[SEQUENTIAL_IMPULSE_MAX_SOLVER_POINTS]; + + +unsigned long btSequentialImpulseConstraintSolver::btRand2() +{ + m_btSeed2 = (1664525L*m_btSeed2 + 1013904223L) & 0xffffffff; + return m_btSeed2; +} + + + +//See ODE: adam's all-int straightforward(?) dRandInt (0..n-1) +int btSequentialImpulseConstraintSolver::btRandInt2 (int n) +{ + // seems good; xor-fold and modulus + const unsigned long un = n; + unsigned long r = btRand2(); + + // note: probably more aggressive than it needs to be -- might be + // able to get away without one or two of the innermost branches. + if (un <= 0x00010000UL) { + r ^= (r >> 16); + if (un <= 0x00000100UL) { + r ^= (r >> 8); + if (un <= 0x00000010UL) { + r ^= (r >> 4); + if (un <= 0x00000004UL) { + r ^= (r >> 2); + if (un <= 0x00000002UL) { + r ^= (r >> 1); + } + } + } + } + } + + return (int) (r % un); +} + + + + + +bool MyContactDestroyedCallback(void* userPersistentData) +{ + assert (userPersistentData); + btConstraintPersistentData* cpd = (btConstraintPersistentData*)userPersistentData; + btAlignedFree(cpd); + totalCpd--; + //printf("totalCpd = %i. DELETED Ptr %x\n",totalCpd,userPersistentData); + return true; +} + + + +btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver() +:m_solverMode(SOLVER_RANDMIZE_ORDER | SOLVER_CACHE_FRIENDLY), //not using SOLVER_USE_WARMSTARTING, +m_btSeed2(0) +{ + gContactDestroyedCallback = &MyContactDestroyedCallback; + + //initialize default friction/contact funcs + int i,j; + for (i=0;im_angularVelocity = rigidbody->getAngularVelocity(); + solverBody->m_centerOfMassPosition = rigidbody->getCenterOfMassPosition(); + solverBody->m_friction = rigidbody->getFriction(); +// solverBody->m_invInertiaWorld = rigidbody->getInvInertiaTensorWorld(); + solverBody->m_invMass = rigidbody->getInvMass(); + solverBody->m_linearVelocity = rigidbody->getLinearVelocity(); + solverBody->m_originalBody = rigidbody; + solverBody->m_angularFactor = rigidbody->getAngularFactor(); +} + +btScalar penetrationResolveFactor = btScalar(0.9); +btScalar restitutionCurve(btScalar rel_vel, btScalar restitution) +{ + btScalar rest = restitution * -rel_vel; + return rest; +} + + + + + + +//velocity + friction +//response between two dynamic objects with friction +//SIMD_FORCE_INLINE +btScalar resolveSingleCollisionCombinedCacheFriendly( + btSolverBody& body1, + btSolverBody& body2, + const btSolverConstraint& contactConstraint, + const btContactSolverInfo& solverInfo) +{ + (void)solverInfo; + + btScalar normalImpulse; + + // Optimized version of projected relative velocity, use precomputed cross products with normal + // body1.getVelocityInLocalPoint(contactConstraint.m_rel_posA,vel1); + // body2.getVelocityInLocalPoint(contactConstraint.m_rel_posB,vel2); + // btVector3 vel = vel1 - vel2; + // btScalar rel_vel = contactConstraint.m_contactNormal.dot(vel); + + btScalar rel_vel; + btScalar vel1Dotn = contactConstraint.m_contactNormal.dot(body1.m_linearVelocity) + + contactConstraint.m_relpos1CrossNormal.dot(body1.m_angularVelocity); + btScalar vel2Dotn = contactConstraint.m_contactNormal.dot(body2.m_linearVelocity) + + contactConstraint.m_relpos2CrossNormal.dot(body2.m_angularVelocity); + + rel_vel = vel1Dotn-vel2Dotn; + + + btScalar positionalError = contactConstraint.m_penetration; + btScalar velocityError = contactConstraint.m_restitution - rel_vel;// * damping; + + btScalar penetrationImpulse = positionalError * contactConstraint.m_jacDiagABInv; + btScalar velocityImpulse = velocityError * contactConstraint.m_jacDiagABInv; + normalImpulse = penetrationImpulse+velocityImpulse; + + // See Erin Catto's GDC 2006 paper: Clamp the accumulated impulse + btScalar oldNormalImpulse = contactConstraint.m_appliedImpulse; + btScalar sum = oldNormalImpulse + normalImpulse; + contactConstraint.m_appliedImpulse = btScalar(0.) > sum ? btScalar(0.): sum; + + btScalar oldVelocityImpulse = contactConstraint.m_appliedVelocityImpulse; + btScalar velocitySum = oldVelocityImpulse + velocityImpulse; + contactConstraint.m_appliedVelocityImpulse = btScalar(0.) > velocitySum ? btScalar(0.): velocitySum; + + normalImpulse = contactConstraint.m_appliedImpulse - oldNormalImpulse; + + if (body1.m_invMass) + { + body1.internalApplyImpulse(contactConstraint.m_contactNormal*body1.m_invMass, + contactConstraint.m_angularComponentA,normalImpulse); + } + if (body2.m_invMass) + { + body2.internalApplyImpulse(contactConstraint.m_contactNormal*body2.m_invMass, + contactConstraint.m_angularComponentB,-normalImpulse); + } + + + + + + return normalImpulse; +} + + +#ifndef NO_FRICTION_TANGENTIALS + +//SIMD_FORCE_INLINE +btScalar resolveSingleFrictionCacheFriendly( + btSolverBody& body1, + btSolverBody& body2, + const btSolverConstraint& contactConstraint, + const btContactSolverInfo& solverInfo, + btScalar appliedNormalImpulse) +{ + (void)solverInfo; + + + const btScalar combinedFriction = contactConstraint.m_friction; + + const btScalar limit = appliedNormalImpulse * combinedFriction; + + if (appliedNormalImpulse>btScalar(0.)) + //friction + { + + btScalar j1; + { + + btScalar rel_vel; + const btScalar vel1Dotn = contactConstraint.m_contactNormal.dot(body1.m_linearVelocity) + + contactConstraint.m_relpos1CrossNormal.dot(body1.m_angularVelocity); + const btScalar vel2Dotn = contactConstraint.m_contactNormal.dot(body2.m_linearVelocity) + + contactConstraint.m_relpos2CrossNormal.dot(body2.m_angularVelocity); + rel_vel = vel1Dotn-vel2Dotn; + + // calculate j that moves us to zero relative velocity + j1 = -rel_vel * contactConstraint.m_jacDiagABInv; +#define CLAMP_ACCUMULATED_FRICTION_IMPULSE 1 +#ifdef CLAMP_ACCUMULATED_FRICTION_IMPULSE + btScalar oldTangentImpulse = contactConstraint.m_appliedImpulse; + contactConstraint.m_appliedImpulse = oldTangentImpulse + j1; + + if (limit < contactConstraint.m_appliedImpulse) + { + contactConstraint.m_appliedImpulse = limit; + } else + { + if (contactConstraint.m_appliedImpulse < -limit) + contactConstraint.m_appliedImpulse = -limit; + } + j1 = contactConstraint.m_appliedImpulse - oldTangentImpulse; +#else + if (limit < j1) + { + j1 = limit; + } else + { + if (j1 < -limit) + j1 = -limit; + } + +#endif //CLAMP_ACCUMULATED_FRICTION_IMPULSE + + //GEN_set_min(contactConstraint.m_appliedImpulse, limit); + //GEN_set_max(contactConstraint.m_appliedImpulse, -limit); + + + + } + + if (body1.m_invMass) + { + body1.internalApplyImpulse(contactConstraint.m_contactNormal*body1.m_invMass,contactConstraint.m_angularComponentA,j1); + } + if (body2.m_invMass) + { + body2.internalApplyImpulse(contactConstraint.m_contactNormal*body2.m_invMass,contactConstraint.m_angularComponentB,-j1); + } + + } + return 0.f; +} + + +#else + +//velocity + friction +//response between two dynamic objects with friction +btScalar resolveSingleFrictionCacheFriendly( + btSolverBody& body1, + btSolverBody& body2, + btSolverConstraint& contactConstraint, + const btContactSolverInfo& solverInfo) +{ + + btVector3 vel1; + btVector3 vel2; + btScalar normalImpulse(0.f); + + { + const btVector3& normal = contactConstraint.m_contactNormal; + if (contactConstraint.m_penetration < 0.f) + return 0.f; + + + body1.getVelocityInLocalPoint(contactConstraint.m_rel_posA,vel1); + body2.getVelocityInLocalPoint(contactConstraint.m_rel_posB,vel2); + btVector3 vel = vel1 - vel2; + btScalar rel_vel; + rel_vel = normal.dot(vel); + + btVector3 lat_vel = vel - normal * rel_vel; + btScalar lat_rel_vel = lat_vel.length2(); + + btScalar combinedFriction = contactConstraint.m_friction; + const btVector3& rel_pos1 = contactConstraint.m_rel_posA; + const btVector3& rel_pos2 = contactConstraint.m_rel_posB; + + + //if (contactConstraint.m_appliedVelocityImpulse > 0.f) + if (lat_rel_vel > SIMD_EPSILON*SIMD_EPSILON) + { + lat_rel_vel = btSqrt(lat_rel_vel); + + lat_vel /= lat_rel_vel; + btVector3 temp1 = body1.m_invInertiaWorld * rel_pos1.cross(lat_vel); + btVector3 temp2 = body2.m_invInertiaWorld * rel_pos2.cross(lat_vel); + btScalar friction_impulse = lat_rel_vel / + (body1.m_invMass + body2.m_invMass + lat_vel.dot(temp1.cross(rel_pos1) + temp2.cross(rel_pos2))); + btScalar normal_impulse = contactConstraint.m_appliedVelocityImpulse * combinedFriction; + + GEN_set_min(friction_impulse, normal_impulse); + GEN_set_max(friction_impulse, -normal_impulse); + body1.applyImpulse(lat_vel * -friction_impulse, rel_pos1); + body2.applyImpulse(lat_vel * friction_impulse, rel_pos2); + } + } + + return normalImpulse; +} + +#endif //NO_FRICTION_TANGENTIALS + + + + + +void btSequentialImpulseConstraintSolver::addFrictionConstraint(const btVector3& normalAxis,int solverBodyIdA,int solverBodyIdB,int frictionIndex,btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,btRigidBody* rb0,btRigidBody* rb1, btScalar relaxation) +{ + + btSolverConstraint& solverConstraint = m_tmpSolverFrictionConstraintPool.expand(); + solverConstraint.m_contactNormal = normalAxis; + + solverConstraint.m_solverBodyIdA = solverBodyIdA; + solverConstraint.m_solverBodyIdB = solverBodyIdB; + solverConstraint.m_constraintType = btSolverConstraint::BT_SOLVER_FRICTION_1D; + solverConstraint.m_frictionIndex = frictionIndex; + + solverConstraint.m_friction = cp.m_combinedFriction; + + solverConstraint.m_appliedImpulse = btScalar(0.); + solverConstraint.m_appliedVelocityImpulse = 0.f; + solverConstraint.m_penetration = 0.f; + { + btVector3 ftorqueAxis1 = rel_pos1.cross(solverConstraint.m_contactNormal); + solverConstraint.m_relpos1CrossNormal = ftorqueAxis1; + solverConstraint.m_angularComponentA = rb0->getInvInertiaTensorWorld()*ftorqueAxis1; + } + { + btVector3 ftorqueAxis1 = rel_pos2.cross(solverConstraint.m_contactNormal); + solverConstraint.m_relpos2CrossNormal = ftorqueAxis1; + solverConstraint.m_angularComponentB = rb1->getInvInertiaTensorWorld()*ftorqueAxis1; + } + +#ifdef COMPUTE_IMPULSE_DENOM + btScalar denom0 = rb0->computeImpulseDenominator(pos1,solverConstraint.m_contactNormal); + btScalar denom1 = rb1->computeImpulseDenominator(pos2,solverConstraint.m_contactNormal); +#else + btVector3 vec; + vec = ( solverConstraint.m_angularComponentA).cross(rel_pos1); + btScalar denom0 = rb0->getInvMass() + normalAxis.dot(vec); + vec = ( solverConstraint.m_angularComponentB).cross(rel_pos2); + btScalar denom1 = rb1->getInvMass() + normalAxis.dot(vec); + + +#endif //COMPUTE_IMPULSE_DENOM + btScalar denom = relaxation/(denom0+denom1); + solverConstraint.m_jacDiagABInv = denom; + +} + + +btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc) +{ + (void)stackAlloc; + (void)debugDrawer; + + if (!(numConstraints + numManifolds)) + { +// printf("empty\n"); + return 0.f; + } + btPersistentManifold* manifold = 0; + btRigidBody* rb0=0,*rb1=0; + +#ifdef FORCE_REFESH_CONTACT_MANIFOLDS + + BEGIN_PROFILE("refreshManifolds"); + + int i; + + + + for (i=0;igetBody1(); + rb0 = (btRigidBody*)manifold->getBody0(); + + manifold->refreshContactPoints(rb0->getCenterOfMassTransform(),rb1->getCenterOfMassTransform()); + + } + + END_PROFILE("refreshManifolds"); +#endif //FORCE_REFESH_CONTACT_MANIFOLDS + + btVector3 color(0,1,0); + + + BEGIN_PROFILE("gatherSolverData"); + + //int sizeofSB = sizeof(btSolverBody); + //int sizeofSC = sizeof(btSolverConstraint); + + + //if (1) + { + //if m_stackAlloc, try to pack bodies/constraints to speed up solving +// btBlock* sablock; +// sablock = stackAlloc->beginBlock(); + + // int memsize = 16; +// unsigned char* stackMemory = stackAlloc->allocate(memsize); + + + //todo: use stack allocator for this temp memory + int minReservation = numManifolds*2; + + //m_tmpSolverBodyPool.reserve(minReservation); + + //don't convert all bodies, only the one we need so solver the constraints +/* + { + for (int i=0;igetIslandTag() >= 0)) + { + btAssert(rb->getCompanionId() < 0); + int solverBodyId = m_tmpSolverBodyPool.size(); + btSolverBody& solverBody = m_tmpSolverBodyPool.expand(); + initSolverBody(&solverBody,rb); + rb->setCompanionId(solverBodyId); + } + } + } +*/ + + //m_tmpSolverConstraintPool.reserve(minReservation); + //m_tmpSolverFrictionConstraintPool.reserve(minReservation); + + { + int i; + + for (i=0;igetBody1(); + + rb0 = (btRigidBody*)manifold->getBody0(); + + + int solverBodyIdA=-1; + int solverBodyIdB=-1; + + if (manifold->getNumContacts()) + { + + + + if (rb0->getIslandTag() >= 0) + { + if (rb0->getCompanionId() >= 0) + { + //body has already been converted + solverBodyIdA = rb0->getCompanionId(); + } else + { + solverBodyIdA = m_tmpSolverBodyPool.size(); + btSolverBody& solverBody = m_tmpSolverBodyPool.expand(); + initSolverBody(&solverBody,rb0); + rb0->setCompanionId(solverBodyIdA); + } + } else + { + //create a static body + solverBodyIdA = m_tmpSolverBodyPool.size(); + btSolverBody& solverBody = m_tmpSolverBodyPool.expand(); + initSolverBody(&solverBody,rb0); + } + + if (rb1->getIslandTag() >= 0) + { + if (rb1->getCompanionId() >= 0) + { + solverBodyIdB = rb1->getCompanionId(); + } else + { + solverBodyIdB = m_tmpSolverBodyPool.size(); + btSolverBody& solverBody = m_tmpSolverBodyPool.expand(); + initSolverBody(&solverBody,rb1); + rb1->setCompanionId(solverBodyIdB); + } + } else + { + //create a static body + solverBodyIdB = m_tmpSolverBodyPool.size(); + btSolverBody& solverBody = m_tmpSolverBodyPool.expand(); + initSolverBody(&solverBody,rb1); + } + } + + btVector3 rel_pos1; + btVector3 rel_pos2; + btScalar relaxation; + + for (int j=0;jgetNumContacts();j++) + { + + btManifoldPoint& cp = manifold->getContactPoint(j); + + if (debugDrawer) + debugDrawer->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color); + + + if (cp.getDistance() <= btScalar(0.)) + { + + const btVector3& pos1 = cp.getPositionWorldOnA(); + const btVector3& pos2 = cp.getPositionWorldOnB(); + + rel_pos1 = pos1 - rb0->getCenterOfMassPosition(); + rel_pos2 = pos2 - rb1->getCenterOfMassPosition(); + + + relaxation = 1.f; + btScalar rel_vel; + btVector3 vel; + + int frictionIndex = m_tmpSolverConstraintPool.size(); + + { + btSolverConstraint& solverConstraint = m_tmpSolverConstraintPool.expand(); + + solverConstraint.m_solverBodyIdA = solverBodyIdA; + solverConstraint.m_solverBodyIdB = solverBodyIdB; + solverConstraint.m_constraintType = btSolverConstraint::BT_SOLVER_CONTACT_1D; + + btVector3 torqueAxis0 = rel_pos1.cross(cp.m_normalWorldOnB); + solverConstraint.m_angularComponentA = rb0->getInvInertiaTensorWorld()*torqueAxis0; + btVector3 torqueAxis1 = rel_pos2.cross(cp.m_normalWorldOnB); + solverConstraint.m_angularComponentB = rb1->getInvInertiaTensorWorld()*torqueAxis1; + { +#ifdef COMPUTE_IMPULSE_DENOM + btScalar denom0 = rb0->computeImpulseDenominator(pos1,cp.m_normalWorldOnB); + btScalar denom1 = rb1->computeImpulseDenominator(pos2,cp.m_normalWorldOnB); +#else + btVector3 vec; + vec = ( solverConstraint.m_angularComponentA).cross(rel_pos1); + btScalar denom0 = rb0->getInvMass() + cp.m_normalWorldOnB.dot(vec); + vec = ( solverConstraint.m_angularComponentB).cross(rel_pos2); + btScalar denom1 = rb1->getInvMass() + cp.m_normalWorldOnB.dot(vec); +#endif //COMPUTE_IMPULSE_DENOM + + btScalar denom = relaxation/(denom0+denom1); + solverConstraint.m_jacDiagABInv = denom; + } + + solverConstraint.m_contactNormal = cp.m_normalWorldOnB; + solverConstraint.m_relpos1CrossNormal = rel_pos1.cross(cp.m_normalWorldOnB); + solverConstraint.m_relpos2CrossNormal = rel_pos2.cross(cp.m_normalWorldOnB); + + + btVector3 vel1 = rb0->getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = rb1->getVelocityInLocalPoint(rel_pos2); + + vel = vel1 - vel2; + + rel_vel = cp.m_normalWorldOnB.dot(vel); + + + solverConstraint.m_penetration = cp.getDistance();///btScalar(infoGlobal.m_numIterations); + solverConstraint.m_friction = cp.m_combinedFriction; + solverConstraint.m_restitution = restitutionCurve(rel_vel, cp.m_combinedRestitution); + if (solverConstraint.m_restitution <= btScalar(0.)) + { + solverConstraint.m_restitution = 0.f; + }; + + btScalar penVel = -solverConstraint.m_penetration/infoGlobal.m_timeStep; + solverConstraint.m_penetration *= -(infoGlobal.m_erp/infoGlobal.m_timeStep); + + if (solverConstraint.m_restitution > penVel) + { + solverConstraint.m_penetration = btScalar(0.); + } + + + + solverConstraint.m_appliedImpulse = 0.f; + solverConstraint.m_appliedVelocityImpulse = 0.f; + + + + } + + + { + btVector3 frictionDir1 = vel - cp.m_normalWorldOnB * rel_vel; + btScalar lat_rel_vel = frictionDir1.length2(); + if (lat_rel_vel > SIMD_EPSILON)//0.0f) + { + frictionDir1 /= btSqrt(lat_rel_vel); + addFrictionConstraint(frictionDir1,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,rb0,rb1, relaxation); + btVector3 frictionDir2 = frictionDir1.cross(cp.m_normalWorldOnB); + frictionDir2.normalize();//?? + addFrictionConstraint(frictionDir2,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,rb0,rb1, relaxation); + } else + { + //re-calculate friction direction every frame, todo: check if this is really needed + btVector3 frictionDir1,frictionDir2; + btPlaneSpace1(cp.m_normalWorldOnB,frictionDir1,frictionDir2); + addFrictionConstraint(frictionDir1,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,rb0,rb1, relaxation); + addFrictionConstraint(frictionDir2,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,rb0,rb1, relaxation); + } + + } + } + } + } + } + } + END_PROFILE("gatherSolverData"); + + BEGIN_PROFILE("prepareConstraints"); + + btContactSolverInfo info = infoGlobal; + + { + int j; + for (j=0;jbuildJacobian(); + } + } + + + + int numConstraintPool = m_tmpSolverConstraintPool.size(); + int numFrictionPool = m_tmpSolverFrictionConstraintPool.size(); + + ///todo: use stack allocator for such temporarily memory, same for solver bodies/constraints + m_orderTmpConstraintPool.resize(numConstraintPool); + m_orderFrictionConstraintPool.resize(numFrictionPool); + { + int i; + for (i=0;igetRigidBodyA().getIslandTag() >= 0) && (constraint->getRigidBodyA().getCompanionId() >= 0)) + { + m_tmpSolverBodyPool[constraint->getRigidBodyA().getCompanionId()].writebackVelocity(); + } + if ((constraint->getRigidBodyB().getIslandTag() >= 0) && (constraint->getRigidBodyB().getCompanionId() >= 0)) + { + m_tmpSolverBodyPool[constraint->getRigidBodyB().getCompanionId()].writebackVelocity(); + } + + constraint->solveConstraint(infoGlobal.m_timeStep); + + if ((constraint->getRigidBodyA().getIslandTag() >= 0) && (constraint->getRigidBodyA().getCompanionId() >= 0)) + { + m_tmpSolverBodyPool[constraint->getRigidBodyA().getCompanionId()].readVelocity(); + } + if ((constraint->getRigidBodyB().getIslandTag() >= 0) && (constraint->getRigidBodyB().getCompanionId() >= 0)) + { + m_tmpSolverBodyPool[constraint->getRigidBodyB().getCompanionId()].readVelocity(); + } + + } + + { + int numPoolConstraints = m_tmpSolverConstraintPool.size(); + for (j=0;jgetNumContacts();p++) + { + gOrder[totalPoints].m_manifoldIndex = j; + gOrder[totalPoints].m_pointIndex = p; + totalPoints++; + } + } + } + + { + int j; + for (j=0;jbuildJacobian(); + } + } + + END_PROFILE("prepareConstraints"); + + + BEGIN_PROFILE("solveConstraints"); + + //should traverse the contacts random order... + int iteration; + + { + for ( iteration = 0;iterationsolveConstraint(info.m_timeStep); + } + + for (j=0;jgetBody0(), + (btRigidBody*)manifold->getBody1() + ,manifold->getContactPoint(gOrder[j].m_pointIndex),info,iteration,debugDrawer); + } + + for (j=0;jgetBody0(), + (btRigidBody*)manifold->getBody1(),manifold->getContactPoint(gOrder[j].m_pointIndex),info,iteration,debugDrawer); + } + + } + } + + END_PROFILE("solveConstraints"); + + +#ifdef USE_PROFILE + btProfiler::endBlock("solve"); +#endif //USE_PROFILE + + + + + return btScalar(0.); +} + + + + + + + +void btSequentialImpulseConstraintSolver::prepareConstraints(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,btIDebugDraw* debugDrawer) +{ + + (void)debugDrawer; + + btRigidBody* body0 = (btRigidBody*)manifoldPtr->getBody0(); + btRigidBody* body1 = (btRigidBody*)manifoldPtr->getBody1(); + + + //only necessary to refresh the manifold once (first iteration). The integration is done outside the loop + { +#ifdef FORCE_REFESH_CONTACT_MANIFOLDS + manifoldPtr->refreshContactPoints(body0->getCenterOfMassTransform(),body1->getCenterOfMassTransform()); +#endif //FORCE_REFESH_CONTACT_MANIFOLDS + int numpoints = manifoldPtr->getNumContacts(); + + gTotalContactPoints += numpoints; + + btVector3 color(0,1,0); + for (int i=0;igetContactPoint(i); + if (cp.getDistance() <= btScalar(0.)) + { + const btVector3& pos1 = cp.getPositionWorldOnA(); + const btVector3& pos2 = cp.getPositionWorldOnB(); + + btVector3 rel_pos1 = pos1 - body0->getCenterOfMassPosition(); + btVector3 rel_pos2 = pos2 - body1->getCenterOfMassPosition(); + + + //this jacobian entry is re-used for all iterations + btJacobianEntry jac(body0->getCenterOfMassTransform().getBasis().transpose(), + body1->getCenterOfMassTransform().getBasis().transpose(), + rel_pos1,rel_pos2,cp.m_normalWorldOnB,body0->getInvInertiaDiagLocal(),body0->getInvMass(), + body1->getInvInertiaDiagLocal(),body1->getInvMass()); + + + btScalar jacDiagAB = jac.getDiagonal(); + + btConstraintPersistentData* cpd = (btConstraintPersistentData*) cp.m_userPersistentData; + if (cpd) + { + //might be invalid + cpd->m_persistentLifeTime++; + if (cpd->m_persistentLifeTime != cp.getLifeTime()) + { + //printf("Invalid: cpd->m_persistentLifeTime = %i cp.getLifeTime() = %i\n",cpd->m_persistentLifeTime,cp.getLifeTime()); + new (cpd) btConstraintPersistentData; + cpd->m_persistentLifeTime = cp.getLifeTime(); + + } else + { + //printf("Persistent: cpd->m_persistentLifeTime = %i cp.getLifeTime() = %i\n",cpd->m_persistentLifeTime,cp.getLifeTime()); + + } + } else + { + + //todo: should this be in a pool? + void* mem = btAlignedAlloc(sizeof(btConstraintPersistentData),16); + cpd = new (mem)btConstraintPersistentData; + assert(cpd); + + totalCpd ++; + //printf("totalCpd = %i Created Ptr %x\n",totalCpd,cpd); + cp.m_userPersistentData = cpd; + cpd->m_persistentLifeTime = cp.getLifeTime(); + //printf("CREATED: %x . cpd->m_persistentLifeTime = %i cp.getLifeTime() = %i\n",cpd,cpd->m_persistentLifeTime,cp.getLifeTime()); + + } + assert(cpd); + + cpd->m_jacDiagABInv = btScalar(1.) / jacDiagAB; + + //Dependent on Rigidbody A and B types, fetch the contact/friction response func + //perhaps do a similar thing for friction/restutution combiner funcs... + + cpd->m_frictionSolverFunc = m_frictionDispatch[body0->m_frictionSolverType][body1->m_frictionSolverType]; + cpd->m_contactSolverFunc = m_contactDispatch[body0->m_contactSolverType][body1->m_contactSolverType]; + + btVector3 vel1 = body0->getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = body1->getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + btScalar rel_vel; + rel_vel = cp.m_normalWorldOnB.dot(vel); + + btScalar combinedRestitution = cp.m_combinedRestitution; + + cpd->m_penetration = cp.getDistance();///btScalar(info.m_numIterations); + cpd->m_friction = cp.m_combinedFriction; + cpd->m_restitution = restitutionCurve(rel_vel, combinedRestitution); + if (cpd->m_restitution <= btScalar(0.)) + { + cpd->m_restitution = btScalar(0.0); + + }; + + //restitution and penetration work in same direction so + //rel_vel + + btScalar penVel = -cpd->m_penetration/info.m_timeStep; + + if (cpd->m_restitution > penVel) + { + cpd->m_penetration = btScalar(0.); + } + + + btScalar relaxation = info.m_damping; + if (m_solverMode & SOLVER_USE_WARMSTARTING) + { + cpd->m_appliedImpulse *= relaxation; + } else + { + cpd->m_appliedImpulse =btScalar(0.); + } + + //for friction + cpd->m_prevAppliedImpulse = cpd->m_appliedImpulse; + + //re-calculate friction direction every frame, todo: check if this is really needed + btPlaneSpace1(cp.m_normalWorldOnB,cpd->m_frictionWorldTangential0,cpd->m_frictionWorldTangential1); + + +#define NO_FRICTION_WARMSTART 1 + + #ifdef NO_FRICTION_WARMSTART + cpd->m_accumulatedTangentImpulse0 = btScalar(0.); + cpd->m_accumulatedTangentImpulse1 = btScalar(0.); + #endif //NO_FRICTION_WARMSTART + btScalar denom0 = body0->computeImpulseDenominator(pos1,cpd->m_frictionWorldTangential0); + btScalar denom1 = body1->computeImpulseDenominator(pos2,cpd->m_frictionWorldTangential0); + btScalar denom = relaxation/(denom0+denom1); + cpd->m_jacDiagABInvTangent0 = denom; + + + denom0 = body0->computeImpulseDenominator(pos1,cpd->m_frictionWorldTangential1); + denom1 = body1->computeImpulseDenominator(pos2,cpd->m_frictionWorldTangential1); + denom = relaxation/(denom0+denom1); + cpd->m_jacDiagABInvTangent1 = denom; + + btVector3 totalImpulse = + #ifndef NO_FRICTION_WARMSTART + cpd->m_frictionWorldTangential0*cpd->m_accumulatedTangentImpulse0+ + cpd->m_frictionWorldTangential1*cpd->m_accumulatedTangentImpulse1+ + #endif //NO_FRICTION_WARMSTART + cp.m_normalWorldOnB*cpd->m_appliedImpulse; + + + + /// + { + btVector3 torqueAxis0 = rel_pos1.cross(cp.m_normalWorldOnB); + cpd->m_angularComponentA = body0->getInvInertiaTensorWorld()*torqueAxis0; + btVector3 torqueAxis1 = rel_pos2.cross(cp.m_normalWorldOnB); + cpd->m_angularComponentB = body1->getInvInertiaTensorWorld()*torqueAxis1; + } + { + btVector3 ftorqueAxis0 = rel_pos1.cross(cpd->m_frictionWorldTangential0); + cpd->m_frictionAngularComponent0A = body0->getInvInertiaTensorWorld()*ftorqueAxis0; + } + { + btVector3 ftorqueAxis1 = rel_pos1.cross(cpd->m_frictionWorldTangential1); + cpd->m_frictionAngularComponent1A = body0->getInvInertiaTensorWorld()*ftorqueAxis1; + } + { + btVector3 ftorqueAxis0 = rel_pos2.cross(cpd->m_frictionWorldTangential0); + cpd->m_frictionAngularComponent0B = body1->getInvInertiaTensorWorld()*ftorqueAxis0; + } + { + btVector3 ftorqueAxis1 = rel_pos2.cross(cpd->m_frictionWorldTangential1); + cpd->m_frictionAngularComponent1B = body1->getInvInertiaTensorWorld()*ftorqueAxis1; + } + + /// + + + + //apply previous frames impulse on both bodies + body0->applyImpulse(totalImpulse, rel_pos1); + body1->applyImpulse(-totalImpulse, rel_pos2); + } + + } + } +} + + +btScalar btSequentialImpulseConstraintSolver::solveCombinedContactFriction(btRigidBody* body0,btRigidBody* body1, btManifoldPoint& cp, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer) +{ + btScalar maxImpulse = btScalar(0.); + + { + + btVector3 color(0,1,0); + { + if (cp.getDistance() <= btScalar(0.)) + { + + if (iter == 0) + { + if (debugDrawer) + debugDrawer->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color); + } + + { + + //btConstraintPersistentData* cpd = (btConstraintPersistentData*) cp.m_userPersistentData; + btScalar impulse = resolveSingleCollisionCombined( + *body0,*body1, + cp, + info); + + if (maxImpulse < impulse) + maxImpulse = impulse; + + } + } + } + } + return maxImpulse; +} + + + +btScalar btSequentialImpulseConstraintSolver::solve(btRigidBody* body0,btRigidBody* body1, btManifoldPoint& cp, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer) +{ + + btScalar maxImpulse = btScalar(0.); + + { + + btVector3 color(0,1,0); + { + if (cp.getDistance() <= btScalar(0.)) + { + + if (iter == 0) + { + if (debugDrawer) + debugDrawer->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color); + } + + { + + btConstraintPersistentData* cpd = (btConstraintPersistentData*) cp.m_userPersistentData; + btScalar impulse = cpd->m_contactSolverFunc( + *body0,*body1, + cp, + info); + + if (maxImpulse < impulse) + maxImpulse = impulse; + + } + } + } + } + return maxImpulse; +} + +btScalar btSequentialImpulseConstraintSolver::solveFriction(btRigidBody* body0,btRigidBody* body1, btManifoldPoint& cp, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer) +{ + + (void)debugDrawer; + (void)iter; + + + { + + btVector3 color(0,1,0); + { + + if (cp.getDistance() <= btScalar(0.)) + { + + btConstraintPersistentData* cpd = (btConstraintPersistentData*) cp.m_userPersistentData; + cpd->m_frictionSolverFunc( + *body0,*body1, + cp, + info); + + + } + } + + + } + return btScalar(0.); +} + + +void btSequentialImpulseConstraintSolver::reset() +{ + m_btSeed2 = 0; +} + diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h new file mode 100644 index 000000000..83a96d4dc --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h @@ -0,0 +1,126 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H +#define SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H + +#include "btConstraintSolver.h" +class btIDebugDraw; +#include "btContactConstraint.h" +#include "btSolverBody.h" +#include "btSolverConstraint.h" + + +/// btSequentialImpulseConstraintSolver uses a Propagation Method and Sequentially applies impulses +/// The approach is the 3D version of Erin Catto's GDC 2006 tutorial. See http://www.gphysics.com +/// Although Sequential Impulse is more intuitive, it is mathematically equivalent to Projected Successive Overrelaxation (iterative LCP) +/// Applies impulses for combined restitution and penetration recovery and to simulate friction +class btSequentialImpulseConstraintSolver : public btConstraintSolver +{ + + btAlignedObjectArray m_tmpSolverBodyPool; + btAlignedObjectArray m_tmpSolverConstraintPool; + btAlignedObjectArray m_tmpSolverFrictionConstraintPool; + btAlignedObjectArray m_orderTmpConstraintPool; + btAlignedObjectArray m_orderFrictionConstraintPool; + + +protected: + btScalar solve(btRigidBody* body0,btRigidBody* body1, btManifoldPoint& cp, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer); + btScalar solveFriction(btRigidBody* body0,btRigidBody* body1, btManifoldPoint& cp, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer); + void prepareConstraints(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,btIDebugDraw* debugDrawer); + void addFrictionConstraint(const btVector3& normalAxis,int solverBodyIdA,int solverBodyIdB,int frictionIndex,btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,btRigidBody* rb0,btRigidBody* rb1, btScalar relaxation); + + ContactSolverFunc m_contactDispatch[MAX_CONTACT_SOLVER_TYPES][MAX_CONTACT_SOLVER_TYPES]; + ContactSolverFunc m_frictionDispatch[MAX_CONTACT_SOLVER_TYPES][MAX_CONTACT_SOLVER_TYPES]; + + //choose between several modes, different friction model etc. + int m_solverMode; + ///m_btSeed2 is used for re-arranging the constraint rows. improves convergence/quality of friction + unsigned long m_btSeed2; + +public: + + enum eSolverMode + { + SOLVER_RANDMIZE_ORDER = 1, + SOLVER_FRICTION_SEPARATE = 2, + SOLVER_USE_WARMSTARTING = 4, + SOLVER_CACHE_FRIENDLY = 8 + }; + + btSequentialImpulseConstraintSolver(); + + ///Advanced: Override the default contact solving function for contacts, for certain types of rigidbody + ///See btRigidBody::m_contactSolverType and btRigidBody::m_frictionSolverType + void setContactSolverFunc(ContactSolverFunc func,int type0,int type1) + { + m_contactDispatch[type0][type1] = func; + } + + ///Advanced: Override the default friction solving function for contacts, for certain types of rigidbody + ///See btRigidBody::m_contactSolverType and btRigidBody::m_frictionSolverType + void SetFrictionSolverFunc(ContactSolverFunc func,int type0,int type1) + { + m_frictionDispatch[type0][type1] = func; + } + + virtual ~btSequentialImpulseConstraintSolver(); + + virtual btScalar solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifold,int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& info, btIDebugDraw* debugDrawer, btStackAlloc* stackAlloc,btDispatcher* dispatcher); + + virtual btScalar solveGroupCacheFriendly(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc); + btScalar solveGroupCacheFriendlyIterations(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc); + btScalar solveGroupCacheFriendlySetup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc); + + + ///clear internal cached data and reset random seed + virtual void reset(); + + btScalar solveCombinedContactFriction(btRigidBody* body0,btRigidBody* body1, btManifoldPoint& cp, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer); + + + void setSolverMode(int mode) + { + m_solverMode = mode; + } + + int getSolverMode() const + { + return m_solverMode; + } + + unsigned long btRand2(); + + int btRandInt2 (int n); + + void setRandSeed(unsigned long seed) + { + m_btSeed2 = seed; + } + unsigned long getRandSeed() const + { + return m_btSeed2; + } + +}; + +#ifndef BT_PREFER_SIMD +typedef btSequentialImpulseConstraintSolver btSequentialImpulseConstraintSolverPrefered; +#endif + + +#endif //SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H + diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp b/src/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp new file mode 100644 index 000000000..0c7dbd668 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp @@ -0,0 +1,255 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#include "btSolve2LinearConstraint.h" + +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "LinearMath/btVector3.h" +#include "btJacobianEntry.h" + + +void btSolve2LinearConstraint::resolveUnilateralPairConstraint( + btRigidBody* body1, + btRigidBody* body2, + + const btMatrix3x3& world2A, + const btMatrix3x3& world2B, + + const btVector3& invInertiaADiag, + const btScalar invMassA, + const btVector3& linvelA,const btVector3& angvelA, + const btVector3& rel_posA1, + const btVector3& invInertiaBDiag, + const btScalar invMassB, + const btVector3& linvelB,const btVector3& angvelB, + const btVector3& rel_posA2, + + btScalar depthA, const btVector3& normalA, + const btVector3& rel_posB1,const btVector3& rel_posB2, + btScalar depthB, const btVector3& normalB, + btScalar& imp0,btScalar& imp1) +{ + (void)linvelA; + (void)linvelB; + (void)angvelB; + (void)angvelA; + + + + imp0 = btScalar(0.); + imp1 = btScalar(0.); + + btScalar len = btFabs(normalA.length()) - btScalar(1.); + if (btFabs(len) >= SIMD_EPSILON) + return; + + btAssert(len < SIMD_EPSILON); + + + //this jacobian entry could be re-used for all iterations + btJacobianEntry jacA(world2A,world2B,rel_posA1,rel_posA2,normalA,invInertiaADiag,invMassA, + invInertiaBDiag,invMassB); + btJacobianEntry jacB(world2A,world2B,rel_posB1,rel_posB2,normalB,invInertiaADiag,invMassA, + invInertiaBDiag,invMassB); + + //const btScalar vel0 = jacA.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB); + //const btScalar vel1 = jacB.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB); + + const btScalar vel0 = normalA.dot(body1->getVelocityInLocalPoint(rel_posA1)-body2->getVelocityInLocalPoint(rel_posA1)); + const btScalar vel1 = normalB.dot(body1->getVelocityInLocalPoint(rel_posB1)-body2->getVelocityInLocalPoint(rel_posB1)); + +// btScalar penetrationImpulse = (depth*contactTau*timeCorrection) * massTerm;//jacDiagABInv + btScalar massTerm = btScalar(1.) / (invMassA + invMassB); + + + // calculate rhs (or error) terms + const btScalar dv0 = depthA * m_tau * massTerm - vel0 * m_damping; + const btScalar dv1 = depthB * m_tau * massTerm - vel1 * m_damping; + + + // dC/dv * dv = -C + + // jacobian * impulse = -error + // + + //impulse = jacobianInverse * -error + + // inverting 2x2 symmetric system (offdiagonal are equal!) + // + + + btScalar nonDiag = jacA.getNonDiagonal(jacB,invMassA,invMassB); + btScalar invDet = btScalar(1.0) / (jacA.getDiagonal() * jacB.getDiagonal() - nonDiag * nonDiag ); + + //imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet; + //imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet; + + imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet; + imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet; + + //[a b] [d -c] + //[c d] inverse = (1 / determinant) * [-b a] where determinant is (ad - bc) + + //[jA nD] * [imp0] = [dv0] + //[nD jB] [imp1] [dv1] + +} + + + +void btSolve2LinearConstraint::resolveBilateralPairConstraint( + btRigidBody* body1, + btRigidBody* body2, + const btMatrix3x3& world2A, + const btMatrix3x3& world2B, + + const btVector3& invInertiaADiag, + const btScalar invMassA, + const btVector3& linvelA,const btVector3& angvelA, + const btVector3& rel_posA1, + const btVector3& invInertiaBDiag, + const btScalar invMassB, + const btVector3& linvelB,const btVector3& angvelB, + const btVector3& rel_posA2, + + btScalar depthA, const btVector3& normalA, + const btVector3& rel_posB1,const btVector3& rel_posB2, + btScalar depthB, const btVector3& normalB, + btScalar& imp0,btScalar& imp1) +{ + + (void)linvelA; + (void)linvelB; + (void)angvelA; + (void)angvelB; + + + + imp0 = btScalar(0.); + imp1 = btScalar(0.); + + btScalar len = btFabs(normalA.length()) - btScalar(1.); + if (btFabs(len) >= SIMD_EPSILON) + return; + + btAssert(len < SIMD_EPSILON); + + + //this jacobian entry could be re-used for all iterations + btJacobianEntry jacA(world2A,world2B,rel_posA1,rel_posA2,normalA,invInertiaADiag,invMassA, + invInertiaBDiag,invMassB); + btJacobianEntry jacB(world2A,world2B,rel_posB1,rel_posB2,normalB,invInertiaADiag,invMassA, + invInertiaBDiag,invMassB); + + //const btScalar vel0 = jacA.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB); + //const btScalar vel1 = jacB.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB); + + const btScalar vel0 = normalA.dot(body1->getVelocityInLocalPoint(rel_posA1)-body2->getVelocityInLocalPoint(rel_posA1)); + const btScalar vel1 = normalB.dot(body1->getVelocityInLocalPoint(rel_posB1)-body2->getVelocityInLocalPoint(rel_posB1)); + + // calculate rhs (or error) terms + const btScalar dv0 = depthA * m_tau - vel0 * m_damping; + const btScalar dv1 = depthB * m_tau - vel1 * m_damping; + + // dC/dv * dv = -C + + // jacobian * impulse = -error + // + + //impulse = jacobianInverse * -error + + // inverting 2x2 symmetric system (offdiagonal are equal!) + // + + + btScalar nonDiag = jacA.getNonDiagonal(jacB,invMassA,invMassB); + btScalar invDet = btScalar(1.0) / (jacA.getDiagonal() * jacB.getDiagonal() - nonDiag * nonDiag ); + + //imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet; + //imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet; + + imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet; + imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet; + + //[a b] [d -c] + //[c d] inverse = (1 / determinant) * [-b a] where determinant is (ad - bc) + + //[jA nD] * [imp0] = [dv0] + //[nD jB] [imp1] [dv1] + + if ( imp0 > btScalar(0.0)) + { + if ( imp1 > btScalar(0.0) ) + { + //both positive + } + else + { + imp1 = btScalar(0.); + + // now imp0>0 imp1<0 + imp0 = dv0 / jacA.getDiagonal(); + if ( imp0 > btScalar(0.0) ) + { + } else + { + imp0 = btScalar(0.); + } + } + } + else + { + imp0 = btScalar(0.); + + imp1 = dv1 / jacB.getDiagonal(); + if ( imp1 <= btScalar(0.0) ) + { + imp1 = btScalar(0.); + // now imp0>0 imp1<0 + imp0 = dv0 / jacA.getDiagonal(); + if ( imp0 > btScalar(0.0) ) + { + } else + { + imp0 = btScalar(0.); + } + } else + { + } + } +} + + +/* +void btSolve2LinearConstraint::resolveAngularConstraint( const btMatrix3x3& invInertiaAWS, + const btScalar invMassA, + const btVector3& linvelA,const btVector3& angvelA, + const btVector3& rel_posA1, + const btMatrix3x3& invInertiaBWS, + const btScalar invMassB, + const btVector3& linvelB,const btVector3& angvelB, + const btVector3& rel_posA2, + + btScalar depthA, const btVector3& normalA, + const btVector3& rel_posB1,const btVector3& rel_posB2, + btScalar depthB, const btVector3& normalB, + btScalar& imp0,btScalar& imp1) +{ + +} +*/ + diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h new file mode 100644 index 000000000..057d3fac8 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h @@ -0,0 +1,107 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SOLVE_2LINEAR_CONSTRAINT_H +#define SOLVE_2LINEAR_CONSTRAINT_H + +#include "LinearMath/btMatrix3x3.h" +#include "LinearMath/btVector3.h" + + +class btRigidBody; + + + +/// constraint class used for lateral tyre friction. +class btSolve2LinearConstraint +{ + btScalar m_tau; + btScalar m_damping; + +public: + + btSolve2LinearConstraint(btScalar tau,btScalar damping) + { + m_tau = tau; + m_damping = damping; + } + // + // solve unilateral constraint (equality, direct method) + // + void resolveUnilateralPairConstraint( + btRigidBody* body0, + btRigidBody* body1, + + const btMatrix3x3& world2A, + const btMatrix3x3& world2B, + + const btVector3& invInertiaADiag, + const btScalar invMassA, + const btVector3& linvelA,const btVector3& angvelA, + const btVector3& rel_posA1, + const btVector3& invInertiaBDiag, + const btScalar invMassB, + const btVector3& linvelB,const btVector3& angvelB, + const btVector3& rel_posA2, + + btScalar depthA, const btVector3& normalA, + const btVector3& rel_posB1,const btVector3& rel_posB2, + btScalar depthB, const btVector3& normalB, + btScalar& imp0,btScalar& imp1); + + + // + // solving 2x2 lcp problem (inequality, direct solution ) + // + void resolveBilateralPairConstraint( + btRigidBody* body0, + btRigidBody* body1, + const btMatrix3x3& world2A, + const btMatrix3x3& world2B, + + const btVector3& invInertiaADiag, + const btScalar invMassA, + const btVector3& linvelA,const btVector3& angvelA, + const btVector3& rel_posA1, + const btVector3& invInertiaBDiag, + const btScalar invMassB, + const btVector3& linvelB,const btVector3& angvelB, + const btVector3& rel_posA2, + + btScalar depthA, const btVector3& normalA, + const btVector3& rel_posB1,const btVector3& rel_posB2, + btScalar depthB, const btVector3& normalB, + btScalar& imp0,btScalar& imp1); + +/* + void resolveAngularConstraint( const btMatrix3x3& invInertiaAWS, + const btScalar invMassA, + const btVector3& linvelA,const btVector3& angvelA, + const btVector3& rel_posA1, + const btMatrix3x3& invInertiaBWS, + const btScalar invMassB, + const btVector3& linvelB,const btVector3& angvelB, + const btVector3& rel_posA2, + + btScalar depthA, const btVector3& normalA, + const btVector3& rel_posB1,const btVector3& rel_posB2, + btScalar depthB, const btVector3& normalB, + btScalar& imp0,btScalar& imp1); + +*/ + +}; + +#endif //SOLVE_2LINEAR_CONSTRAINT_H diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h new file mode 100644 index 000000000..051960933 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h @@ -0,0 +1,76 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_SOLVER_BODY_H +#define BT_SOLVER_BODY_H + +class btRigidBody; +#include "LinearMath/btVector3.h" +#include "LinearMath/btMatrix3x3.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "LinearMath/btAlignedAllocator.h" + + +///btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packed to increase cache coherence/performance. +ATTRIBUTE_ALIGNED16 (struct) btSolverBody +{ + BT_DECLARE_ALIGNED_ALLOCATOR(); + + btVector3 m_angularVelocity; + float m_angularFactor; + float m_invMass; + float m_friction; + btRigidBody* m_originalBody; + btVector3 m_linearVelocity; + btVector3 m_centerOfMassPosition; + + SIMD_FORCE_INLINE void getVelocityInLocalPoint(const btVector3& rel_pos, btVector3& velocity ) const + { + velocity = m_linearVelocity + m_angularVelocity.cross(rel_pos); + } + + //Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position + SIMD_FORCE_INLINE void internalApplyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude) + { + m_linearVelocity += linearComponent*impulseMagnitude; + m_angularVelocity += angularComponent*(impulseMagnitude*m_angularFactor); + } + + void writebackVelocity() + { + if (m_invMass) + { + m_originalBody->setLinearVelocity(m_linearVelocity); + m_originalBody->setAngularVelocity(m_angularVelocity); + //m_originalBody->setCompanionId(-1); + } + } + + void readVelocity() + { + if (m_invMass) + { + m_linearVelocity = m_originalBody->getLinearVelocity(); + m_angularVelocity = m_originalBody->getAngularVelocity(); + } + } + + + + +}; + +#endif //BT_SOLVER_BODY_H + diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h new file mode 100644 index 000000000..a750560d3 --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h @@ -0,0 +1,69 @@ + + +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_SOLVER_CONSTRAINT_H +#define BT_SOLVER_CONSTRAINT_H + +class btRigidBody; +#include "LinearMath/btVector3.h" +#include "LinearMath/btMatrix3x3.h" + +//#define NO_FRICTION_TANGENTIALS 1 + +///1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and friction constraints. +ATTRIBUTE_ALIGNED16 (struct) btSolverConstraint +{ + BT_DECLARE_ALIGNED_ALLOCATOR(); + + btVector3 m_relpos1CrossNormal; + btVector3 m_contactNormal; + + btVector3 m_relpos2CrossNormal; + btVector3 m_angularComponentA; + + btVector3 m_angularComponentB; + mutable btScalar m_appliedVelocityImpulse; + mutable btScalar m_appliedImpulse; + int m_solverBodyIdA; + int m_solverBodyIdB; + + btScalar m_friction; + btScalar m_restitution; + btScalar m_jacDiagABInv; + btScalar m_penetration; + + + + int m_constraintType; + int m_frictionIndex; + int m_unusedPadding[2]; + + enum btSolverConstraintType + { + BT_SOLVER_CONTACT_1D = 0, + BT_SOLVER_FRICTION_1D + }; +}; + + + + + + +#endif //BT_SOLVER_CONSTRAINT_H + + diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp b/src/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp new file mode 100644 index 000000000..6e8b552db --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp @@ -0,0 +1,56 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btTypedConstraint.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" + +static btRigidBody s_fixed(0, 0,0); + +btTypedConstraint::btTypedConstraint(btTypedConstraintType type) +:m_userConstraintType(-1), +m_userConstraintId(-1), +m_constraintType (type), +m_rbA(s_fixed), +m_rbB(s_fixed), +m_appliedImpulse(btScalar(0.)) +{ + s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.))); +} +btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA) +:m_userConstraintType(-1), +m_userConstraintId(-1), +m_constraintType (type), +m_rbA(rbA), +m_rbB(s_fixed), +m_appliedImpulse(btScalar(0.)) +{ + s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.))); + +} + + +btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB) +:m_userConstraintType(-1), +m_userConstraintId(-1), +m_constraintType (type), +m_rbA(rbA), +m_rbB(rbB), +m_appliedImpulse(btScalar(0.)) +{ + s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.))); + +} + diff --git a/src/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h b/src/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h new file mode 100644 index 000000000..745d0afde --- /dev/null +++ b/src/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h @@ -0,0 +1,112 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef TYPED_CONSTRAINT_H +#define TYPED_CONSTRAINT_H + +class btRigidBody; +#include "LinearMath/btScalar.h" + +enum btTypedConstraintType +{ + POINT2POINT_CONSTRAINT_TYPE, + HINGE_CONSTRAINT_TYPE, + CONETWIST_CONSTRAINT_TYPE, + D6_CONSTRAINT_TYPE, + VEHICLE_CONSTRAINT_TYPE +}; + +///TypedConstraint is the baseclass for Bullet constraints and vehicles +class btTypedConstraint +{ + int m_userConstraintType; + int m_userConstraintId; + + btTypedConstraintType m_constraintType; + + btTypedConstraint& operator=(btTypedConstraint& other) + { + btAssert(0); + (void) other; + return *this; + } + +protected: + btRigidBody& m_rbA; + btRigidBody& m_rbB; + btScalar m_appliedImpulse; + + +public: + + btTypedConstraint(btTypedConstraintType type); + virtual ~btTypedConstraint() {}; + btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA); + + btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB); + + virtual void buildJacobian() = 0; + + virtual void solveConstraint(btScalar timeStep) = 0; + + const btRigidBody& getRigidBodyA() const + { + return m_rbA; + } + const btRigidBody& getRigidBodyB() const + { + return m_rbB; + } + + btRigidBody& getRigidBodyA() + { + return m_rbA; + } + btRigidBody& getRigidBodyB() + { + return m_rbB; + } + + int getUserConstraintType() const + { + return m_userConstraintType ; + } + + void setUserConstraintType(int userConstraintType) + { + m_userConstraintType = userConstraintType; + }; + + void setUserConstraintId(int uid) + { + m_userConstraintId = uid; + } + + int getUserConstraintId() const + { + return m_userConstraintId; + } + btScalar getAppliedImpulse() const + { + return m_appliedImpulse; + } + + btTypedConstraintType getConstraintType () const + { + return m_constraintType; + } +}; + +#endif //TYPED_CONSTRAINT_H diff --git a/src/bullet/src/BulletDynamics/Dynamics/Bullet-C-API.cpp b/src/bullet/src/BulletDynamics/Dynamics/Bullet-C-API.cpp new file mode 100644 index 000000000..1ef88f710 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/Bullet-C-API.cpp @@ -0,0 +1,308 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +/* + Draft high-level generic physics C-API. For low-level access, use the physics SDK native API's. + Work in progress, functionality will be added on demand. + + If possible, use the richer Bullet C++ API, by including +*/ + +#include "Bullet-C-Api.h" +#include "btBulletDynamicsCommon.h" +#include "LinearMath/btAlignedAllocator.h" + +/* + Create and Delete a Physics SDK +*/ + +struct btPhysicsSdk +{ + +// btDispatcher* m_dispatcher; +// btOverlappingPairCache* m_pairCache; +// btConstraintSolver* m_constraintSolver + + btVector3 m_worldAabbMin; + btVector3 m_worldAabbMax; + + + //todo: version, hardware/optimization settings etc? + btPhysicsSdk() + :m_worldAabbMin(-1000,-1000,-1000), + m_worldAabbMax(1000,1000,1000) + { + + } + + +}; + +plPhysicsSdkHandle plNewBulletSdk() +{ + void* mem = btAlignedAlloc(sizeof(btPhysicsSdk),16); + return (plPhysicsSdkHandle)new (mem)btPhysicsSdk; +} + +void plDeletePhysicsSdk(plPhysicsSdkHandle physicsSdk) +{ + btPhysicsSdk* phys = reinterpret_cast(physicsSdk); + btAlignedFree(phys); +} + + +/* Dynamics World */ +plDynamicsWorldHandle plCreateDynamicsWorld(plPhysicsSdkHandle physicsSdkHandle) +{ + btPhysicsSdk* physicsSdk = reinterpret_cast(physicsSdkHandle); + void* mem = btAlignedAlloc(sizeof(btDefaultCollisionConfiguration),16); + btDefaultCollisionConfiguration* collisionConfiguration = new (mem)btDefaultCollisionConfiguration(); + mem = btAlignedAlloc(sizeof(btCollisionDispatcher),16); + btDispatcher* dispatcher = new (mem)btCollisionDispatcher(collisionConfiguration); + mem = btAlignedAlloc(sizeof(btAxisSweep3),16); + btBroadphaseInterface* pairCache = new (mem)btAxisSweep3(physicsSdk->m_worldAabbMin,physicsSdk->m_worldAabbMax); + mem = btAlignedAlloc(sizeof(btSequentialImpulseConstraintSolver),16); + btConstraintSolver* constraintSolver = new(mem) btSequentialImpulseConstraintSolver(); + + mem = btAlignedAlloc(sizeof(btDiscreteDynamicsWorld),16); + return (plDynamicsWorldHandle) new (mem)btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration); +} +void plDeleteDynamicsWorld(plDynamicsWorldHandle world) +{ + //todo: also clean up the other allocations, axisSweep, pairCache,dispatcher,constraintSolver,collisionConfiguration + btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world); + btAlignedFree(dynamicsWorld); +} + +void plStepSimulation(plDynamicsWorldHandle world, plReal timeStep) +{ + btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world); + assert(dynamicsWorld); + dynamicsWorld->stepSimulation(timeStep); +} + +void plAddRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object) +{ + btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world); + assert(dynamicsWorld); + btRigidBody* body = reinterpret_cast< btRigidBody* >(object); + assert(body); + + dynamicsWorld->addRigidBody(body); +} + +void plRemoveRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object) +{ + btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world); + assert(dynamicsWorld); + btRigidBody* body = reinterpret_cast< btRigidBody* >(object); + assert(body); + + dynamicsWorld->removeRigidBody(body); +} + +/* Rigid Body */ + +plRigidBodyHandle plCreateRigidBody( void* user_data, float mass, plCollisionShapeHandle cshape ) +{ + btTransform trans; + trans.setIdentity(); + btVector3 localInertia(0,0,0); + btCollisionShape* shape = reinterpret_cast( cshape); + assert(shape); + if (mass) + { + shape->calculateLocalInertia(mass,localInertia); + } + void* mem = btAlignedAlloc(sizeof(btRigidBody),16); + btRigidBody* body = new (mem)btRigidBody(mass, 0,shape,localInertia); + body->setWorldTransform(trans); + body->setUserPointer(user_data); + return (plRigidBodyHandle) body; +} + +void plDeleteRigidBody(plRigidBodyHandle cbody) +{ + btRigidBody* body = reinterpret_cast< btRigidBody* >(cbody); + assert(body); + btAlignedFree( body); +} + + +/* Collision Shape definition */ + +plCollisionShapeHandle plNewSphereShape(plReal radius) +{ + void* mem = btAlignedAlloc(sizeof(btSphereShape),16); + return (plCollisionShapeHandle) new (mem)btSphereShape(radius); + +} + +plCollisionShapeHandle plNewBoxShape(plReal x, plReal y, plReal z) +{ + void* mem = btAlignedAlloc(sizeof(btBoxShape),16); + return (plCollisionShapeHandle) new (mem)btBoxShape(btVector3(x,y,z)); +} + +plCollisionShapeHandle plNewCapsuleShape(plReal radius, plReal height) +{ + //capsule is convex hull of 2 spheres, so use btMultiSphereShape + btVector3 inertiaHalfExtents(radius,height,radius); + const int numSpheres = 2; + btVector3 positions[numSpheres] = {btVector3(0,height,0),btVector3(0,-height,0)}; + btScalar radi[numSpheres] = {radius,radius}; + void* mem = btAlignedAlloc(sizeof(btMultiSphereShape),16); + return (plCollisionShapeHandle) new (mem)btMultiSphereShape(inertiaHalfExtents,positions,radi,numSpheres); +} +plCollisionShapeHandle plNewConeShape(plReal radius, plReal height) +{ + void* mem = btAlignedAlloc(sizeof(btConeShape),16); + return (plCollisionShapeHandle) new (mem)btConeShape(radius,height); +} + +plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height) +{ + void* mem = btAlignedAlloc(sizeof(btCylinderShape),16); + return (plCollisionShapeHandle) new (mem)btCylinderShape(btVector3(radius,height,radius)); +} + +/* Convex Meshes */ +plCollisionShapeHandle plNewConvexHullShape() +{ + void* mem = btAlignedAlloc(sizeof(btConvexHullShape),16); + return (plCollisionShapeHandle) new (mem)btConvexHullShape(); +} + + +/* Concave static triangle meshes */ +plMeshInterfaceHandle plNewMeshInterface() +{ + return 0; +} + +plCollisionShapeHandle plNewCompoundShape() +{ + void* mem = btAlignedAlloc(sizeof(btCompoundShape),16); + return (plCollisionShapeHandle) new (mem)btCompoundShape(); +} + +void plAddChildShape(plCollisionShapeHandle compoundShapeHandle,plCollisionShapeHandle childShapeHandle, plVector3 childPos,plQuaternion childOrn) +{ + btCollisionShape* colShape = reinterpret_cast(compoundShapeHandle); + btAssert(colShape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE); + btCompoundShape* compoundShape = reinterpret_cast(colShape); + btCollisionShape* childShape = reinterpret_cast(childShapeHandle); + btTransform localTrans; + localTrans.setIdentity(); + localTrans.setOrigin(btVector3(childPos[0],childPos[1],childPos[2])); + localTrans.setRotation(btQuaternion(childOrn[0],childOrn[1],childOrn[2],childOrn[3])); + compoundShape->addChildShape(localTrans,childShape); +} + +void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient) +{ + btQuaternion orn; + orn.setEuler(yaw,pitch,roll); + orient[0] = orn.getX(); + orient[1] = orn.getY(); + orient[2] = orn.getZ(); + orient[3] = orn.getW(); + +} + + +// extern void plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2); +// extern plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle); + + +void plAddVertex(plCollisionShapeHandle cshape, plReal x,plReal y,plReal z) +{ + btCollisionShape* colShape = reinterpret_cast( cshape); + btAssert(colShape->getShapeType()==CONVEX_HULL_SHAPE_PROXYTYPE); + btConvexHullShape* convexHullShape = reinterpret_cast( cshape); + convexHullShape->addPoint(btPoint3(x,y,z)); + +} + +void plDeleteShape(plCollisionShapeHandle cshape) +{ + btCollisionShape* shape = reinterpret_cast( cshape); + assert(shape); + btAlignedFree(shape); +} +void plSetScaling(plCollisionShapeHandle cshape, plVector3 cscaling) +{ + btCollisionShape* shape = reinterpret_cast( cshape); + assert(shape); + btVector3 scaling(cscaling[0],cscaling[1],cscaling[2]); + shape->setLocalScaling(scaling); +} + + + +void plSetPosition(plRigidBodyHandle object, const plVector3 position) +{ + btRigidBody* body = reinterpret_cast< btRigidBody* >(object); + btAssert(body); + btVector3 pos(position[0],position[1],position[2]); + btTransform worldTrans = body->getWorldTransform(); + worldTrans.setOrigin(pos); + body->setWorldTransform(worldTrans); +} + +void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation) +{ + btRigidBody* body = reinterpret_cast< btRigidBody* >(object); + btAssert(body); + btQuaternion orn(orientation[0],orientation[1],orientation[2],orientation[3]); + btTransform worldTrans = body->getWorldTransform(); + worldTrans.setRotation(orn); + body->setWorldTransform(worldTrans); +} + +void plGetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix) +{ + btRigidBody* body = reinterpret_cast< btRigidBody* >(object); + btAssert(body); + body->getWorldTransform().getOpenGLMatrix(matrix); + +} + +void plGetPosition(plRigidBodyHandle object,plVector3 position) +{ + btRigidBody* body = reinterpret_cast< btRigidBody* >(object); + btAssert(body); + const btVector3& pos = body->getWorldTransform().getOrigin(); + position[0] = pos.getX(); + position[1] = pos.getY(); + position[2] = pos.getZ(); +} + +void plGetOrientation(plRigidBodyHandle object,plQuaternion orientation) +{ + btRigidBody* body = reinterpret_cast< btRigidBody* >(object); + btAssert(body); + const btQuaternion& orn = body->getWorldTransform().getRotation(); + orientation[0] = orn.getX(); + orientation[1] = orn.getY(); + orientation[2] = orn.getZ(); + orientation[3] = orn.getW(); +} + + + +//plRigidBodyHandle plRayCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal); + +// extern plRigidBodyHandle plObjectCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal); diff --git a/src/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp b/src/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp new file mode 100644 index 000000000..5e330cb64 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp @@ -0,0 +1,194 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2007 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btContinuousDynamicsWorld.h" +#include "LinearMath/btQuickprof.h" + +//collision detection +#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" +#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h" +#include "BulletCollision/CollisionShapes/btCollisionShape.h" +#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h" + +//rigidbody & constraints +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h" +#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h" +#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h" + + + +#include + +btContinuousDynamicsWorld::btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration) +:btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration) +{ +} + +btContinuousDynamicsWorld::~btContinuousDynamicsWorld() +{ +} + + +void btContinuousDynamicsWorld::internalSingleStepSimulation( btScalar timeStep) +{ + + startProfiling(timeStep); + + ///update aabbs information + updateAabbs(); + //static int frame=0; +// printf("frame %d\n",frame++); + + ///apply gravity, predict motion + predictUnconstraintMotion(timeStep); + + btDispatcherInfo& dispatchInfo = getDispatchInfo(); + + dispatchInfo.m_timeStep = timeStep; + dispatchInfo.m_stepCount = 0; + dispatchInfo.m_debugDraw = getDebugDrawer(); + + ///perform collision detection + performDiscreteCollisionDetection(); + + calculateSimulationIslands(); + + + getSolverInfo().m_timeStep = timeStep; + + + + ///solve contact and other joint constraints + solveConstraints(getSolverInfo()); + + ///CallbackTriggers(); + + calculateTimeOfImpacts(timeStep); + + btScalar toi = dispatchInfo.m_timeOfImpact; +// if (toi < 1.f) +// printf("toi = %f\n",toi); + if (toi < 0.f) + printf("toi = %f\n",toi); + + + ///integrate transforms + integrateTransforms(timeStep * toi); + + ///update vehicle simulation + updateVehicles(timeStep); + + + updateActivationState( timeStep ); + +} + +void btContinuousDynamicsWorld::calculateTimeOfImpacts(btScalar timeStep) +{ + ///these should be 'temporal' aabbs! + updateTemporalAabbs(timeStep); + + ///'toi' is the global smallest time of impact. However, we just calculate the time of impact for each object individually. + ///so we handle the case moving versus static properly, and we cheat for moving versus moving + float toi = 1.f; + + + btDispatcherInfo& dispatchInfo = getDispatchInfo(); + dispatchInfo.m_timeStep = timeStep; + dispatchInfo.m_timeOfImpact = 1.f; + dispatchInfo.m_stepCount = 0; + dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_CONTINUOUS; + + ///calculate time of impact for overlapping pairs + + BEGIN_PROFILE("performContinuousCollisionDetection"); + + btDispatcher* dispatcher = getDispatcher(); + if (dispatcher) + dispatcher->dispatchAllCollisionPairs(m_broadphasePairCache->getOverlappingPairCache(),dispatchInfo,m_dispatcher1); + + END_PROFILE("performContinuousCollisionDetection"); + + toi = dispatchInfo.m_timeOfImpact; + + dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_DISCRETE; + +} + +void btContinuousDynamicsWorld::updateTemporalAabbs(btScalar timeStep) +{ + BEGIN_PROFILE("perform Temporal Broadphase Collision Detection"); + + btVector3 temporalAabbMin,temporalAabbMax; + + for ( int i=0;igetCollisionShape()->getAabb(m_collisionObjects[i]->getWorldTransform(),temporalAabbMin,temporalAabbMax); + const btVector3& linvel = body->getLinearVelocity(); + + //make the AABB temporal + float temporalAabbMaxx = temporalAabbMax.getX(); + float temporalAabbMaxy = temporalAabbMax.getY(); + float temporalAabbMaxz = temporalAabbMax.getZ(); + float temporalAabbMinx = temporalAabbMin.getX(); + float temporalAabbMiny = temporalAabbMin.getY(); + float temporalAabbMinz = temporalAabbMin.getZ(); + + // add linear motion + btVector3 linMotion = linvel*timeStep; + + if (linMotion.x() > 0.f) + temporalAabbMaxx += linMotion.x(); + else + temporalAabbMinx += linMotion.x(); + if (linMotion.y() > 0.f) + temporalAabbMaxy += linMotion.y(); + else + temporalAabbMiny += linMotion.y(); + if (linMotion.z() > 0.f) + temporalAabbMaxz += linMotion.z(); + else + temporalAabbMinz += linMotion.z(); + + //add conservative angular motion + btScalar angularMotion(0);// = angvel.length() * GetAngularMotionDisc() * timeStep; + btVector3 angularMotion3d(angularMotion,angularMotion,angularMotion); + temporalAabbMin = btVector3(temporalAabbMinx,temporalAabbMiny,temporalAabbMinz); + temporalAabbMax = btVector3(temporalAabbMaxx,temporalAabbMaxy,temporalAabbMaxz); + + temporalAabbMin -= angularMotion3d; + temporalAabbMax += angularMotion3d; + + m_broadphasePairCache->setAabb(body->getBroadphaseHandle(),temporalAabbMin,temporalAabbMax,m_dispatcher1); + } + } + + //update aabb (of all moved objects) + + m_broadphasePairCache->calculateOverlappingPairs(m_dispatcher1); + + END_PROFILE("perform Temporal Broadphase Collision Detection"); + + +} + + diff --git a/src/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h b/src/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h new file mode 100644 index 000000000..61c8dea03 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h @@ -0,0 +1,46 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2007 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_CONTINUOUS_DYNAMICS_WORLD_H +#define BT_CONTINUOUS_DYNAMICS_WORLD_H + +#include "btDiscreteDynamicsWorld.h" + +///btContinuousDynamicsWorld adds optional (per object) continuous collision detection for fast moving objects to the btDiscreteDynamicsWorld. +///This copes with fast moving objects that otherwise would tunnel/miss collisions. +///Under construction, don't use yet! Please use btDiscreteDynamicsWorld instead. +class btContinuousDynamicsWorld : public btDiscreteDynamicsWorld +{ + + void updateTemporalAabbs(btScalar timeStep); + + public: + + btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration); + virtual ~btContinuousDynamicsWorld(); + + ///time stepping with calculation of time of impact for selected fast moving objects + virtual void internalSingleStepSimulation( btScalar timeStep); + + virtual void calculateTimeOfImpacts(btScalar timeStep); + + virtual btDynamicsWorldType getWorldType() const + { + return BT_CONTINUOUS_DYNAMICS_WORLD; + } + +}; + +#endif //BT_CONTINUOUS_DYNAMICS_WORLD_H diff --git a/src/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp new file mode 100644 index 000000000..d047474c8 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -0,0 +1,1004 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "btDiscreteDynamicsWorld.h" + +//collision detection +#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" +#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h" +#include "BulletCollision/CollisionShapes/btCollisionShape.h" +#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h" +#include + +//rigidbody & constraints +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h" +#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h" +#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h" + +//for debug rendering +#include "BulletCollision/CollisionShapes/btBoxShape.h" +#include "BulletCollision/CollisionShapes/btCapsuleShape.h" +#include "BulletCollision/CollisionShapes/btCompoundShape.h" +#include "BulletCollision/CollisionShapes/btConeShape.h" +#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h" +#include "BulletCollision/CollisionShapes/btCylinderShape.h" +#include "BulletCollision/CollisionShapes/btMultiSphereShape.h" +#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" +#include "BulletCollision/CollisionShapes/btTriangleCallback.h" +#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h" +#include "LinearMath/btIDebugDraw.h" + + + +//vehicle +#include "BulletDynamics/Vehicle/btRaycastVehicle.h" +#include "BulletDynamics/Vehicle/btVehicleRaycaster.h" +#include "BulletDynamics/Vehicle/btWheelInfo.h" +#include "LinearMath/btIDebugDraw.h" +#include "LinearMath/btQuickprof.h" +#include "LinearMath/btMotionState.h" + + + + + +btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration) +:btDynamicsWorld(dispatcher,pairCache,collisionConfiguration), +m_constraintSolver(constraintSolver), +m_debugDrawer(0), +m_gravity(0,-10,0), +m_localTime(btScalar(1.)/btScalar(60.)), +m_profileTimings(0) +{ + if (!m_constraintSolver) + { + void* mem = btAlignedAlloc(sizeof(btSequentialImpulseConstraintSolver),16); + m_constraintSolver = new (mem) btSequentialImpulseConstraintSolver; + m_ownsConstraintSolver = true; + } else + { + m_ownsConstraintSolver = false; + } + + { + void* mem = btAlignedAlloc(sizeof(btSimulationIslandManager),16); + m_islandManager = new (mem) btSimulationIslandManager(); + } + + m_ownsIslandManager = true; +} + + +btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld() +{ + //only delete it when we created it + if (m_ownsIslandManager) + { + m_islandManager->~btSimulationIslandManager(); + btAlignedFree( m_islandManager); + } + if (m_ownsConstraintSolver) + { + + m_constraintSolver->~btConstraintSolver(); + btAlignedFree(m_constraintSolver); + } +} + +void btDiscreteDynamicsWorld::saveKinematicState(btScalar timeStep) +{ + + for (int i=0;igetActivationState() != ISLAND_SLEEPING) + { + if (body->isKinematicObject()) + { + //to calculate velocities next frame + body->saveKinematicState(timeStep); + } + } + } + } +} + +void btDiscreteDynamicsWorld::synchronizeMotionStates() +{ + //debug vehicle wheels + + + { + //todo: iterate over awake simulation islands! + for ( int i=0;igetDebugMode() & btIDebugDraw::DBG_DrawWireframe) + { + btVector3 color(btScalar(255.),btScalar(255.),btScalar(255.)); + switch(colObj->getActivationState()) + { + case ACTIVE_TAG: + color = btVector3(btScalar(255.),btScalar(255.),btScalar(255.)); break; + case ISLAND_SLEEPING: + color = btVector3(btScalar(0.),btScalar(255.),btScalar(0.));break; + case WANTS_DEACTIVATION: + color = btVector3(btScalar(0.),btScalar(255.),btScalar(255.));break; + case DISABLE_DEACTIVATION: + color = btVector3(btScalar(255.),btScalar(0.),btScalar(0.));break; + case DISABLE_SIMULATION: + color = btVector3(btScalar(255.),btScalar(255.),btScalar(0.));break; + default: + { + color = btVector3(btScalar(255.),btScalar(0.),btScalar(0.)); + } + }; + + debugDrawObject(colObj->getWorldTransform(),colObj->getCollisionShape(),color); + } + btRigidBody* body = btRigidBody::upcast(colObj); + if (body && body->getMotionState() && !body->isStaticOrKinematicObject()) + { + //we need to call the update at least once, even for sleeping objects + //otherwise the 'graphics' transform never updates properly + //so todo: add 'dirty' flag + //if (body->getActivationState() != ISLAND_SLEEPING) + { + btTransform interpolatedTransform; + btTransformUtil::integrateTransform(body->getInterpolationWorldTransform(), + body->getInterpolationLinearVelocity(),body->getInterpolationAngularVelocity(),m_localTime,interpolatedTransform); + body->getMotionState()->setWorldTransform(interpolatedTransform); + } + } + } + } + + if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe) + { + for ( int i=0;im_vehicles.size();i++) + { + for (int v=0;vgetNumWheels();v++) + { + btVector3 wheelColor(0,255,255); + if (m_vehicles[i]->getWheelInfo(v).m_raycastInfo.m_isInContact) + { + wheelColor.setValue(0,0,255); + } else + { + wheelColor.setValue(255,0,255); + } + + //synchronize the wheels with the (interpolated) chassis worldtransform + m_vehicles[i]->updateWheelTransform(v,true); + + btVector3 wheelPosWS = m_vehicles[i]->getWheelInfo(v).m_worldTransform.getOrigin(); + + btVector3 axle = btVector3( + m_vehicles[i]->getWheelInfo(v).m_worldTransform.getBasis()[0][m_vehicles[i]->getRightAxis()], + m_vehicles[i]->getWheelInfo(v).m_worldTransform.getBasis()[1][m_vehicles[i]->getRightAxis()], + m_vehicles[i]->getWheelInfo(v).m_worldTransform.getBasis()[2][m_vehicles[i]->getRightAxis()]); + + + //m_vehicles[i]->getWheelInfo(v).m_raycastInfo.m_wheelAxleWS + //debug wheels (cylinders) + m_debugDrawer->drawLine(wheelPosWS,wheelPosWS+axle,wheelColor); + m_debugDrawer->drawLine(wheelPosWS,m_vehicles[i]->getWheelInfo(v).m_raycastInfo.m_contactPointWS,wheelColor); + + } + } + } + +} + + +int btDiscreteDynamicsWorld::stepSimulation( btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep) +{ + int numSimulationSubSteps = 0; + + if (maxSubSteps) + { + //fixed timestep with interpolation + m_localTime += timeStep; + if (m_localTime >= fixedTimeStep) + { + numSimulationSubSteps = int( m_localTime / fixedTimeStep); + m_localTime -= numSimulationSubSteps * fixedTimeStep; + } + } else + { + //variable timestep + fixedTimeStep = timeStep; + m_localTime = timeStep; + if (btFuzzyZero(timeStep)) + { + numSimulationSubSteps = 0; + maxSubSteps = 0; + } else + { + numSimulationSubSteps = 1; + maxSubSteps = 1; + } + } + + //process some debugging flags + if (getDebugDrawer()) + { + gDisableDeactivation = (getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_NoDeactivation) != 0; + } + if (numSimulationSubSteps) + { + + saveKinematicState(fixedTimeStep); + + //clamp the number of substeps, to prevent simulation grinding spiralling down to a halt + int clampedSimulationSteps = (numSimulationSubSteps > maxSubSteps)? maxSubSteps : numSimulationSubSteps; + + for (int i=0;isetGravity(gravity); + } + } +} + + +void btDiscreteDynamicsWorld::removeRigidBody(btRigidBody* body) +{ + removeCollisionObject(body); +} + +void btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body) +{ + if (!body->isStaticOrKinematicObject()) + { + body->setGravity(m_gravity); + } + + if (body->getCollisionShape()) + { + bool isDynamic = !(body->isStaticObject() || body->isKinematicObject()); + short collisionFilterGroup = isDynamic? short(btBroadphaseProxy::DefaultFilter) : short(btBroadphaseProxy::StaticFilter); + short collisionFilterMask = isDynamic? short(btBroadphaseProxy::AllFilter) : short(btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter); + + addCollisionObject(body,collisionFilterGroup,collisionFilterMask); + } +} + +void btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body, short group, short mask) +{ + if (!body->isStaticOrKinematicObject()) + { + body->setGravity(m_gravity); + } + + if (body->getCollisionShape()) + { + addCollisionObject(body,group,mask); + } +} + + +void btDiscreteDynamicsWorld::updateVehicles(btScalar timeStep) +{ + BEGIN_PROFILE("updateVehicles"); + + for ( int i=0;iupdateVehicle( timeStep); + } + END_PROFILE("updateVehicles"); +} + +void btDiscreteDynamicsWorld::updateActivationState(btScalar timeStep) +{ + BEGIN_PROFILE("updateActivationState"); + + for ( int i=0;iupdateDeactivation(timeStep); + + if (body->wantsSleeping()) + { + if (body->isStaticOrKinematicObject()) + { + body->setActivationState(ISLAND_SLEEPING); + } else + { + if (body->getActivationState() == ACTIVE_TAG) + body->setActivationState( WANTS_DEACTIVATION ); + } + } else + { + if (body->getActivationState() != DISABLE_DEACTIVATION) + body->setActivationState( ACTIVE_TAG ); + } + } + } + END_PROFILE("updateActivationState"); +} + +void btDiscreteDynamicsWorld::addConstraint(btTypedConstraint* constraint,bool disableCollisionsBetweenLinkedBodies) +{ + m_constraints.push_back(constraint); + if (disableCollisionsBetweenLinkedBodies) + { + constraint->getRigidBodyA().addConstraintRef(constraint); + constraint->getRigidBodyB().addConstraintRef(constraint); + } +} + +void btDiscreteDynamicsWorld::removeConstraint(btTypedConstraint* constraint) +{ + m_constraints.remove(constraint); + constraint->getRigidBodyA().removeConstraintRef(constraint); + constraint->getRigidBodyB().removeConstraintRef(constraint); +} + +void btDiscreteDynamicsWorld::addVehicle(btRaycastVehicle* vehicle) +{ + m_vehicles.push_back(vehicle); +} + +void btDiscreteDynamicsWorld::removeVehicle(btRaycastVehicle* vehicle) +{ + m_vehicles.remove(vehicle); +} + +SIMD_FORCE_INLINE int btGetConstraintIslandId(const btTypedConstraint* lhs) +{ + int islandId; + + const btCollisionObject& rcolObj0 = lhs->getRigidBodyA(); + const btCollisionObject& rcolObj1 = lhs->getRigidBodyB(); + islandId= rcolObj0.getIslandTag()>=0?rcolObj0.getIslandTag():rcolObj1.getIslandTag(); + return islandId; + +} + + +class btSortConstraintOnIslandPredicate +{ + public: + + bool operator() ( const btTypedConstraint* lhs, const btTypedConstraint* rhs ) + { + int rIslandId0,lIslandId0; + rIslandId0 = btGetConstraintIslandId(rhs); + lIslandId0 = btGetConstraintIslandId(lhs); + return lIslandId0 < rIslandId0; + } +}; + + + + +void btDiscreteDynamicsWorld::solveConstraints(btContactSolverInfo& solverInfo) +{ + + struct InplaceSolverIslandCallback : public btSimulationIslandManager::IslandCallback + { + + btContactSolverInfo& m_solverInfo; + btConstraintSolver* m_solver; + btTypedConstraint** m_sortedConstraints; + int m_numConstraints; + btIDebugDraw* m_debugDrawer; + btStackAlloc* m_stackAlloc; + btDispatcher* m_dispatcher; + + InplaceSolverIslandCallback( + btContactSolverInfo& solverInfo, + btConstraintSolver* solver, + btTypedConstraint** sortedConstraints, + int numConstraints, + btIDebugDraw* debugDrawer, + btStackAlloc* stackAlloc, + btDispatcher* dispatcher) + :m_solverInfo(solverInfo), + m_solver(solver), + m_sortedConstraints(sortedConstraints), + m_numConstraints(numConstraints), + m_debugDrawer(debugDrawer), + m_stackAlloc(stackAlloc), + m_dispatcher(dispatcher) + { + + } + + InplaceSolverIslandCallback& operator=(InplaceSolverIslandCallback& other) + { + btAssert(0); + (void)other; + return *this; + } + virtual void ProcessIsland(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifolds,int numManifolds, int islandId) + { + if (islandId<0) + { + ///we don't split islands, so all constraints/contact manifolds/bodies are passed into the solver regardless the island id + m_solver->solveGroup( bodies,numBodies,manifolds, numManifolds,&m_sortedConstraints[0],m_numConstraints,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher); + } else + { + //also add all non-contact constraints/joints for this island + btTypedConstraint** startConstraint = 0; + int numCurConstraints = 0; + int i; + + //find the first constraint for this island + for (i=0;isolveGroup( bodies,numBodies,manifolds, numManifolds,startConstraint,numCurConstraints,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher); + + } + } + + }; + + //sorted version of all btTypedConstraint, based on islandId + btAlignedObjectArray sortedConstraints; + sortedConstraints.resize( m_constraints.size()); + int i; + for (i=0;iprepareSolve(getCollisionWorld()->getNumCollisionObjects(), getCollisionWorld()->getDispatcher()->getNumManifolds()); + + /// solve all the constraints for this island + m_islandManager->buildAndProcessIslands(getCollisionWorld()->getDispatcher(),getCollisionWorld()->getCollisionObjectArray(),&solverCallback); + + m_constraintSolver->allSolved(solverInfo, m_debugDrawer, m_stackAlloc); +} + + + + +void btDiscreteDynamicsWorld::calculateSimulationIslands() +{ + BEGIN_PROFILE("calculateSimulationIslands"); + + getSimulationIslandManager()->updateActivationState(getCollisionWorld(),getCollisionWorld()->getDispatcher()); + + { + int i; + int numConstraints = int(m_constraints.size()); + for (i=0;i< numConstraints ; i++ ) + { + btTypedConstraint* constraint = m_constraints[i]; + + const btRigidBody* colObj0 = &constraint->getRigidBodyA(); + const btRigidBody* colObj1 = &constraint->getRigidBodyB(); + + if (((colObj0) && ((colObj0)->mergesSimulationIslands())) && + ((colObj1) && ((colObj1)->mergesSimulationIslands()))) + { + if (colObj0->isActive() || colObj1->isActive()) + { + + getSimulationIslandManager()->getUnionFind().unite((colObj0)->getIslandTag(), + (colObj1)->getIslandTag()); + } + } + } + } + + //Store the island id in each body + getSimulationIslandManager()->storeIslandActivationState(getCollisionWorld()); + + END_PROFILE("calculateSimulationIslands"); + +} + + +void btDiscreteDynamicsWorld::updateAabbs() +{ + BEGIN_PROFILE("updateAabbs"); + + btVector3 colorvec(1,0,0); + btTransform predictedTrans; + for ( int i=0;iIsActive() && (!body->IsStatic())) + { + btPoint3 minAabb,maxAabb; + colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb); + btBroadphaseInterface* bp = (btBroadphaseInterface*)m_broadphasePairCache; + + //moving objects should be moderately sized, probably something wrong if not + if ( colObj->isStaticObject() || ((maxAabb-minAabb).length2() < btScalar(1e12))) + { + bp->setAabb(body->getBroadphaseHandle(),minAabb,maxAabb, m_dispatcher1); + } else + { + //something went wrong, investigate + //this assert is unwanted in 3D modelers (danger of loosing work) + body->setActivationState(DISABLE_SIMULATION); + + static bool reportMe = true; + if (reportMe && m_debugDrawer) + { + reportMe = false; + m_debugDrawer->reportErrorWarning("Overflow in AABB, object removed from simulation"); + m_debugDrawer->reportErrorWarning("If you can reproduce this, please email bugs@continuousphysics.com\n"); + m_debugDrawer->reportErrorWarning("Please include above information, your Platform, version of OS.\n"); + m_debugDrawer->reportErrorWarning("Thanks.\n"); + } + + + } + if (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawAabb)) + { + m_debugDrawer->drawAabb(minAabb,maxAabb,colorvec); + } + } + } + } + + END_PROFILE("updateAabbs"); +} + +void btDiscreteDynamicsWorld::integrateTransforms(btScalar timeStep) +{ + BEGIN_PROFILE("integrateTransforms"); + btTransform predictedTrans; + for ( int i=0;iisActive() && (!body->isStaticOrKinematicObject())) + { + body->predictIntegratedTransform(timeStep, predictedTrans); + body->proceedToTransform( predictedTrans); + } + } + } + END_PROFILE("integrateTransforms"); +} + + + +void btDiscreteDynamicsWorld::predictUnconstraintMotion(btScalar timeStep) +{ + BEGIN_PROFILE("predictUnconstraintMotion"); + for ( int i=0;iisStaticOrKinematicObject()) + { + if (body->isActive()) + { + body->applyForces( timeStep); + body->integrateVelocities( timeStep); + body->predictIntegratedTransform(timeStep,body->getInterpolationWorldTransform()); + } + } + } + } + END_PROFILE("predictUnconstraintMotion"); +} + + +void btDiscreteDynamicsWorld::startProfiling(btScalar timeStep) +{ + (void)timeStep; + #ifdef USE_QUICKPROF + + + //toggle btProfiler + if ( m_debugDrawer && m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_ProfileTimings) + { + if (!m_profileTimings) + { + m_profileTimings = 1; + // To disable profiling, simply comment out the following line. + static int counter = 0; + + char filename[128]; + sprintf(filename,"quickprof_bullet_timings%i.csv",counter++); + btProfiler::init(filename, btProfiler::BLOCK_CYCLE_SECONDS);//BLOCK_TOTAL_MICROSECONDS + } else + { + btProfiler::endProfilingCycle(); + } + + } else + { + if (m_profileTimings) + { + btProfiler::endProfilingCycle(); + + m_profileTimings = 0; + btProfiler::destroy(); + } + } +#endif //USE_QUICKPROF +} + + + + + + +class DebugDrawcallback : public btTriangleCallback, public btInternalTriangleIndexCallback +{ + btIDebugDraw* m_debugDrawer; + btVector3 m_color; + btTransform m_worldTrans; + +public: + + DebugDrawcallback(btIDebugDraw* debugDrawer,const btTransform& worldTrans,const btVector3& color) : + m_debugDrawer(debugDrawer), + m_color(color), + m_worldTrans(worldTrans) + { + } + + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + { + processTriangle(triangle,partId,triangleIndex); + } + + virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex) + { + (void)partId; + (void)triangleIndex; + + btVector3 wv0,wv1,wv2; + wv0 = m_worldTrans*triangle[0]; + wv1 = m_worldTrans*triangle[1]; + wv2 = m_worldTrans*triangle[2]; + m_debugDrawer->drawLine(wv0,wv1,m_color); + m_debugDrawer->drawLine(wv1,wv2,m_color); + m_debugDrawer->drawLine(wv2,wv0,m_color); + } +}; + +void btDiscreteDynamicsWorld::debugDrawSphere(btScalar radius, const btTransform& transform, const btVector3& color) +{ + btVector3 start = transform.getOrigin(); + + const btVector3 xoffs = transform.getBasis() * btVector3(radius,0,0); + const btVector3 yoffs = transform.getBasis() * btVector3(0,radius,0); + const btVector3 zoffs = transform.getBasis() * btVector3(0,0,radius); + + // XY + getDebugDrawer()->drawLine(start-xoffs, start+yoffs, color); + getDebugDrawer()->drawLine(start+yoffs, start+xoffs, color); + getDebugDrawer()->drawLine(start+xoffs, start-yoffs, color); + getDebugDrawer()->drawLine(start-yoffs, start-xoffs, color); + + // XZ + getDebugDrawer()->drawLine(start-xoffs, start+zoffs, color); + getDebugDrawer()->drawLine(start+zoffs, start+xoffs, color); + getDebugDrawer()->drawLine(start+xoffs, start-zoffs, color); + getDebugDrawer()->drawLine(start-zoffs, start-xoffs, color); + + // YZ + getDebugDrawer()->drawLine(start-yoffs, start+zoffs, color); + getDebugDrawer()->drawLine(start+zoffs, start+yoffs, color); + getDebugDrawer()->drawLine(start+yoffs, start-zoffs, color); + getDebugDrawer()->drawLine(start-zoffs, start-yoffs, color); +} + +void btDiscreteDynamicsWorld::debugDrawObject(const btTransform& worldTransform, const btCollisionShape* shape, const btVector3& color) +{ + // Draw a small simplex at the center of the object + { + btVector3 start = worldTransform.getOrigin(); + getDebugDrawer()->drawLine(start, start+worldTransform.getBasis() * btVector3(1,0,0), btVector3(1,0,0)); + getDebugDrawer()->drawLine(start, start+worldTransform.getBasis() * btVector3(0,1,0), btVector3(0,1,0)); + getDebugDrawer()->drawLine(start, start+worldTransform.getBasis() * btVector3(0,0,1), btVector3(0,0,1)); + } + + if (shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE) + { + const btCompoundShape* compoundShape = static_cast(shape); + for (int i=compoundShape->getNumChildShapes()-1;i>=0;i--) + { + btTransform childTrans = compoundShape->getChildTransform(i); + const btCollisionShape* colShape = compoundShape->getChildShape(i); + debugDrawObject(worldTransform*childTrans,colShape,color); + } + + } else + { + switch (shape->getShapeType()) + { + + case SPHERE_SHAPE_PROXYTYPE: + { + const btSphereShape* sphereShape = static_cast(shape); + btScalar radius = sphereShape->getMargin();//radius doesn't include the margin, so draw with margin + + debugDrawSphere(radius, worldTransform, color); + break; + } + case MULTI_SPHERE_SHAPE_PROXYTYPE: + { + const btMultiSphereShape* multiSphereShape = static_cast(shape); + + for (int i = multiSphereShape->getSphereCount()-1; i>=0;i--) + { + btTransform childTransform = worldTransform; + childTransform.getOrigin() += multiSphereShape->getSpherePosition(i); + debugDrawSphere(multiSphereShape->getSphereRadius(i), childTransform, color); + } + + break; + } + case CAPSULE_SHAPE_PROXYTYPE: + { + const btCapsuleShape* capsuleShape = static_cast(shape); + + btScalar radius = capsuleShape->getRadius(); + btScalar halfHeight = capsuleShape->getHalfHeight(); + + // Draw the ends + { + btTransform childTransform = worldTransform; + childTransform.getOrigin() = worldTransform * btVector3(0,halfHeight,0); + debugDrawSphere(radius, childTransform, color); + } + + { + btTransform childTransform = worldTransform; + childTransform.getOrigin() = worldTransform * btVector3(0,-halfHeight,0); + debugDrawSphere(radius, childTransform, color); + } + + // Draw some additional lines + btVector3 start = worldTransform.getOrigin(); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(-radius,halfHeight,0),start+worldTransform.getBasis() * btVector3(-radius,-halfHeight,0), color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(radius,halfHeight,0),start+worldTransform.getBasis() * btVector3(radius,-halfHeight,0), color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(0,halfHeight,-radius),start+worldTransform.getBasis() * btVector3(0,-halfHeight,-radius), color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(0,halfHeight,radius),start+worldTransform.getBasis() * btVector3(0,-halfHeight,radius), color); + + break; + } + case CONE_SHAPE_PROXYTYPE: + { + const btConeShape* coneShape = static_cast(shape); + btScalar radius = coneShape->getRadius();//+coneShape->getMargin(); + btScalar height = coneShape->getHeight();//+coneShape->getMargin(); + btVector3 start = worldTransform.getOrigin(); + + int upAxis= coneShape->getConeUpIndex(); + + + btVector3 offsetHeight(0,0,0); + offsetHeight[upAxis] = height * btScalar(0.5); + btVector3 offsetRadius(0,0,0); + offsetRadius[(upAxis+1)%3] = radius; + btVector3 offset2Radius(0,0,0); + offset2Radius[(upAxis+2)%3] = radius; + + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight+offsetRadius),color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight-offsetRadius),color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight+offset2Radius),color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight-offset2Radius),color); + + + + break; + + } + case CYLINDER_SHAPE_PROXYTYPE: + { + const btCylinderShape* cylinder = static_cast(shape); + int upAxis = cylinder->getUpAxis(); + btScalar radius = cylinder->getRadius(); + btScalar halfHeight = cylinder->getHalfExtentsWithMargin()[upAxis]; + btVector3 start = worldTransform.getOrigin(); + btVector3 offsetHeight(0,0,0); + offsetHeight[upAxis] = halfHeight; + btVector3 offsetRadius(0,0,0); + offsetRadius[(upAxis+1)%3] = radius; + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight+offsetRadius),start+worldTransform.getBasis() * (-offsetHeight+offsetRadius),color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight-offsetRadius),start+worldTransform.getBasis() * (-offsetHeight-offsetRadius),color); + break; + } + default: + { + + if (shape->isConcave()) + { + btConcaveShape* concaveMesh = (btConcaveShape*) shape; + + //todo pass camera, for some culling + btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + btVector3 aabbMin(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30)); + + DebugDrawcallback drawCallback(getDebugDrawer(),worldTransform,color); + concaveMesh->processAllTriangles(&drawCallback,aabbMin,aabbMax); + + } + + if (shape->getShapeType() == CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE) + { + btConvexTriangleMeshShape* convexMesh = (btConvexTriangleMeshShape*) shape; + //todo: pass camera for some culling + btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); + btVector3 aabbMin(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30)); + //DebugDrawcallback drawCallback; + DebugDrawcallback drawCallback(getDebugDrawer(),worldTransform,color); + convexMesh->getMeshInterface()->InternalProcessAllTriangles(&drawCallback,aabbMin,aabbMax); + } + + + /// for polyhedral shapes + if (shape->isPolyhedral()) + { + btPolyhedralConvexShape* polyshape = (btPolyhedralConvexShape*) shape; + + int i; + for (i=0;igetNumEdges();i++) + { + btPoint3 a,b; + polyshape->getEdge(i,a,b); + btVector3 wa = worldTransform * a; + btVector3 wb = worldTransform * b; + getDebugDrawer()->drawLine(wa,wb,color); + + } + + + } + } + } + } +} + + +void btDiscreteDynamicsWorld::setConstraintSolver(btConstraintSolver* solver) +{ + if (m_ownsConstraintSolver) + { + btAlignedFree( m_constraintSolver); + } + m_ownsConstraintSolver = false; + m_constraintSolver = solver; +} + +btConstraintSolver* btDiscreteDynamicsWorld::getConstraintSolver() +{ + return m_constraintSolver; +} + + +int btDiscreteDynamicsWorld::getNumConstraints() const +{ + return int(m_constraints.size()); +} +btTypedConstraint* btDiscreteDynamicsWorld::getConstraint(int index) +{ + return m_constraints[index]; +} +const btTypedConstraint* btDiscreteDynamicsWorld::getConstraint(int index) const +{ + return m_constraints[index]; +} diff --git a/src/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h b/src/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h new file mode 100644 index 000000000..7364c4cd6 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h @@ -0,0 +1,164 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_DISCRETE_DYNAMICS_WORLD_H +#define BT_DISCRETE_DYNAMICS_WORLD_H + +#include "btDynamicsWorld.h" + +class btDispatcher; +class btOverlappingPairCache; +class btConstraintSolver; +class btSimulationIslandManager; +class btTypedConstraint; +#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h" + +class btRaycastVehicle; +class btIDebugDraw; +#include "LinearMath/btAlignedObjectArray.h" + + +///btDiscreteDynamicsWorld provides discrete rigid body simulation +///those classes replace the obsolete CcdPhysicsEnvironment/CcdPhysicsController +class btDiscreteDynamicsWorld : public btDynamicsWorld +{ +protected: + + btConstraintSolver* m_constraintSolver; + + btSimulationIslandManager* m_islandManager; + + btAlignedObjectArray m_constraints; + + btIDebugDraw* m_debugDrawer; + + btVector3 m_gravity; + + //for variable timesteps + btScalar m_localTime; + //for variable timesteps + + bool m_ownsIslandManager; + bool m_ownsConstraintSolver; + + btContactSolverInfo m_solverInfo; + + + btAlignedObjectArray m_vehicles; + + int m_profileTimings; + + void predictUnconstraintMotion(btScalar timeStep); + + void integrateTransforms(btScalar timeStep); + + void calculateSimulationIslands(); + + void solveConstraints(btContactSolverInfo& solverInfo); + + void updateActivationState(btScalar timeStep); + + void updateVehicles(btScalar timeStep); + + void startProfiling(btScalar timeStep); + + virtual void internalSingleStepSimulation( btScalar timeStep); + + void synchronizeMotionStates(); + + void saveKinematicState(btScalar timeStep); + + void debugDrawSphere(btScalar radius, const btTransform& transform, const btVector3& color); + +public: + + + ///this btDiscreteDynamicsWorld constructor gets created objects from the user, and will not delete those + btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration); + + virtual ~btDiscreteDynamicsWorld(); + + ///if maxSubSteps > 0, it will interpolate motion between fixedTimeStep's + virtual int stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.)); + + virtual void updateAabbs(); + + void addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies=false); + + void removeConstraint(btTypedConstraint* constraint); + + void addVehicle(btRaycastVehicle* vehicle); + + void removeVehicle(btRaycastVehicle* vehicle); + + btSimulationIslandManager* getSimulationIslandManager() + { + return m_islandManager; + } + + const btSimulationIslandManager* getSimulationIslandManager() const + { + return m_islandManager; + } + + btCollisionWorld* getCollisionWorld() + { + return this; + } + + virtual void setDebugDrawer(btIDebugDraw* debugDrawer) + { + m_debugDrawer = debugDrawer; + } + + virtual btIDebugDraw* getDebugDrawer() + { + return m_debugDrawer; + } + + virtual void setGravity(const btVector3& gravity); + + virtual void addRigidBody(btRigidBody* body); + + virtual void addRigidBody(btRigidBody* body, short group, short mask); + + virtual void removeRigidBody(btRigidBody* body); + + void debugDrawObject(const btTransform& worldTransform, const btCollisionShape* shape, const btVector3& color); + + virtual void setConstraintSolver(btConstraintSolver* solver); + + virtual btConstraintSolver* getConstraintSolver(); + + virtual int getNumConstraints() const; + + virtual btTypedConstraint* getConstraint(int index) ; + + virtual const btTypedConstraint* getConstraint(int index) const; + + btContactSolverInfo& getSolverInfo() + { + return m_solverInfo; + } + + virtual btDynamicsWorldType getWorldType() const + { + return BT_DISCRETE_DYNAMICS_WORLD; + } + + +}; + +#endif //BT_DISCRETE_DYNAMICS_WORLD_H diff --git a/src/bullet/src/BulletDynamics/Dynamics/btDynamicsWorld.h b/src/bullet/src/BulletDynamics/Dynamics/btDynamicsWorld.h new file mode 100644 index 000000000..aaf734a09 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/btDynamicsWorld.h @@ -0,0 +1,89 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_DYNAMICS_WORLD_H +#define BT_DYNAMICS_WORLD_H + +#include "BulletCollision/CollisionDispatch/btCollisionWorld.h" +class btTypedConstraint; +class btRaycastVehicle; +class btConstraintSolver; + + +enum btDynamicsWorldType +{ + BT_SIMPLE_DYNAMICS_WORLD=1, + BT_DISCRETE_DYNAMICS_WORLD=2, + BT_CONTINUOUS_DYNAMICS_WORLD=3 +}; + +///btDynamicsWorld is the baseclass for several dynamics implementation, basic, discrete, parallel, and continuous +class btDynamicsWorld : public btCollisionWorld +{ + public: + + + btDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphase,btCollisionConfiguration* collisionConfiguration) + :btCollisionWorld(dispatcher,broadphase,collisionConfiguration) + { + } + + virtual ~btDynamicsWorld() + { + } + + ///stepSimulation proceeds the simulation over timeStep units + ///if maxSubSteps > 0, it will interpolate time steps + virtual int stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.))=0; + + virtual void updateAabbs() = 0; + + virtual void addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies=false) { (void)constraint;}; + + virtual void removeConstraint(btTypedConstraint* constraint) {(void)constraint;}; + + virtual void addVehicle(btRaycastVehicle* vehicle) {(void)vehicle;}; + + virtual void removeVehicle(btRaycastVehicle* vehicle) {(void)vehicle;}; + + + virtual void setDebugDrawer(btIDebugDraw* debugDrawer) = 0; + + virtual btIDebugDraw* getDebugDrawer() = 0; + + //once a rigidbody is added to the dynamics world, it will get this gravity assigned + //existing rigidbodies in the world get gravity assigned too, during this method + virtual void setGravity(const btVector3& gravity) = 0; + + virtual void addRigidBody(btRigidBody* body) = 0; + + virtual void removeRigidBody(btRigidBody* body) = 0; + + virtual void setConstraintSolver(btConstraintSolver* solver) = 0; + + virtual btConstraintSolver* getConstraintSolver() = 0; + + virtual int getNumConstraints() const { return 0; } + + virtual btTypedConstraint* getConstraint(int index) { (void)index; return 0; } + + virtual const btTypedConstraint* getConstraint(int index) const { (void)index; return 0; } + + virtual btDynamicsWorldType getWorldType() const=0; + +}; + +#endif //BT_DYNAMICS_WORLD_H + diff --git a/src/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp b/src/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp new file mode 100644 index 000000000..03e60acdb --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp @@ -0,0 +1,350 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btRigidBody.h" +#include "BulletCollision/CollisionShapes/btConvexShape.h" +#include "LinearMath/btMinMax.h" +#include "LinearMath/btTransformUtil.h" +#include "LinearMath/btMotionState.h" +#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h" + +btScalar gLinearAirDamping = btScalar(1.); +//'temporarily' global variables +btScalar gDeactivationTime = btScalar(2.); +bool gDisableDeactivation = false; + +btScalar gLinearSleepingThreshold = btScalar(0.8); +btScalar gAngularSleepingThreshold = btScalar(1.0); +static int uniqueId = 0; + +btRigidBody::btRigidBody(btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia,btScalar linearDamping,btScalar angularDamping,btScalar friction,btScalar restitution) +: + m_linearVelocity(btScalar(0.0), btScalar(0.0), btScalar(0.0)), + m_angularVelocity(btScalar(0.),btScalar(0.),btScalar(0.)), + m_angularFactor(btScalar(1.)), + m_gravity(btScalar(0.0), btScalar(0.0), btScalar(0.0)), + m_totalForce(btScalar(0.0), btScalar(0.0), btScalar(0.0)), + m_totalTorque(btScalar(0.0), btScalar(0.0), btScalar(0.0)), + m_linearDamping(btScalar(0.)), + m_angularDamping(btScalar(0.5)), + m_linearSleepingThreshold(gLinearSleepingThreshold), + m_angularSleepingThreshold(gAngularSleepingThreshold), + m_optionalMotionState(motionState), + m_contactSolverType(0), + m_frictionSolverType(0) +{ + + if (motionState) + { + motionState->getWorldTransform(m_worldTransform); + } else + { + m_worldTransform = btTransform::getIdentity(); + } + + m_interpolationWorldTransform = m_worldTransform; + m_interpolationLinearVelocity.setValue(0,0,0); + m_interpolationAngularVelocity.setValue(0,0,0); + + //moved to btCollisionObject + m_friction = friction; + m_restitution = restitution; + + m_collisionShape = collisionShape; + m_debugBodyId = uniqueId++; + + //m_internalOwner is to allow upcasting from collision object to rigid body + m_internalOwner = this; + + setMassProps(mass, localInertia); + setDamping(linearDamping, angularDamping); + updateInertiaTensor(); + +} + +#ifdef OBSOLETE_MOTIONSTATE_LESS +btRigidBody::btRigidBody( btScalar mass,const btTransform& worldTransform,btCollisionShape* collisionShape,const btVector3& localInertia,btScalar linearDamping,btScalar angularDamping,btScalar friction,btScalar restitution) +: + m_gravity(btScalar(0.0), btScalar(0.0), btScalar(0.0)), + m_totalForce(btScalar(0.0), btScalar(0.0), btScalar(0.0)), + m_totalTorque(btScalar(0.0), btScalar(0.0), btScalar(0.0)), + m_linearVelocity(btScalar(0.0), btScalar(0.0), btScalar(0.0)), + m_angularVelocity(btScalar(0.),btScalar(0.),btScalar(0.)), + m_linearSleepingThreshold(gLinearSleepingThreshold), + m_angularSleepingThreshold(gAngularSleepingThreshold), + m_linearDamping(btScalar(0.)), + m_angularDamping(btScalar(0.5)), + m_optionalMotionState(0), + m_contactSolverType(0), + m_frictionSolverType(0) + +{ + + m_worldTransform = worldTransform; + m_interpolationWorldTransform = m_worldTransform; + m_interpolationLinearVelocity.setValue(0,0,0); + m_interpolationAngularVelocity.setValue(0,0,0); + + //moved to btCollisionObject + m_friction = friction; + m_restitution = restitution; + + m_collisionShape = collisionShape; + m_debugBodyId = uniqueId++; + + //m_internalOwner is to allow upcasting from collision object to rigid body + m_internalOwner = this; + + setMassProps(mass, localInertia); + setDamping(linearDamping, angularDamping); + updateInertiaTensor(); + +} + +#endif //OBSOLETE_MOTIONSTATE_LESS + + + + +#define EXPERIMENTAL_JITTER_REMOVAL 1 +#ifdef EXPERIMENTAL_JITTER_REMOVAL +//Bullet 2.20b has experimental damping code to reduce jitter just before objects fall asleep/deactivate +//doesn't work very well yet (value 0 disabled this damping) +//note there this influences deactivation thresholds! +btScalar gClippedAngvelThresholdSqr = btScalar(0.01); +btScalar gClippedLinearThresholdSqr = btScalar(0.01); +#endif //EXPERIMENTAL_JITTER_REMOVAL + +btScalar gJitterVelocityDampingFactor = btScalar(0.7); + +void btRigidBody::predictIntegratedTransform(btScalar timeStep,btTransform& predictedTransform) +{ + +#ifdef EXPERIMENTAL_JITTER_REMOVAL + //if (wantsSleeping()) + { + //clip to avoid jitter + if ((m_angularVelocity.length2() < gClippedAngvelThresholdSqr) && + (m_linearVelocity.length2() < gClippedLinearThresholdSqr)) + { + m_angularVelocity *= gJitterVelocityDampingFactor; + m_linearVelocity *= gJitterVelocityDampingFactor; + } + } + +#endif //EXPERIMENTAL_JITTER_REMOVAL + + btTransformUtil::integrateTransform(m_worldTransform,m_linearVelocity,m_angularVelocity,timeStep,predictedTransform); +} + +void btRigidBody::saveKinematicState(btScalar timeStep) +{ + //todo: clamp to some (user definable) safe minimum timestep, to limit maximum angular/linear velocities + if (timeStep != btScalar(0.)) + { + //if we use motionstate to synchronize world transforms, get the new kinematic/animated world transform + if (getMotionState()) + getMotionState()->getWorldTransform(m_worldTransform); + btVector3 linVel,angVel; + + btTransformUtil::calculateVelocity(m_interpolationWorldTransform,m_worldTransform,timeStep,m_linearVelocity,m_angularVelocity); + m_interpolationLinearVelocity = m_linearVelocity; + m_interpolationAngularVelocity = m_angularVelocity; + m_interpolationWorldTransform = m_worldTransform; + //printf("angular = %f %f %f\n",m_angularVelocity.getX(),m_angularVelocity.getY(),m_angularVelocity.getZ()); + } +} + +void btRigidBody::getAabb(btVector3& aabbMin,btVector3& aabbMax) const +{ + getCollisionShape()->getAabb(m_worldTransform,aabbMin,aabbMax); +} + + + + +void btRigidBody::setGravity(const btVector3& acceleration) +{ + if (m_inverseMass != btScalar(0.0)) + { + m_gravity = acceleration * (btScalar(1.0) / m_inverseMass); + } +} + + + + + + +void btRigidBody::setDamping(btScalar lin_damping, btScalar ang_damping) +{ + m_linearDamping = GEN_clamped(lin_damping, (btScalar)btScalar(0.0), (btScalar)btScalar(1.0)); + m_angularDamping = GEN_clamped(ang_damping, (btScalar)btScalar(0.0), (btScalar)btScalar(1.0)); +} + + + +#include + + +void btRigidBody::applyForces(btScalar step) +{ + if (isStaticOrKinematicObject()) + return; + + applyCentralForce(m_gravity); + + m_linearVelocity *= GEN_clamped((btScalar(1.) - step * gLinearAirDamping * m_linearDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0)); + m_angularVelocity *= GEN_clamped((btScalar(1.) - step * m_angularDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0)); + +#define FORCE_VELOCITY_DAMPING 1 +#ifdef FORCE_VELOCITY_DAMPING + btScalar speed = m_linearVelocity.length(); + if (speed < m_linearDamping) + { + btScalar dampVel = btScalar(0.005); + if (speed > dampVel) + { + btVector3 dir = m_linearVelocity.normalized(); + m_linearVelocity -= dir * dampVel; + } else + { + m_linearVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); + } + } + + btScalar angSpeed = m_angularVelocity.length(); + if (angSpeed < m_angularDamping) + { + btScalar angDampVel = btScalar(0.005); + if (angSpeed > angDampVel) + { + btVector3 dir = m_angularVelocity.normalized(); + m_angularVelocity -= dir * angDampVel; + } else + { + m_angularVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); + } + } +#endif //FORCE_VELOCITY_DAMPING + +} + +void btRigidBody::proceedToTransform(const btTransform& newTrans) +{ + setCenterOfMassTransform( newTrans ); +} + + +void btRigidBody::setMassProps(btScalar mass, const btVector3& inertia) +{ + if (mass == btScalar(0.)) + { + m_collisionFlags |= btCollisionObject::CF_STATIC_OBJECT; + m_inverseMass = btScalar(0.); + } else + { + m_collisionFlags &= (~btCollisionObject::CF_STATIC_OBJECT); + m_inverseMass = btScalar(1.0) / mass; + } + + m_invInertiaLocal.setValue(inertia.x() != btScalar(0.0) ? btScalar(1.0) / inertia.x(): btScalar(0.0), + inertia.y() != btScalar(0.0) ? btScalar(1.0) / inertia.y(): btScalar(0.0), + inertia.z() != btScalar(0.0) ? btScalar(1.0) / inertia.z(): btScalar(0.0)); + +} + + + +void btRigidBody::updateInertiaTensor() +{ + m_invInertiaTensorWorld = m_worldTransform.getBasis().scaled(m_invInertiaLocal) * m_worldTransform.getBasis().transpose(); +} + + +void btRigidBody::integrateVelocities(btScalar step) +{ + if (isStaticOrKinematicObject()) + return; + + m_linearVelocity += m_totalForce * (m_inverseMass * step); + m_angularVelocity += m_invInertiaTensorWorld * m_totalTorque * step; + +#define MAX_ANGVEL SIMD_HALF_PI + /// clamp angular velocity. collision calculations will fail on higher angular velocities + btScalar angvel = m_angularVelocity.length(); + if (angvel*step > MAX_ANGVEL) + { + m_angularVelocity *= (MAX_ANGVEL/step) /angvel; + } + + clearForces(); +} + +btQuaternion btRigidBody::getOrientation() const +{ + btQuaternion orn; + m_worldTransform.getBasis().getRotation(orn); + return orn; +} + + +void btRigidBody::setCenterOfMassTransform(const btTransform& xform) +{ + + if (isStaticOrKinematicObject()) + { + m_interpolationWorldTransform = m_worldTransform; + } else + { + m_interpolationWorldTransform = xform; + } + m_interpolationLinearVelocity = getLinearVelocity(); + m_interpolationAngularVelocity = getAngularVelocity(); + m_worldTransform = xform; + updateInertiaTensor(); +} + + +bool btRigidBody::checkCollideWithOverride(btCollisionObject* co) +{ + btRigidBody* otherRb = btRigidBody::upcast(co); + if (!otherRb) + return true; + + for (int i = 0; i < m_constraintRefs.size(); ++i) + { + btTypedConstraint* c = m_constraintRefs[i]; + if (&c->getRigidBodyA() == otherRb || &c->getRigidBodyB() == otherRb) + return false; + } + + return true; +} + +void btRigidBody::addConstraintRef(btTypedConstraint* c) +{ + int index = m_constraintRefs.findLinearSearch(c); + if (index == m_constraintRefs.size()) + m_constraintRefs.push_back(c); + + m_checkCollideWith = true; +} + +void btRigidBody::removeConstraintRef(btTypedConstraint* c) +{ + m_constraintRefs.remove(c); + m_checkCollideWith = m_constraintRefs.size() > 0; +} diff --git a/src/bullet/src/BulletDynamics/Dynamics/btRigidBody.h b/src/bullet/src/BulletDynamics/Dynamics/btRigidBody.h new file mode 100644 index 000000000..b11f9f76d --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/btRigidBody.h @@ -0,0 +1,385 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef RIGIDBODY_H +#define RIGIDBODY_H + +#include "LinearMath/btAlignedObjectArray.h" +#include "LinearMath/btPoint3.h" +#include "LinearMath/btTransform.h" +#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" + +class btCollisionShape; +class btMotionState; +class btTypedConstraint; + + +extern btScalar gLinearAirDamping; + +extern btScalar gDeactivationTime; +extern bool gDisableDeactivation; +extern btScalar gLinearSleepingThreshold; +extern btScalar gAngularSleepingThreshold; + + +/// btRigidBody class for btRigidBody Dynamics +/// +class btRigidBody : public btCollisionObject +{ + + btMatrix3x3 m_invInertiaTensorWorld; + btVector3 m_linearVelocity; + btVector3 m_angularVelocity; + btScalar m_inverseMass; + btScalar m_angularFactor; + + btVector3 m_gravity; + btVector3 m_invInertiaLocal; + btVector3 m_totalForce; + btVector3 m_totalTorque; + + btScalar m_linearDamping; + btScalar m_angularDamping; + + btScalar m_linearSleepingThreshold; + btScalar m_angularSleepingThreshold; + + + //m_optionalMotionState allows to automatic synchronize the world transform for active objects + btMotionState* m_optionalMotionState; + + //keep track of typed constraints referencing this rigid body + btAlignedObjectArray m_constraintRefs; + +public: + +#ifdef OBSOLETE_MOTIONSTATE_LESS + //not supported, please use btMotionState + btRigidBody(btScalar mass, const btTransform& worldTransform, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0),btScalar linearDamping=btScalar(0.),btScalar angularDamping=btScalar(0.),btScalar friction=btScalar(0.5),btScalar restitution=btScalar(0.)); +#endif //OBSOLETE_MOTIONSTATE_LESS + + btRigidBody(btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0),btScalar linearDamping=btScalar(0.),btScalar angularDamping=btScalar(0.),btScalar friction=btScalar(0.5),btScalar restitution=btScalar(0.)); + + virtual ~btRigidBody() + { + //No constraints should point to this rigidbody + //Remove constraints from the dynamics world before you delete the related rigidbodies. + btAssert(m_constraintRefs.size()==0); + } + + + void proceedToTransform(const btTransform& newTrans); + + ///to keep collision detection and dynamics separate we don't store a rigidbody pointer + ///but a rigidbody is derived from btCollisionObject, so we can safely perform an upcast + static const btRigidBody* upcast(const btCollisionObject* colObj) + { + return (const btRigidBody*)colObj->getInternalOwner(); + } + static btRigidBody* upcast(btCollisionObject* colObj) + { + return (btRigidBody*)colObj->getInternalOwner(); + } + + /// continuous collision detection needs prediction + void predictIntegratedTransform(btScalar step, btTransform& predictedTransform) ; + + void saveKinematicState(btScalar step); + + + void applyForces(btScalar step); + + void setGravity(const btVector3& acceleration); + + const btVector3& getGravity() const + { + return m_gravity; + } + + void setDamping(btScalar lin_damping, btScalar ang_damping); + + SIMD_FORCE_INLINE const btCollisionShape* getCollisionShape() const { + return m_collisionShape; + } + + SIMD_FORCE_INLINE btCollisionShape* getCollisionShape() { + return m_collisionShape; + } + + void setMassProps(btScalar mass, const btVector3& inertia); + + btScalar getInvMass() const { return m_inverseMass; } + const btMatrix3x3& getInvInertiaTensorWorld() const { + return m_invInertiaTensorWorld; + } + + void integrateVelocities(btScalar step); + + void setCenterOfMassTransform(const btTransform& xform); + + void applyCentralForce(const btVector3& force) + { + m_totalForce += force; + } + + const btVector3& getInvInertiaDiagLocal() + { + return m_invInertiaLocal; + }; + + void setInvInertiaDiagLocal(const btVector3& diagInvInertia) + { + m_invInertiaLocal = diagInvInertia; + } + + void setSleepingThresholds(btScalar linear,btScalar angular) + { + m_linearSleepingThreshold = linear; + m_angularSleepingThreshold = angular; + } + + void applyTorque(const btVector3& torque) + { + m_totalTorque += torque; + } + + void applyForce(const btVector3& force, const btVector3& rel_pos) + { + applyCentralForce(force); + applyTorque(rel_pos.cross(force)); + } + + void applyCentralImpulse(const btVector3& impulse) + { + m_linearVelocity += impulse * m_inverseMass; + } + + void applyTorqueImpulse(const btVector3& torque) + { + m_angularVelocity += m_invInertiaTensorWorld * torque; + } + + void applyImpulse(const btVector3& impulse, const btVector3& rel_pos) + { + if (m_inverseMass != btScalar(0.)) + { + applyCentralImpulse(impulse); + if (m_angularFactor) + { + applyTorqueImpulse(rel_pos.cross(impulse)*m_angularFactor); + } + } + } + + //Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position + SIMD_FORCE_INLINE void internalApplyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude) + { + if (m_inverseMass != btScalar(0.)) + { + m_linearVelocity += linearComponent*impulseMagnitude; + if (m_angularFactor) + { + m_angularVelocity += angularComponent*impulseMagnitude*m_angularFactor; + } + } + } + + void clearForces() + { + m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0)); + m_totalTorque.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0)); + } + + void updateInertiaTensor(); + + const btPoint3& getCenterOfMassPosition() const { + return m_worldTransform.getOrigin(); + } + btQuaternion getOrientation() const; + + const btTransform& getCenterOfMassTransform() const { + return m_worldTransform; + } + const btVector3& getLinearVelocity() const { + return m_linearVelocity; + } + const btVector3& getAngularVelocity() const { + return m_angularVelocity; + } + + + inline void setLinearVelocity(const btVector3& lin_vel) + { + assert (m_collisionFlags != btCollisionObject::CF_STATIC_OBJECT); + m_linearVelocity = lin_vel; + } + + inline void setAngularVelocity(const btVector3& ang_vel) { + assert (m_collisionFlags != btCollisionObject::CF_STATIC_OBJECT); + { + m_angularVelocity = ang_vel; + } + } + + btVector3 getVelocityInLocalPoint(const btVector3& rel_pos) const + { + //we also calculate lin/ang velocity for kinematic objects + return m_linearVelocity + m_angularVelocity.cross(rel_pos); + + //for kinematic objects, we could also use use: + // return (m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep; + } + + void translate(const btVector3& v) + { + m_worldTransform.getOrigin() += v; + } + + + void getAabb(btVector3& aabbMin,btVector3& aabbMax) const; + + + + + + SIMD_FORCE_INLINE btScalar computeImpulseDenominator(const btPoint3& pos, const btVector3& normal) const + { + btVector3 r0 = pos - getCenterOfMassPosition(); + + btVector3 c0 = (r0).cross(normal); + + btVector3 vec = (c0 * getInvInertiaTensorWorld()).cross(r0); + + return m_inverseMass + normal.dot(vec); + + } + + SIMD_FORCE_INLINE btScalar computeAngularImpulseDenominator(const btVector3& axis) const + { + btVector3 vec = axis * getInvInertiaTensorWorld(); + return axis.dot(vec); + } + + SIMD_FORCE_INLINE void updateDeactivation(btScalar timeStep) + { + if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == DISABLE_DEACTIVATION)) + return; + + if ((getLinearVelocity().length2() < m_linearSleepingThreshold*m_linearSleepingThreshold) && + (getAngularVelocity().length2() < m_angularSleepingThreshold*m_angularSleepingThreshold)) + { + m_deactivationTime += timeStep; + } else + { + m_deactivationTime=btScalar(0.); + setActivationState(0); + } + + } + + SIMD_FORCE_INLINE bool wantsSleeping() + { + + if (getActivationState() == DISABLE_DEACTIVATION) + return false; + + //disable deactivation + if (gDisableDeactivation || (gDeactivationTime == btScalar(0.))) + return false; + + if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == WANTS_DEACTIVATION)) + return true; + + if (m_deactivationTime> gDeactivationTime) + { + return true; + } + return false; + } + + + + const btBroadphaseProxy* getBroadphaseProxy() const + { + return m_broadphaseHandle; + } + btBroadphaseProxy* getBroadphaseProxy() + { + return m_broadphaseHandle; + } + void setNewBroadphaseProxy(btBroadphaseProxy* broadphaseProxy) + { + m_broadphaseHandle = broadphaseProxy; + } + + //btMotionState allows to automatic synchronize the world transform for active objects + btMotionState* getMotionState() + { + return m_optionalMotionState; + } + const btMotionState* getMotionState() const + { + return m_optionalMotionState; + } + void setMotionState(btMotionState* motionState) + { + m_optionalMotionState = motionState; + if (m_optionalMotionState) + motionState->getWorldTransform(m_worldTransform); + } + + //for experimental overriding of friction/contact solver func + int m_contactSolverType; + int m_frictionSolverType; + + void setAngularFactor(btScalar angFac) + { + m_angularFactor = angFac; + } + btScalar getAngularFactor() const + { + return m_angularFactor; + } + + //is this rigidbody added to a btCollisionWorld/btDynamicsWorld/btBroadphase? + bool isInWorld() const + { + return (getBroadphaseProxy() != 0); + } + + virtual bool checkCollideWithOverride(btCollisionObject* co); + + void addConstraintRef(btTypedConstraint* c); + void removeConstraintRef(btTypedConstraint* c); + + btTypedConstraint* getConstraintRef(int index) + { + return m_constraintRefs[index]; + } + + int getNumConstraintRefs() + { + return m_constraintRefs.size(); + } + + + int m_debugBodyId; +}; + + + +#endif + diff --git a/src/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp b/src/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp new file mode 100644 index 000000000..3bd7671ee --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp @@ -0,0 +1,217 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btSimpleDynamicsWorld.h" +#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" +#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h" +#include "BulletCollision/CollisionShapes/btCollisionShape.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h" +#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h" + + +/* + Make sure this dummy function never changes so that it + can be used by probes that are checking whether the + library is actually installed. +*/ +extern "C" void btBulletDynamicsProbe () {} + + + + +btSimpleDynamicsWorld::btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration) +:btDynamicsWorld(dispatcher,pairCache,collisionConfiguration), +m_constraintSolver(constraintSolver), +m_ownsConstraintSolver(false), +m_debugDrawer(0), +m_gravity(0,0,-10) +{ + +} + + +btSimpleDynamicsWorld::~btSimpleDynamicsWorld() +{ + if (m_ownsConstraintSolver) + btAlignedFree( m_constraintSolver); +} + +int btSimpleDynamicsWorld::stepSimulation( btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep) +{ + (void)fixedTimeStep; + (void)maxSubSteps; + + + ///apply gravity, predict motion + predictUnconstraintMotion(timeStep); + + btDispatcherInfo& dispatchInfo = getDispatchInfo(); + dispatchInfo.m_timeStep = timeStep; + dispatchInfo.m_stepCount = 0; + dispatchInfo.m_debugDraw = getDebugDrawer(); + + ///perform collision detection + performDiscreteCollisionDetection(); + + ///solve contact constraints + int numManifolds = m_dispatcher1->getNumManifolds(); + if (numManifolds) + { + btPersistentManifold** manifoldPtr = ((btCollisionDispatcher*)m_dispatcher1)->getInternalManifoldPointer(); + + btContactSolverInfo infoGlobal; + infoGlobal.m_timeStep = timeStep; + m_constraintSolver->prepareSolve(0,numManifolds); + m_constraintSolver->solveGroup(0,0,manifoldPtr, numManifolds,0,0,infoGlobal,m_debugDrawer, m_stackAlloc,m_dispatcher1); + m_constraintSolver->allSolved(infoGlobal,m_debugDrawer, m_stackAlloc); + } + + ///integrate transforms + integrateTransforms(timeStep); + + updateAabbs(); + + synchronizeMotionStates(); + + return 1; + +} + + +void btSimpleDynamicsWorld::setGravity(const btVector3& gravity) +{ + m_gravity = gravity; + for ( int i=0;isetGravity(gravity); + } + } +} + +void btSimpleDynamicsWorld::removeRigidBody(btRigidBody* body) +{ + removeCollisionObject(body); +} + +void btSimpleDynamicsWorld::addRigidBody(btRigidBody* body) +{ + body->setGravity(m_gravity); + + if (body->getCollisionShape()) + { + addCollisionObject(body); + } +} + +void btSimpleDynamicsWorld::updateAabbs() +{ + btTransform predictedTrans; + for ( int i=0;iisActive() && (!body->isStaticObject())) + { + btPoint3 minAabb,maxAabb; + colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb); + btBroadphaseInterface* bp = getBroadphase(); + bp->setAabb(body->getBroadphaseHandle(),minAabb,maxAabb, m_dispatcher1); + } + } + } +} + +void btSimpleDynamicsWorld::integrateTransforms(btScalar timeStep) +{ + btTransform predictedTrans; + for ( int i=0;iisActive() && (!body->isStaticObject())) + { + body->predictIntegratedTransform(timeStep, predictedTrans); + body->proceedToTransform( predictedTrans); + } + } + } +} + + + +void btSimpleDynamicsWorld::predictUnconstraintMotion(btScalar timeStep) +{ + for ( int i=0;iisStaticObject()) + { + if (body->isActive()) + { + body->applyForces( timeStep); + body->integrateVelocities( timeStep); + body->predictIntegratedTransform(timeStep,body->getInterpolationWorldTransform()); + } + } + } + } +} + + +void btSimpleDynamicsWorld::synchronizeMotionStates() +{ + //todo: iterate over awake simulation islands! + for ( int i=0;igetMotionState()) + { + if (body->getActivationState() != ISLAND_SLEEPING) + { + body->getMotionState()->setWorldTransform(body->getWorldTransform()); + } + } + } + +} + + +void btSimpleDynamicsWorld::setConstraintSolver(btConstraintSolver* solver) +{ + if (m_ownsConstraintSolver) + { + btAlignedFree(m_constraintSolver); + } + m_ownsConstraintSolver = false; + m_constraintSolver = solver; +} + +btConstraintSolver* btSimpleDynamicsWorld::getConstraintSolver() +{ + return m_constraintSolver; +} diff --git a/src/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h b/src/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h new file mode 100644 index 000000000..4e38f74a7 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h @@ -0,0 +1,86 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_SIMPLE_DYNAMICS_WORLD_H +#define BT_SIMPLE_DYNAMICS_WORLD_H + +#include "btDynamicsWorld.h" + +class btDispatcher; +class btOverlappingPairCache; +class btConstraintSolver; + +///btSimpleDynamicsWorld serves as unit-test and to verify more complicated and optimized dynamics worlds. +///Please use btDiscreteDynamicsWorld instead (or btContinuousDynamicsWorld once it is finished). +class btSimpleDynamicsWorld : public btDynamicsWorld +{ +protected: + + btConstraintSolver* m_constraintSolver; + + bool m_ownsConstraintSolver; + + btIDebugDraw* m_debugDrawer; + + void predictUnconstraintMotion(btScalar timeStep); + + void integrateTransforms(btScalar timeStep); + + btVector3 m_gravity; + +public: + + + + ///this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver + btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration); + + virtual ~btSimpleDynamicsWorld(); + + ///maxSubSteps/fixedTimeStep for interpolation is currently ignored for btSimpleDynamicsWorld, use btDiscreteDynamicsWorld instead + virtual int stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.)); + + virtual void setDebugDrawer(btIDebugDraw* debugDrawer) + { + m_debugDrawer = debugDrawer; + }; + + virtual btIDebugDraw* getDebugDrawer() + { + return m_debugDrawer; + } + + virtual void setGravity(const btVector3& gravity); + + virtual void addRigidBody(btRigidBody* body); + + virtual void removeRigidBody(btRigidBody* body); + + virtual void updateAabbs(); + + void synchronizeMotionStates(); + + virtual void setConstraintSolver(btConstraintSolver* solver); + + virtual btConstraintSolver* getConstraintSolver(); + + virtual btDynamicsWorldType getWorldType() const + { + return BT_SIMPLE_DYNAMICS_WORLD; + } + +}; + +#endif //BT_SIMPLE_DYNAMICS_WORLD_H diff --git a/src/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp b/src/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp new file mode 100644 index 000000000..90e4e9962 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp @@ -0,0 +1,738 @@ +/* + * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/ + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies. + * Erwin Coumans makes no representations about the suitability + * of this software for any purpose. + * It is provided "as is" without express or implied warranty. +*/ + +#include "LinearMath/btVector3.h" +#include "btRaycastVehicle.h" + +#include "BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h" +#include "BulletDynamics/ConstraintSolver/btJacobianEntry.h" +#include "LinearMath/btQuaternion.h" +#include "BulletDynamics/Dynamics/btDynamicsWorld.h" +#include "btVehicleRaycaster.h" +#include "btWheelInfo.h" +#include "LinearMath/btMinMax.h" + + +#include "BulletDynamics/ConstraintSolver/btContactConstraint.h" + + + +static btRigidBody s_fixedObject( 0,0,0); + +btRaycastVehicle::btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis, btVehicleRaycaster* raycaster ) +: btTypedConstraint(VEHICLE_CONSTRAINT_TYPE), +m_vehicleRaycaster(raycaster), +m_pitchControl(btScalar(0.)) +{ + m_chassisBody = chassis; + m_indexRightAxis = 0; + m_indexUpAxis = 2; + m_indexForwardAxis = 1; + defaultInit(tuning); +} + + +void btRaycastVehicle::defaultInit(const btVehicleTuning& tuning) +{ + (void)tuning; + m_currentVehicleSpeedKmHour = btScalar(0.); + m_steeringValue = btScalar(0.); + +} + + + +btRaycastVehicle::~btRaycastVehicle() +{ +} + + +// +// basically most of the code is general for 2 or 4 wheel vehicles, but some of it needs to be reviewed +// +btWheelInfo& btRaycastVehicle::addWheel( const btVector3& connectionPointCS, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS, btScalar suspensionRestLength, btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel) +{ + + btWheelInfoConstructionInfo ci; + + ci.m_chassisConnectionCS = connectionPointCS; + ci.m_wheelDirectionCS = wheelDirectionCS0; + ci.m_wheelAxleCS = wheelAxleCS; + ci.m_suspensionRestLength = suspensionRestLength; + ci.m_wheelRadius = wheelRadius; + ci.m_suspensionStiffness = tuning.m_suspensionStiffness; + ci.m_wheelsDampingCompression = tuning.m_suspensionCompression; + ci.m_wheelsDampingRelaxation = tuning.m_suspensionDamping; + ci.m_frictionSlip = tuning.m_frictionSlip; + ci.m_bIsFrontWheel = isFrontWheel; + ci.m_maxSuspensionTravelCm = tuning.m_maxSuspensionTravelCm; + + m_wheelInfo.push_back( btWheelInfo(ci)); + + btWheelInfo& wheel = m_wheelInfo[getNumWheels()-1]; + + updateWheelTransformsWS( wheel , false ); + updateWheelTransform(getNumWheels()-1,false); + return wheel; +} + + + + +const btTransform& btRaycastVehicle::getWheelTransformWS( int wheelIndex ) const +{ + assert(wheelIndex < getNumWheels()); + const btWheelInfo& wheel = m_wheelInfo[wheelIndex]; + return wheel.m_worldTransform; + +} + +void btRaycastVehicle::updateWheelTransform( int wheelIndex , bool interpolatedTransform) +{ + + btWheelInfo& wheel = m_wheelInfo[ wheelIndex ]; + updateWheelTransformsWS(wheel,interpolatedTransform); + btVector3 up = -wheel.m_raycastInfo.m_wheelDirectionWS; + const btVector3& right = wheel.m_raycastInfo.m_wheelAxleWS; + btVector3 fwd = up.cross(right); + fwd = fwd.normalize(); +// up = right.cross(fwd); +// up.normalize(); + + //rotate around steering over de wheelAxleWS + btScalar steering = wheel.m_steering; + + btQuaternion steeringOrn(up,steering);//wheel.m_steering); + btMatrix3x3 steeringMat(steeringOrn); + + btQuaternion rotatingOrn(right,-wheel.m_rotation); + btMatrix3x3 rotatingMat(rotatingOrn); + + btMatrix3x3 basis2( + right[0],fwd[0],up[0], + right[1],fwd[1],up[1], + right[2],fwd[2],up[2] + ); + + wheel.m_worldTransform.setBasis(steeringMat * rotatingMat * basis2); + wheel.m_worldTransform.setOrigin( + wheel.m_raycastInfo.m_hardPointWS + wheel.m_raycastInfo.m_wheelDirectionWS * wheel.m_raycastInfo.m_suspensionLength + ); +} + +void btRaycastVehicle::resetSuspension() +{ + + int i; + for (i=0;igetMotionState())) + { + getRigidBody()->getMotionState()->getWorldTransform(chassisTrans); + } + + wheel.m_raycastInfo.m_hardPointWS = chassisTrans( wheel.m_chassisConnectionPointCS ); + wheel.m_raycastInfo.m_wheelDirectionWS = chassisTrans.getBasis() * wheel.m_wheelDirectionCS ; + wheel.m_raycastInfo.m_wheelAxleWS = chassisTrans.getBasis() * wheel.m_wheelAxleCS; +} + +btScalar btRaycastVehicle::rayCast(btWheelInfo& wheel) +{ + updateWheelTransformsWS( wheel,false); + + + btScalar depth = -1; + + btScalar raylen = wheel.getSuspensionRestLength()+wheel.m_wheelsRadius; + + btVector3 rayvector = wheel.m_raycastInfo.m_wheelDirectionWS * (raylen); + const btVector3& source = wheel.m_raycastInfo.m_hardPointWS; + wheel.m_raycastInfo.m_contactPointWS = source + rayvector; + const btVector3& target = wheel.m_raycastInfo.m_contactPointWS; + + btScalar param = btScalar(0.); + + btVehicleRaycaster::btVehicleRaycasterResult rayResults; + + assert(m_vehicleRaycaster); + + void* object = m_vehicleRaycaster->castRay(source,target,rayResults); + + wheel.m_raycastInfo.m_groundObject = 0; + + if (object) + { + param = rayResults.m_distFraction; + depth = raylen * rayResults.m_distFraction; + wheel.m_raycastInfo.m_contactNormalWS = rayResults.m_hitNormalInWorld; + wheel.m_raycastInfo.m_isInContact = true; + + wheel.m_raycastInfo.m_groundObject = &s_fixedObject;//todo for driving on dynamic/movable objects!; + //wheel.m_raycastInfo.m_groundObject = object; + + + btScalar hitDistance = param*raylen; + wheel.m_raycastInfo.m_suspensionLength = hitDistance - wheel.m_wheelsRadius; + //clamp on max suspension travel + + btScalar minSuspensionLength = wheel.getSuspensionRestLength() - wheel.m_maxSuspensionTravelCm*btScalar(0.01); + btScalar maxSuspensionLength = wheel.getSuspensionRestLength()+ wheel.m_maxSuspensionTravelCm*btScalar(0.01); + if (wheel.m_raycastInfo.m_suspensionLength < minSuspensionLength) + { + wheel.m_raycastInfo.m_suspensionLength = minSuspensionLength; + } + if (wheel.m_raycastInfo.m_suspensionLength > maxSuspensionLength) + { + wheel.m_raycastInfo.m_suspensionLength = maxSuspensionLength; + } + + wheel.m_raycastInfo.m_contactPointWS = rayResults.m_hitPointInWorld; + + btScalar denominator= wheel.m_raycastInfo.m_contactNormalWS.dot( wheel.m_raycastInfo.m_wheelDirectionWS ); + + btVector3 chassis_velocity_at_contactPoint; + btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS-getRigidBody()->getCenterOfMassPosition(); + + chassis_velocity_at_contactPoint = getRigidBody()->getVelocityInLocalPoint(relpos); + + btScalar projVel = wheel.m_raycastInfo.m_contactNormalWS.dot( chassis_velocity_at_contactPoint ); + + if ( denominator >= btScalar(-0.1)) + { + wheel.m_suspensionRelativeVelocity = btScalar(0.0); + wheel.m_clippedInvContactDotSuspension = btScalar(1.0) / btScalar(0.1); + } + else + { + btScalar inv = btScalar(-1.) / denominator; + wheel.m_suspensionRelativeVelocity = projVel * inv; + wheel.m_clippedInvContactDotSuspension = inv; + } + + } else + { + //put wheel info as in rest position + wheel.m_raycastInfo.m_suspensionLength = wheel.getSuspensionRestLength(); + wheel.m_suspensionRelativeVelocity = btScalar(0.0); + wheel.m_raycastInfo.m_contactNormalWS = - wheel.m_raycastInfo.m_wheelDirectionWS; + wheel.m_clippedInvContactDotSuspension = btScalar(1.0); + } + + return depth; +} + + +const btTransform& btRaycastVehicle::getChassisWorldTransform() const +{ + /*if (getRigidBody()->getMotionState()) + { + btTransform chassisWorldTrans; + getRigidBody()->getMotionState()->getWorldTransform(chassisWorldTrans); + return chassisWorldTrans; + } + */ + + + return getRigidBody()->getCenterOfMassTransform(); +} + + +void btRaycastVehicle::updateVehicle( btScalar step ) +{ + { + for (int i=0;igetLinearVelocity().length(); + + const btTransform& chassisTrans = getChassisWorldTransform(); + + btVector3 forwardW ( + chassisTrans.getBasis()[0][m_indexForwardAxis], + chassisTrans.getBasis()[1][m_indexForwardAxis], + chassisTrans.getBasis()[2][m_indexForwardAxis]); + + if (forwardW.dot(getRigidBody()->getLinearVelocity()) < btScalar(0.)) + { + m_currentVehicleSpeedKmHour *= btScalar(-1.); + } + + // + // simulate suspension + // + + int i=0; + for (i=0;i gMaxSuspensionForce) + { + suspensionForce = gMaxSuspensionForce; + } + btVector3 impulse = wheel.m_raycastInfo.m_contactNormalWS * suspensionForce * step; + btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS - getRigidBody()->getCenterOfMassPosition(); + + getRigidBody()->applyImpulse(impulse, relpos); + + } + + + + updateFriction( step); + + + for (i=0;igetCenterOfMassPosition(); + btVector3 vel = getRigidBody()->getVelocityInLocalPoint( relpos ); + + if (wheel.m_raycastInfo.m_isInContact) + { + const btTransform& chassisWorldTransform = getChassisWorldTransform(); + + btVector3 fwd ( + chassisWorldTransform.getBasis()[0][m_indexForwardAxis], + chassisWorldTransform.getBasis()[1][m_indexForwardAxis], + chassisWorldTransform.getBasis()[2][m_indexForwardAxis]); + + btScalar proj = fwd.dot(wheel.m_raycastInfo.m_contactNormalWS); + fwd -= wheel.m_raycastInfo.m_contactNormalWS * proj; + + btScalar proj2 = fwd.dot(vel); + + wheel.m_deltaRotation = (proj2 * step) / (wheel.m_wheelsRadius); + wheel.m_rotation += wheel.m_deltaRotation; + + } else + { + wheel.m_rotation += wheel.m_deltaRotation; + } + + wheel.m_deltaRotation *= btScalar(0.99);//damping of rotation when not in contact + + } + + + +} + + +void btRaycastVehicle::setSteeringValue(btScalar steering,int wheel) +{ + assert(wheel>=0 && wheel < getNumWheels()); + + btWheelInfo& wheelInfo = getWheelInfo(wheel); + wheelInfo.m_steering = steering; +} + + + +btScalar btRaycastVehicle::getSteeringValue(int wheel) const +{ + return getWheelInfo(wheel).m_steering; +} + + +void btRaycastVehicle::applyEngineForce(btScalar force, int wheel) +{ + assert(wheel>=0 && wheel < getNumWheels()); + btWheelInfo& wheelInfo = getWheelInfo(wheel); + wheelInfo.m_engineForce = force; +} + + +const btWheelInfo& btRaycastVehicle::getWheelInfo(int index) const +{ + btAssert((index >= 0) && (index < getNumWheels())); + + return m_wheelInfo[index]; +} + +btWheelInfo& btRaycastVehicle::getWheelInfo(int index) +{ + btAssert((index >= 0) && (index < getNumWheels())); + + return m_wheelInfo[index]; +} + +void btRaycastVehicle::setBrake(btScalar brake,int wheelIndex) +{ + btAssert((wheelIndex >= 0) && (wheelIndex < getNumWheels())); + getWheelInfo(wheelIndex).m_brake = brake; +} + + +void btRaycastVehicle::updateSuspension(btScalar deltaTime) +{ + (void)deltaTime; + + btScalar chassisMass = btScalar(1.) / m_chassisBody->getInvMass(); + + for (int w_it=0; w_itcomputeImpulseDenominator(frictionPosWorld,frictionDirectionWorld); + btScalar denom1 = body1->computeImpulseDenominator(frictionPosWorld,frictionDirectionWorld); + btScalar relaxation = 1.f; + m_jacDiagABInv = relaxation/(denom0+denom1); + } + + + +}; + +btScalar calcRollingFriction(btWheelContactPoint& contactPoint) +{ + + btScalar j1=0.f; + + const btVector3& contactPosWorld = contactPoint.m_frictionPositionWorld; + + btVector3 rel_pos1 = contactPosWorld - contactPoint.m_body0->getCenterOfMassPosition(); + btVector3 rel_pos2 = contactPosWorld - contactPoint.m_body1->getCenterOfMassPosition(); + + btScalar maxImpulse = contactPoint.m_maxImpulse; + + btVector3 vel1 = contactPoint.m_body0->getVelocityInLocalPoint(rel_pos1); + btVector3 vel2 = contactPoint.m_body1->getVelocityInLocalPoint(rel_pos2); + btVector3 vel = vel1 - vel2; + + btScalar vrel = contactPoint.m_frictionDirectionWorld.dot(vel); + + // calculate j that moves us to zero relative velocity + j1 = -vrel * contactPoint.m_jacDiagABInv; + btSetMin(j1, maxImpulse); + btSetMax(j1, -maxImpulse); + + return j1; +} + + + + +btScalar sideFrictionStiffness2 = btScalar(1.0); +void btRaycastVehicle::updateFriction(btScalar timeStep) +{ + + //calculate the impulse, so that the wheels don't move sidewards + int numWheel = getNumWheels(); + if (!numWheel) + return; + + + void* mem = btAlignedAlloc(numWheel*sizeof(btVector3),16); + btVector3* forwardWS = new (mem)btVector3[numWheel]; + mem = btAlignedAlloc(numWheel*sizeof(btVector3),16); + btVector3* axle = new (mem)btVector3[numWheel]; + mem = btAlignedAlloc(numWheel*sizeof(btScalar),16); + btScalar* forwardImpulse = new (mem)btScalar[numWheel]; + mem = btAlignedAlloc(numWheel*sizeof(btScalar),16); + btScalar* sideImpulse = new(mem) btScalar[numWheel]; + + int numWheelsOnGround = 0; + + + //collapse all those loops into one! + for (int i=0;i maximpSquared) + { + sliding = true; + + btScalar factor = maximp / btSqrt(impulseSquared); + + m_wheelInfo[wheel].m_skidInfo *= factor; + } + } + + } + } + + + + + if (sliding) + { + for (int wheel = 0;wheel < getNumWheels(); wheel++) + { + if (sideImpulse[wheel] != btScalar(0.)) + { + if (m_wheelInfo[wheel].m_skidInfo< btScalar(1.)) + { + forwardImpulse[wheel] *= m_wheelInfo[wheel].m_skidInfo; + sideImpulse[wheel] *= m_wheelInfo[wheel].m_skidInfo; + } + } + } + } + + // apply the impulses + { + for (int wheel = 0;wheelgetCenterOfMassPosition(); + + if (forwardImpulse[wheel] != btScalar(0.)) + { + m_chassisBody->applyImpulse(forwardWS[wheel]*(forwardImpulse[wheel]),rel_pos); + } + if (sideImpulse[wheel] != btScalar(0.)) + { + class btRigidBody* groundObject = (class btRigidBody*) m_wheelInfo[wheel].m_raycastInfo.m_groundObject; + + btVector3 rel_pos2 = wheelInfo.m_raycastInfo.m_contactPointWS - + groundObject->getCenterOfMassPosition(); + + + btVector3 sideImp = axle[wheel] * sideImpulse[wheel]; + + rel_pos[2] *= wheelInfo.m_rollInfluence; + m_chassisBody->applyImpulse(sideImp,rel_pos); + + //apply friction impulse on the ground + groundObject->applyImpulse(-sideImp,rel_pos2); + } + } + } + + btAlignedFree(forwardWS); + btAlignedFree(axle); + btAlignedFree(forwardImpulse); + btAlignedFree(sideImpulse); +} + + +void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) +{ +// RayResultCallback& resultCallback; + + btCollisionWorld::ClosestRayResultCallback rayCallback(from,to); + + m_dynamicsWorld->rayTest(from, to, rayCallback); + + if (rayCallback.HasHit()) + { + + btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject); + if (body) + { + result.m_hitPointInWorld = rayCallback.m_hitPointWorld; + result.m_hitNormalInWorld = rayCallback.m_hitNormalWorld; + result.m_hitNormalInWorld.normalize(); + result.m_distFraction = rayCallback.m_closestHitFraction; + return body; + } + } + return 0; +} diff --git a/src/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.h b/src/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.h new file mode 100644 index 000000000..a84b185e9 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.h @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/ + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies. + * Erwin Coumans makes no representations about the suitability + * of this software for any purpose. + * It is provided "as is" without express or implied warranty. +*/ +#ifndef RAYCASTVEHICLE_H +#define RAYCASTVEHICLE_H + +#include "BulletDynamics/Dynamics/btRigidBody.h" +#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h" +#include "btVehicleRaycaster.h" +class btDynamicsWorld; +#include "LinearMath/btAlignedObjectArray.h" +#include "btWheelInfo.h" + +class btVehicleTuning; + +///rayCast vehicle, very special constraint that turn a rigidbody into a vehicle. +class btRaycastVehicle : public btTypedConstraint +{ +public: + class btVehicleTuning + { + public: + + btVehicleTuning() + :m_suspensionStiffness(btScalar(5.88)), + m_suspensionCompression(btScalar(0.83)), + m_suspensionDamping(btScalar(0.88)), + m_maxSuspensionTravelCm(btScalar(500.)), + m_frictionSlip(btScalar(10.5)) + { + } + btScalar m_suspensionStiffness; + btScalar m_suspensionCompression; + btScalar m_suspensionDamping; + btScalar m_maxSuspensionTravelCm; + btScalar m_frictionSlip; + + }; +private: + + btScalar m_tau; + btScalar m_damping; + btVehicleRaycaster* m_vehicleRaycaster; + btScalar m_pitchControl; + btScalar m_steeringValue; + btScalar m_currentVehicleSpeedKmHour; + + btRigidBody* m_chassisBody; + + int m_indexRightAxis; + int m_indexUpAxis; + int m_indexForwardAxis; + + void defaultInit(const btVehicleTuning& tuning); + +public: + + //constructor to create a car from an existing rigidbody + btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis, btVehicleRaycaster* raycaster ); + + virtual ~btRaycastVehicle() ; + + + const btTransform& getChassisWorldTransform() const; + + btScalar rayCast(btWheelInfo& wheel); + + virtual void updateVehicle(btScalar step); + + void resetSuspension(); + + btScalar getSteeringValue(int wheel) const; + + void setSteeringValue(btScalar steering,int wheel); + + + void applyEngineForce(btScalar force, int wheel); + + const btTransform& getWheelTransformWS( int wheelIndex ) const; + + void updateWheelTransform( int wheelIndex, bool interpolatedTransform = true ); + + void setRaycastWheelInfo( int wheelIndex , bool isInContact, const btVector3& hitPoint, const btVector3& hitNormal,btScalar depth); + + btWheelInfo& addWheel( const btVector3& connectionPointCS0, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS,btScalar suspensionRestLength,btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel); + + inline int getNumWheels() const { + return int (m_wheelInfo.size()); + } + + btAlignedObjectArray m_wheelInfo; + + + const btWheelInfo& getWheelInfo(int index) const; + + btWheelInfo& getWheelInfo(int index); + + void updateWheelTransformsWS(btWheelInfo& wheel , bool interpolatedTransform = true); + + + void setBrake(btScalar brake,int wheelIndex); + + void setPitchControl(btScalar pitch) + { + m_pitchControl = pitch; + } + + void updateSuspension(btScalar deltaTime); + + void updateFriction(btScalar timeStep); + + + + inline btRigidBody* getRigidBody() + { + return m_chassisBody; + } + + const btRigidBody* getRigidBody() const + { + return m_chassisBody; + } + + inline int getRightAxis() const + { + return m_indexRightAxis; + } + inline int getUpAxis() const + { + return m_indexUpAxis; + } + + inline int getForwardAxis() const + { + return m_indexForwardAxis; + } + + + ///Worldspace forward vector + btVector3 getForwardVector() const + { + const btTransform& chassisTrans = getChassisWorldTransform(); + + btVector3 forwardW ( + chassisTrans.getBasis()[0][m_indexForwardAxis], + chassisTrans.getBasis()[1][m_indexForwardAxis], + chassisTrans.getBasis()[2][m_indexForwardAxis]); + + return forwardW; + } + + ///Velocity of vehicle (positive if velocity vector has same direction as foward vector) + btScalar getCurrentSpeedKmHour() const + { + return m_currentVehicleSpeedKmHour; + } + + virtual void setCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) + { + m_indexRightAxis = rightIndex; + m_indexUpAxis = upIndex; + m_indexForwardAxis = forwardIndex; + } + + virtual void buildJacobian() + { + //not yet + } + + virtual void solveConstraint(btScalar timeStep) + { + (void)timeStep; + //not yet + } + + +}; + +class btDefaultVehicleRaycaster : public btVehicleRaycaster +{ + btDynamicsWorld* m_dynamicsWorld; +public: + btDefaultVehicleRaycaster(btDynamicsWorld* world) + :m_dynamicsWorld(world) + { + } + + virtual void* castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result); + +}; + + +#endif //RAYCASTVEHICLE_H + diff --git a/src/bullet/src/BulletDynamics/Vehicle/btVehicleRaycaster.h b/src/bullet/src/BulletDynamics/Vehicle/btVehicleRaycaster.h new file mode 100644 index 000000000..5112ce6d4 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Vehicle/btVehicleRaycaster.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/ + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies. + * Erwin Coumans makes no representations about the suitability + * of this software for any purpose. + * It is provided "as is" without express or implied warranty. +*/ +#ifndef VEHICLE_RAYCASTER_H +#define VEHICLE_RAYCASTER_H + +#include "LinearMath/btVector3.h" + +/// btVehicleRaycaster is provides interface for between vehicle simulation and raycasting +struct btVehicleRaycaster +{ +virtual ~btVehicleRaycaster() +{ +} + struct btVehicleRaycasterResult + { + btVehicleRaycasterResult() :m_distFraction(btScalar(-1.)){}; + btVector3 m_hitPointInWorld; + btVector3 m_hitNormalInWorld; + btScalar m_distFraction; + }; + + virtual void* castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) = 0; + +}; + +#endif //VEHICLE_RAYCASTER_H + diff --git a/src/bullet/src/BulletDynamics/Vehicle/btWheelInfo.cpp b/src/bullet/src/BulletDynamics/Vehicle/btWheelInfo.cpp new file mode 100644 index 000000000..e51c0a5f1 --- /dev/null +++ b/src/bullet/src/BulletDynamics/Vehicle/btWheelInfo.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/ + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies. + * Erwin Coumans makes no representations about the suitability + * of this software for any purpose. + * It is provided "as is" without express or implied warranty. +*/ +#include "btWheelInfo.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" // for pointvelocity + + +btScalar btWheelInfo::getSuspensionRestLength() const +{ + + return m_suspensionRestLength1; + +} + +void btWheelInfo::updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo) +{ + (void)raycastInfo; + + + if (m_raycastInfo.m_isInContact) + + { + btScalar project= m_raycastInfo.m_contactNormalWS.dot( m_raycastInfo.m_wheelDirectionWS ); + btVector3 chassis_velocity_at_contactPoint; + btVector3 relpos = m_raycastInfo.m_contactPointWS - chassis.getCenterOfMassPosition(); + chassis_velocity_at_contactPoint = chassis.getVelocityInLocalPoint( relpos ); + btScalar projVel = m_raycastInfo.m_contactNormalWS.dot( chassis_velocity_at_contactPoint ); + if ( project >= btScalar(-0.1)) + { + m_suspensionRelativeVelocity = btScalar(0.0); + m_clippedInvContactDotSuspension = btScalar(1.0) / btScalar(0.1); + } + else + { + btScalar inv = btScalar(-1.) / project; + m_suspensionRelativeVelocity = projVel * inv; + m_clippedInvContactDotSuspension = inv; + } + + } + + else // Not in contact : position wheel in a nice (rest length) position + { + m_raycastInfo.m_suspensionLength = this->getSuspensionRestLength(); + m_suspensionRelativeVelocity = btScalar(0.0); + m_raycastInfo.m_contactNormalWS = -m_raycastInfo.m_wheelDirectionWS; + m_clippedInvContactDotSuspension = btScalar(1.0); + } +} diff --git a/src/bullet/src/BulletDynamics/Vehicle/btWheelInfo.h b/src/bullet/src/BulletDynamics/Vehicle/btWheelInfo.h new file mode 100644 index 000000000..ac2729f4f --- /dev/null +++ b/src/bullet/src/BulletDynamics/Vehicle/btWheelInfo.h @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/ + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies. + * Erwin Coumans makes no representations about the suitability + * of this software for any purpose. + * It is provided "as is" without express or implied warranty. +*/ +#ifndef WHEEL_INFO_H +#define WHEEL_INFO_H + +#include "LinearMath/btVector3.h" +#include "LinearMath/btTransform.h" + +class btRigidBody; + +struct btWheelInfoConstructionInfo +{ + btVector3 m_chassisConnectionCS; + btVector3 m_wheelDirectionCS; + btVector3 m_wheelAxleCS; + btScalar m_suspensionRestLength; + btScalar m_maxSuspensionTravelCm; + btScalar m_wheelRadius; + + btScalar m_suspensionStiffness; + btScalar m_wheelsDampingCompression; + btScalar m_wheelsDampingRelaxation; + btScalar m_frictionSlip; + bool m_bIsFrontWheel; + +}; + +/// btWheelInfo contains information per wheel about friction and suspension. +struct btWheelInfo +{ + struct RaycastInfo + { + //set by raycaster + btVector3 m_contactNormalWS;//contactnormal + btVector3 m_contactPointWS;//raycast hitpoint + btScalar m_suspensionLength; + btVector3 m_hardPointWS;//raycast starting point + btVector3 m_wheelDirectionWS; //direction in worldspace + btVector3 m_wheelAxleWS; // axle in worldspace + bool m_isInContact; + void* m_groundObject; //could be general void* ptr + }; + + RaycastInfo m_raycastInfo; + + btTransform m_worldTransform; + + btVector3 m_chassisConnectionPointCS; //const + btVector3 m_wheelDirectionCS;//const + btVector3 m_wheelAxleCS; // const or modified by steering + btScalar m_suspensionRestLength1;//const + btScalar m_maxSuspensionTravelCm; + btScalar getSuspensionRestLength() const; + btScalar m_wheelsRadius;//const + btScalar m_suspensionStiffness;//const + btScalar m_wheelsDampingCompression;//const + btScalar m_wheelsDampingRelaxation;//const + btScalar m_frictionSlip; + btScalar m_steering; + btScalar m_rotation; + btScalar m_deltaRotation; + btScalar m_rollInfluence; + + btScalar m_engineForce; + + btScalar m_brake; + + bool m_bIsFrontWheel; + + void* m_clientInfo;//can be used to store pointer to sync transforms... + + btWheelInfo(btWheelInfoConstructionInfo& ci) + + { + + m_suspensionRestLength1 = ci.m_suspensionRestLength; + m_maxSuspensionTravelCm = ci.m_maxSuspensionTravelCm; + + m_wheelsRadius = ci.m_wheelRadius; + m_suspensionStiffness = ci.m_suspensionStiffness; + m_wheelsDampingCompression = ci.m_wheelsDampingCompression; + m_wheelsDampingRelaxation = ci.m_wheelsDampingRelaxation; + m_chassisConnectionPointCS = ci.m_chassisConnectionCS; + m_wheelDirectionCS = ci.m_wheelDirectionCS; + m_wheelAxleCS = ci.m_wheelAxleCS; + m_frictionSlip = ci.m_frictionSlip; + m_steering = btScalar(0.); + m_engineForce = btScalar(0.); + m_rotation = btScalar(0.); + m_deltaRotation = btScalar(0.); + m_brake = btScalar(0.); + m_rollInfluence = btScalar(0.1); + m_bIsFrontWheel = ci.m_bIsFrontWheel; + + } + + void updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo); + + btScalar m_clippedInvContactDotSuspension; + btScalar m_suspensionRelativeVelocity; + //calculated by suspension + btScalar m_wheelsSuspensionForce; + btScalar m_skidInfo; + +}; + +#endif //WHEEL_INFO_H + diff --git a/src/bullet/src/LinearMath/btAabbUtil2.h b/src/bullet/src/LinearMath/btAabbUtil2.h new file mode 100644 index 000000000..9b320961b --- /dev/null +++ b/src/bullet/src/LinearMath/btAabbUtil2.h @@ -0,0 +1,125 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef AABB_UTIL2 +#define AABB_UTIL2 + +#include "btVector3.h" +#include "btMinMax.h" + + + + +/// conservative test for overlap between two aabbs +SIMD_FORCE_INLINE bool TestAabbAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1, + const btVector3 &aabbMin2, const btVector3 &aabbMax2) +{ + bool overlap = true; + overlap = (aabbMin1[0] > aabbMax2[0] || aabbMax1[0] < aabbMin2[0]) ? false : overlap; + overlap = (aabbMin1[2] > aabbMax2[2] || aabbMax1[2] < aabbMin2[2]) ? false : overlap; + overlap = (aabbMin1[1] > aabbMax2[1] || aabbMax1[1] < aabbMin2[1]) ? false : overlap; + return overlap; +} + +/// conservative test for overlap between triangle and aabb +SIMD_FORCE_INLINE bool TestTriangleAgainstAabb2(const btVector3 *vertices, + const btVector3 &aabbMin, const btVector3 &aabbMax) +{ + const btVector3 &p1 = vertices[0]; + const btVector3 &p2 = vertices[1]; + const btVector3 &p3 = vertices[2]; + + if (btMin(btMin(p1[0], p2[0]), p3[0]) > aabbMax[0]) return false; + if (btMax(btMax(p1[0], p2[0]), p3[0]) < aabbMin[0]) return false; + + if (btMin(btMin(p1[2], p2[2]), p3[2]) > aabbMax[2]) return false; + if (btMax(btMax(p1[2], p2[2]), p3[2]) < aabbMin[2]) return false; + + if (btMin(btMin(p1[1], p2[1]), p3[1]) > aabbMax[1]) return false; + if (btMax(btMax(p1[1], p2[1]), p3[1]) < aabbMin[1]) return false; + return true; +} + + +SIMD_FORCE_INLINE int btOutcode(const btVector3& p,const btVector3& halfExtent) +{ + return (p.getX() < -halfExtent.getX() ? 0x01 : 0x0) | + (p.getX() > halfExtent.getX() ? 0x08 : 0x0) | + (p.getY() < -halfExtent.getY() ? 0x02 : 0x0) | + (p.getY() > halfExtent.getY() ? 0x10 : 0x0) | + (p.getZ() < -halfExtent.getZ() ? 0x4 : 0x0) | + (p.getZ() > halfExtent.getZ() ? 0x20 : 0x0); +} + + +SIMD_FORCE_INLINE bool btRayAabb(const btVector3& rayFrom, + const btVector3& rayTo, + const btVector3& aabbMin, + const btVector3& aabbMax, + btScalar& param, btVector3& normal) +{ + btVector3 aabbHalfExtent = (aabbMax-aabbMin)* btScalar(0.5); + btVector3 aabbCenter = (aabbMax+aabbMin)* btScalar(0.5); + btVector3 source = rayFrom - aabbCenter; + btVector3 target = rayTo - aabbCenter; + int sourceOutcode = btOutcode(source,aabbHalfExtent); + int targetOutcode = btOutcode(target,aabbHalfExtent); + if ((sourceOutcode & targetOutcode) == 0x0) + { + btScalar lambda_enter = btScalar(0.0); + btScalar lambda_exit = param; + btVector3 r = target - source; + int i; + btScalar normSign = 1; + btVector3 hitNormal(0,0,0); + int bit=1; + + for (int j=0;j<2;j++) + { + for (i = 0; i != 3; ++i) + { + if (sourceOutcode & bit) + { + btScalar lambda = (-source[i] - aabbHalfExtent[i]*normSign) / r[i]; + if (lambda_enter <= lambda) + { + lambda_enter = lambda; + hitNormal.setValue(0,0,0); + hitNormal[i] = normSign; + } + } + else if (targetOutcode & bit) + { + btScalar lambda = (-source[i] - aabbHalfExtent[i]*normSign) / r[i]; + btSetMin(lambda_exit, lambda); + } + bit<<=1; + } + normSign = btScalar(-1.); + } + if (lambda_enter <= lambda_exit) + { + param = lambda_enter; + normal = hitNormal; + return true; + } + } + return false; +} + + +#endif + diff --git a/src/bullet/src/LinearMath/btAlignedAllocator.cpp b/src/bullet/src/LinearMath/btAlignedAllocator.cpp new file mode 100644 index 000000000..40bb7422a --- /dev/null +++ b/src/bullet/src/LinearMath/btAlignedAllocator.cpp @@ -0,0 +1,155 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btAlignedAllocator.h" + +int gNumAlignedAllocs = 0; +int gNumAlignedFree = 0; +int gTotalBytesAlignedAllocs = 0;//detect memory leaks + +#ifdef BT_DEBUG_MEMORY_ALLOCATIONS +//this generic allocator provides the total allocated number of bytes +#include + +void* btAlignedAllocInternal (size_t size, int alignment,int line,char* filename) +{ + void *ret; + char *real; + unsigned long offset; + + gTotalBytesAlignedAllocs += size; + gNumAlignedAllocs++; + + printf("allocation#%d from %s,line %d, size %d\n",gNumAlignedAllocs,filename,line,size); + real = (char *)malloc(size + 2*sizeof(void *) + (alignment-1)); + if (real) { + offset = (alignment - (unsigned long)(real + 2*sizeof(void *))) & +(alignment-1); + ret = (void *)((real + 2*sizeof(void *)) + offset); + *((void **)(ret)-1) = (void *)(real); + *((int*)(ret)-2) = size; + + } else { + ret = (void *)(real);//?? + } + int* ptr = (int*)ret; + *ptr = 12; + return (ret); +} +#include +void btAlignedFreeInternal (void* ptr,int line,char* filename) +{ + + void* real; + gNumAlignedFree++; + + if (ptr) { + real = *((void **)(ptr)-1); + int size = *((int*)(ptr)-2); + gTotalBytesAlignedAllocs -= size; + + printf("free #%d from %s,line %d, size %d\n",gNumAlignedFree,filename,line,size); + + free(real); + } else + { + printf("NULL ptr\n"); + } +} + +#else //BT_DEBUG_MEMORY_ALLOCATIONS + + +#if defined (BT_HAS_ALIGNED_ALLOCATOR) + + + + + +#include +void* btAlignedAllocInternal (size_t size, int alignment) +{ + gNumAlignedAllocs++; + + void* ptr = _aligned_malloc(size,alignment); +// printf("btAlignedAllocInternal %d, %x\n",size,ptr); + return ptr; +} + +void btAlignedFreeInternal (void* ptr) +{ + gNumAlignedFree++; +// printf("btAlignedFreeInternal %x\n",ptr); + _aligned_free(ptr); +} + +#else + +#ifdef __CELLOS_LV2__ + +#include + + + +void* btAlignedAllocInternal (size_t size, int alignment) +{ + gNumAlignedAllocs++; + return memalign(alignment, size); +} + +void btAlignedFreeInternal (void* ptr) +{ + gNumAlignedFree++; + free(ptr); +} + +#else + +void* btAlignedAllocInternal (size_t size, int alignment) +{ + void *ret; + char *real; + unsigned long offset; + + gNumAlignedAllocs++; + + real = (char *)malloc(size + sizeof(void *) + (alignment-1)); + if (real) { + offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1); + ret = (void *)((real + sizeof(void *)) + offset); + *((void **)(ret)-1) = (void *)(real); + } else { + ret = (void *)(real); + } + return (ret); +} + +void btAlignedFreeInternal (void* ptr) +{ + + void* real; + gNumAlignedFree++; + + if (ptr) { + real = *((void **)(ptr)-1); + free(real); + } +} +#endif // + +#endif + +#endif //BT_DEBUG_MEMORY_ALLOCATIONS + diff --git a/src/bullet/src/LinearMath/btAlignedAllocator.h b/src/bullet/src/LinearMath/btAlignedAllocator.h new file mode 100644 index 000000000..38e90c49b --- /dev/null +++ b/src/bullet/src/LinearMath/btAlignedAllocator.h @@ -0,0 +1,94 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_ALIGNED_ALLOCATOR +#define BT_ALIGNED_ALLOCATOR + +///we probably replace this with our own aligned memory allocator +///so we replace _aligned_malloc and _aligned_free with our own +///that is better portable and more predictable + +#include "btScalar.h" +//#define BT_DEBUG_MEMORY_ALLOCATIONS 1 +#ifdef BT_DEBUG_MEMORY_ALLOCATIONS + +#define btAlignedAlloc(a,b) \ + btAlignedAllocInternal(a,b,__LINE__,__FILE__) + +#define btAlignedFree(ptr) \ + btAlignedFreeInternal(ptr,__LINE__,__FILE__) + +void* btAlignedAllocInternal (size_t size, int alignment,int line,char* filename); + +void btAlignedFreeInternal (void* ptr,int line,char* filename); + +#else + void* btAlignedAllocInternal (size_t size, int alignment); + void btAlignedFreeInternal (void* ptr); + + #define btAlignedAlloc(a,b) btAlignedAllocInternal(a,b) + #define btAlignedFree(ptr) btAlignedFreeInternal(ptr) +#endif +typedef int size_type; + + +template < typename T , unsigned Alignment > +class btAlignedAllocator { + + typedef btAlignedAllocator< T , Alignment > self_type; + +public: + + //just going down a list: + btAlignedAllocator() {} + /* + btAlignedAllocator( const self_type & ) {} + */ + + template < typename Other > + btAlignedAllocator( const btAlignedAllocator< Other , Alignment > & ) {} + + typedef const T* const_pointer; + typedef const T& const_reference; + typedef T* pointer; + typedef T& reference; + typedef T value_type; + + pointer address ( reference ref ) const { return &ref; } + const_pointer address ( const_reference ref ) const { return &ref; } + pointer allocate ( size_type n , const_pointer * hint = 0 ) { + (void)hint; + return reinterpret_cast< pointer >(btAlignedAlloc( sizeof(value_type) * n , Alignment )); + } + void construct ( pointer ptr , const value_type & value ) { new (ptr) value_type( value ); } + void deallocate( pointer ptr ) { + btAlignedFree( reinterpret_cast< void * >( ptr ) ); + } + void destroy ( pointer ptr ) { ptr->~value_type(); } + + + template < typename O > struct rebind { + typedef btAlignedAllocator< O , Alignment > other; + }; + template < typename O > + self_type & operator=( const btAlignedAllocator< O , Alignment > & ) { return *this; } + + friend bool operator==( const self_type & , const self_type & ) { return true; } +}; + + + +#endif //BT_ALIGNED_ALLOCATOR + diff --git a/src/bullet/src/LinearMath/btAlignedObjectArray.h b/src/bullet/src/LinearMath/btAlignedObjectArray.h new file mode 100644 index 000000000..61a62a7ad --- /dev/null +++ b/src/bullet/src/LinearMath/btAlignedObjectArray.h @@ -0,0 +1,386 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef BT_OBJECT_ARRAY__ +#define BT_OBJECT_ARRAY__ + +#include "btScalar.h" // has definitions like SIMD_FORCE_INLINE +#include "btAlignedAllocator.h" + +///If the platform doesn't support placement new, you can disable BT_USE_PLACEMENT_NEW +///then the btAlignedObjectArray doesn't support objects with virtual methods, and non-trivial constructors/destructors +///You can enable BT_USE_MEMCPY, then swapping elements in the array will use memcpy instead of operator= +///see discussion here: http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1231 and +///http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1240 + +#define BT_USE_PLACEMENT_NEW 1 +//#define BT_USE_MEMCPY 1 //disable, because it is cumbersome to find out for each platform where memcpy is defined. It can be in or or otherwise... + +#ifdef BT_USE_MEMCPY +#include +#include +#endif //BT_USE_MEMCPY + +#ifdef BT_USE_PLACEMENT_NEW +#include //for placement new +#endif //BT_USE_PLACEMENT_NEW + + +///btAlignedObjectArray uses a subset of the stl::vector interface for its methods +///It is developed to replace stl::vector to avoid STL alignment issues to add SIMD/SSE data +template +//template +class btAlignedObjectArray +{ + btAlignedAllocator m_allocator; + + int m_size; + int m_capacity; + T* m_data; + //PCK: added this line + bool m_ownsMemory; + + protected: + SIMD_FORCE_INLINE int allocSize(int size) + { + return (size ? size*2 : 1); + } + SIMD_FORCE_INLINE void copy(int start,int end, T* dest) + { + int i; + for (i=start;i size()) + { + reserve(newsize); + } +#ifdef BT_USE_PLACEMENT_NEW + for (int i=curSize;i + void downHeap(T *pArr, int k, int n,L CompareFunc) + { + /* PRE: a[k+1..N] is a heap */ + /* POST: a[k..N] is a heap */ + + T temp = pArr[k - 1]; + /* k has child(s) */ + while (k <= n/2) + { + int child = 2*k; + + if ((child < n) && CompareFunc(pArr[child - 1] , pArr[child])) + { + child++; + } + /* pick larger child */ + if (CompareFunc(temp , pArr[child - 1])) + { + /* move child up */ + pArr[k - 1] = pArr[child - 1]; + k = child; + } + else + { + break; + } + } + pArr[k - 1] = temp; + } /*downHeap*/ + + void swap(int index0,int index1) + { +#ifdef BT_USE_MEMCPY + char temp[sizeof(T)]; + memcpy(temp,&m_data[index0],sizeof(T)); + memcpy(&m_data[index0],&m_data[index1],sizeof(T)); + memcpy(&m_data[index1],temp,sizeof(T)); +#else + T temp = m_data[index0]; + m_data[index0] = m_data[index1]; + m_data[index1] = temp; +#endif //BT_USE_PLACEMENT_NEW + + } + + template + void heapSort(L CompareFunc) + { + /* sort a[0..N-1], N.B. 0 to N-1 */ + int k; + int n = m_size; + for (k = n/2; k > 0; k--) + { + downHeap(m_data, k, n, CompareFunc); + } + + /* a[1..N] is now a heap */ + while ( n>=1 ) + { + swap(0,n-1); /* largest of a[0..n-1] */ + + + n = n - 1; + /* restore a[1..i-1] heap */ + downHeap(m_data, 1, n, CompareFunc); + } + } + + ///non-recursive binary search, assumes sorted array + int findBinarySearch(const T& key) const + { + int first = 0; + int last = size(); + + //assume sorted array + while (first <= last) { + int mid = (first + last) / 2; // compute mid point. + if (key > m_data[mid]) + first = mid + 1; // repeat search in top half. + else if (key < m_data[mid]) + last = mid - 1; // repeat search in bottom half. + else + return mid; // found it. return position ///// + } + return size(); // failed to find key + } + + + int findLinearSearch(const T& key) const + { + int index=size(); + int i; + + for (i=0;i& planeEquations, const btVector3& point, btScalar margin) +{ + int numbrushes = planeEquations.size(); + for (int i=0;ibtScalar(0.)) + { + return false; + } + } + return true; + +} + + +bool btGeometryUtil::areVerticesBehindPlane(const btVector3& planeNormal, const btAlignedObjectArray& vertices, btScalar margin) +{ + int numvertices = vertices.size(); + for (int i=0;ibtScalar(0.)) + { + return false; + } + } + return true; +} + +bool notExist(const btVector3& planeEquation,const btAlignedObjectArray& planeEquations) +{ + int numbrushes = planeEquations.size(); + for (int i=0;i btScalar(0.999)) + { + return false; + } + } + return true; +} + +void btGeometryUtil::getPlaneEquationsFromVertices(btAlignedObjectArray& vertices, btAlignedObjectArray& planeEquationsOut ) +{ + const int numvertices = vertices.size(); + // brute force: + for (int i=0;i btScalar(0.0001)) + { + planeEquation.normalize(); + if (notExist(planeEquation,planeEquationsOut)) + { + planeEquation[3] = -planeEquation.dot(N1); + + //check if inside, and replace supportingVertexOut if needed + if (areVerticesBehindPlane(planeEquation,vertices,btScalar(0.01))) + { + planeEquationsOut.push_back(planeEquation); + } + } + } + normalSign = btScalar(-1.); + } + + } + } + } + +} + +void btGeometryUtil::getVerticesFromPlaneEquations(const btAlignedObjectArray& planeEquations , btAlignedObjectArray& verticesOut ) +{ + const int numbrushes = planeEquations.size(); + // brute force: + for (int i=0;i btScalar(0.0001) ) && + ( n3n1.length2() > btScalar(0.0001) ) && + ( n1n2.length2() > btScalar(0.0001) ) ) + { + //point P out of 3 plane equations: + + // d1 ( N2 * N3 ) + d2 ( N3 * N1 ) + d3 ( N1 * N2 ) + //P = ------------------------------------------------------------------------- + // N1 . ( N2 * N3 ) + + + btScalar quotient = (N1.dot(n2n3)); + if (btFabs(quotient) > btScalar(0.000001)) + { + quotient = btScalar(-1.) / quotient; + n2n3 *= N1[3]; + n3n1 *= N2[3]; + n1n2 *= N3[3]; + btVector3 potentialVertex = n2n3; + potentialVertex += n3n1; + potentialVertex += n1n2; + potentialVertex *= quotient; + + //check if inside, and replace supportingVertexOut if needed + if (isPointInsidePlanes(planeEquations,potentialVertex,btScalar(0.01))) + { + verticesOut.push_back(potentialVertex); + } + } + } + } + } + } +} + diff --git a/src/bullet/src/LinearMath/btGeometryUtil.h b/src/bullet/src/LinearMath/btGeometryUtil.h new file mode 100644 index 000000000..d8d3c197e --- /dev/null +++ b/src/bullet/src/LinearMath/btGeometryUtil.h @@ -0,0 +1,41 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef BT_GEOMETRY_UTIL_H +#define BT_GEOMETRY_UTIL_H + +#include "btVector3.h" +#include "btAlignedObjectArray.h" + +class btGeometryUtil +{ + public: + + + static void getPlaneEquationsFromVertices(btAlignedObjectArray& vertices, btAlignedObjectArray& planeEquationsOut ); + + static void getVerticesFromPlaneEquations(const btAlignedObjectArray& planeEquations , btAlignedObjectArray& verticesOut ); + + static bool isInside(const btAlignedObjectArray& vertices, const btVector3& planeNormal, btScalar margin); + + static bool isPointInsidePlanes(const btAlignedObjectArray& planeEquations, const btVector3& point, btScalar margin); + + static bool areVerticesBehindPlane(const btVector3& planeNormal, const btAlignedObjectArray& vertices, btScalar margin); + +}; + + +#endif //BT_GEOMETRY_UTIL_H + diff --git a/src/bullet/src/LinearMath/btIDebugDraw.h b/src/bullet/src/LinearMath/btIDebugDraw.h new file mode 100644 index 000000000..2d96cff50 --- /dev/null +++ b/src/bullet/src/LinearMath/btIDebugDraw.h @@ -0,0 +1,102 @@ +/* +Copyright (c) 2005 Gino van den Bergen / Erwin Coumans http://continuousphysics.com + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +*/ + + +#ifndef IDEBUG_DRAW__H +#define IDEBUG_DRAW__H + +#include "btVector3.h" + + +class btIDebugDraw +{ + public: + + enum DebugDrawModes + { + DBG_NoDebug=0, + DBG_DrawWireframe = 1, + DBG_DrawAabb=2, + DBG_DrawFeaturesText=4, + DBG_DrawContactPoints=8, + DBG_NoDeactivation=16, + DBG_NoHelpText = 32, + DBG_DrawText=64, + DBG_ProfileTimings = 128, + DBG_EnableSatComparison = 256, + DBG_DisableBulletLCP = 512, + DBG_EnableCCD = 1024, + DBG_MAX_DEBUG_DRAW_MODE + }; + + virtual ~btIDebugDraw() {}; + + virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color)=0; + + virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color)=0; + + virtual void reportErrorWarning(const char* warningString) = 0; + + virtual void draw3dText(const btVector3& location,const char* textString) = 0; + + virtual void setDebugMode(int debugMode) =0; + + virtual int getDebugMode() const = 0; + + inline void drawAabb(const btVector3& from,const btVector3& to,const btVector3& color) + { + + btVector3 halfExtents = (to-from)* 0.5f; + btVector3 center = (to+from) *0.5f; + int i,j; + + btVector3 edgecoord(1.f,1.f,1.f),pa,pb; + for (i=0;i<4;i++) + { + for (j=0;j<3;j++) + { + pa = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1], + edgecoord[2]*halfExtents[2]); + pa+=center; + + int othercoord = j%3; + edgecoord[othercoord]*=-1.f; + pb = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1], + edgecoord[2]*halfExtents[2]); + pb+=center; + + drawLine(pa,pb,color); + } + edgecoord = btVector3(-1.f,-1.f,-1.f); + if (i<3) + edgecoord[i]*=-1.f; + } + } +}; + + +#endif //IDEBUG_DRAW__H + diff --git a/src/bullet/src/LinearMath/btList.h b/src/bullet/src/LinearMath/btList.h new file mode 100644 index 000000000..c87b47faf --- /dev/null +++ b/src/bullet/src/LinearMath/btList.h @@ -0,0 +1,73 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef GEN_LIST_H +#define GEN_LIST_H + +class btGEN_Link { +public: + btGEN_Link() : m_next(0), m_prev(0) {} + btGEN_Link(btGEN_Link *next, btGEN_Link *prev) : m_next(next), m_prev(prev) {} + + btGEN_Link *getNext() const { return m_next; } + btGEN_Link *getPrev() const { return m_prev; } + + bool isHead() const { return m_prev == 0; } + bool isTail() const { return m_next == 0; } + + void insertBefore(btGEN_Link *link) { + m_next = link; + m_prev = link->m_prev; + m_next->m_prev = this; + m_prev->m_next = this; + } + + void insertAfter(btGEN_Link *link) { + m_next = link->m_next; + m_prev = link; + m_next->m_prev = this; + m_prev->m_next = this; + } + + void remove() { + m_next->m_prev = m_prev; + m_prev->m_next = m_next; + } + +private: + btGEN_Link *m_next; + btGEN_Link *m_prev; +}; + +class btGEN_List { +public: + btGEN_List() : m_head(&m_tail, 0), m_tail(0, &m_head) {} + + btGEN_Link *getHead() const { return m_head.getNext(); } + btGEN_Link *getTail() const { return m_tail.getPrev(); } + + void addHead(btGEN_Link *link) { link->insertAfter(&m_head); } + void addTail(btGEN_Link *link) { link->insertBefore(&m_tail); } + +private: + btGEN_Link m_head; + btGEN_Link m_tail; +}; + +#endif + + + diff --git a/src/bullet/src/LinearMath/btMatrix3x3.h b/src/bullet/src/LinearMath/btMatrix3x3.h new file mode 100644 index 000000000..59680ff46 --- /dev/null +++ b/src/bullet/src/LinearMath/btMatrix3x3.h @@ -0,0 +1,410 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef btMatrix3x3_H +#define btMatrix3x3_H + +#include "btScalar.h" + +#include "btVector3.h" +#include "btQuaternion.h" + + +class btMatrix3x3 { + public: + btMatrix3x3 () {} + +// explicit btMatrix3x3(const btScalar *m) { setFromOpenGLSubMatrix(m); } + + explicit btMatrix3x3(const btQuaternion& q) { setRotation(q); } + /* + template + Matrix3x3(const btScalar& yaw, const btScalar& pitch, const btScalar& roll) + { + setEulerYPR(yaw, pitch, roll); + } + */ + btMatrix3x3(const btScalar& xx, const btScalar& xy, const btScalar& xz, + const btScalar& yx, const btScalar& yy, const btScalar& yz, + const btScalar& zx, const btScalar& zy, const btScalar& zz) + { + setValue(xx, xy, xz, + yx, yy, yz, + zx, zy, zz); + } + + SIMD_FORCE_INLINE btMatrix3x3 (const btMatrix3x3& other) + { + m_el[0] = other.m_el[0]; + m_el[1] = other.m_el[1]; + m_el[2] = other.m_el[2]; + } + + SIMD_FORCE_INLINE btMatrix3x3& operator=(const btMatrix3x3& other) + { + m_el[0] = other.m_el[0]; + m_el[1] = other.m_el[1]; + m_el[2] = other.m_el[2]; + return *this; + } + + SIMD_FORCE_INLINE btVector3 getColumn(int i) const + { + return btVector3(m_el[0][i],m_el[1][i],m_el[2][i]); + } + + + + SIMD_FORCE_INLINE const btVector3& getRow(int i) const + { + return m_el[i]; + } + + + SIMD_FORCE_INLINE btVector3& operator[](int i) + { + btFullAssert(0 <= i && i < 3); + return m_el[i]; + } + + SIMD_FORCE_INLINE const btVector3& operator[](int i) const + { + btFullAssert(0 <= i && i < 3); + return m_el[i]; + } + + btMatrix3x3& operator*=(const btMatrix3x3& m); + + + void setFromOpenGLSubMatrix(const btScalar *m) + { + m_el[0].setValue(m[0],m[4],m[8]); + m_el[1].setValue(m[1],m[5],m[9]); + m_el[2].setValue(m[2],m[6],m[10]); + + } + + void setValue(const btScalar& xx, const btScalar& xy, const btScalar& xz, + const btScalar& yx, const btScalar& yy, const btScalar& yz, + const btScalar& zx, const btScalar& zy, const btScalar& zz) + { + m_el[0].setValue(xx,xy,xz); + m_el[1].setValue(yx,yy,yz); + m_el[2].setValue(zx,zy,zz); + } + + void setRotation(const btQuaternion& q) + { + btScalar d = q.length2(); + btFullAssert(d != btScalar(0.0)); + btScalar s = btScalar(2.0) / d; + btScalar xs = q.x() * s, ys = q.y() * s, zs = q.z() * s; + btScalar wx = q.w() * xs, wy = q.w() * ys, wz = q.w() * zs; + btScalar xx = q.x() * xs, xy = q.x() * ys, xz = q.x() * zs; + btScalar yy = q.y() * ys, yz = q.y() * zs, zz = q.z() * zs; + setValue(btScalar(1.0) - (yy + zz), xy - wz, xz + wy, + xy + wz, btScalar(1.0) - (xx + zz), yz - wx, + xz - wy, yz + wx, btScalar(1.0) - (xx + yy)); + } + + + + void setEulerYPR(const btScalar& yaw, const btScalar& pitch, const btScalar& roll) + { + + btScalar cy(btCos(yaw)); + btScalar sy(btSin(yaw)); + btScalar cp(btCos(pitch)); + btScalar sp(btSin(pitch)); + btScalar cr(btCos(roll)); + btScalar sr(btSin(roll)); + btScalar cc = cy * cr; + btScalar cs = cy * sr; + btScalar sc = sy * cr; + btScalar ss = sy * sr; + setValue(cc - sp * ss, -cs - sp * sc, -sy * cp, + cp * sr, cp * cr, -sp, + sc + sp * cs, -ss + sp * cc, cy * cp); + + } + + /** + * setEulerZYX + * @param euler a const reference to a btVector3 of euler angles + * These angles are used to produce a rotation matrix. The euler + * angles are applied in ZYX order. I.e a vector is first rotated + * about X then Y and then Z + **/ + + void setEulerZYX(btScalar eulerX,btScalar eulerY,btScalar eulerZ) { + btScalar ci ( btCos(eulerX)); + btScalar cj ( btCos(eulerY)); + btScalar ch ( btCos(eulerZ)); + btScalar si ( btSin(eulerX)); + btScalar sj ( btSin(eulerY)); + btScalar sh ( btSin(eulerZ)); + btScalar cc = ci * ch; + btScalar cs = ci * sh; + btScalar sc = si * ch; + btScalar ss = si * sh; + + setValue(cj * ch, sj * sc - cs, sj * cc + ss, + cj * sh, sj * ss + cc, sj * cs - sc, + -sj, cj * si, cj * ci); + } + + void setIdentity() + { + setValue(btScalar(1.0), btScalar(0.0), btScalar(0.0), + btScalar(0.0), btScalar(1.0), btScalar(0.0), + btScalar(0.0), btScalar(0.0), btScalar(1.0)); + } + + void getOpenGLSubMatrix(btScalar *m) const + { + m[0] = btScalar(m_el[0].x()); + m[1] = btScalar(m_el[1].x()); + m[2] = btScalar(m_el[2].x()); + m[3] = btScalar(0.0); + m[4] = btScalar(m_el[0].y()); + m[5] = btScalar(m_el[1].y()); + m[6] = btScalar(m_el[2].y()); + m[7] = btScalar(0.0); + m[8] = btScalar(m_el[0].z()); + m[9] = btScalar(m_el[1].z()); + m[10] = btScalar(m_el[2].z()); + m[11] = btScalar(0.0); + } + + void getRotation(btQuaternion& q) const + { + btScalar trace = m_el[0].x() + m_el[1].y() + m_el[2].z(); + btScalar temp[4]; + + if (trace > btScalar(0.0)) + { + btScalar s = btSqrt(trace + btScalar(1.0)); + temp[3]=(s * btScalar(0.5)); + s = btScalar(0.5) / s; + + temp[0]=((m_el[2].y() - m_el[1].z()) * s); + temp[1]=((m_el[0].z() - m_el[2].x()) * s); + temp[2]=((m_el[1].x() - m_el[0].y()) * s); + } + else + { + int i = m_el[0].x() < m_el[1].y() ? + (m_el[1].y() < m_el[2].z() ? 2 : 1) : + (m_el[0].x() < m_el[2].z() ? 2 : 0); + int j = (i + 1) % 3; + int k = (i + 2) % 3; + + btScalar s = btSqrt(m_el[i][i] - m_el[j][j] - m_el[k][k] + btScalar(1.0)); + temp[i] = s * btScalar(0.5); + s = btScalar(0.5) / s; + + temp[3] = (m_el[k][j] - m_el[j][k]) * s; + temp[j] = (m_el[j][i] + m_el[i][j]) * s; + temp[k] = (m_el[k][i] + m_el[i][k]) * s; + } + q.setValue(temp[0],temp[1],temp[2],temp[3]); + } + + void getEuler(btScalar& yaw, btScalar& pitch, btScalar& roll) const + { + + if (btScalar(m_el[1].z()) < btScalar(1)) + { + if (btScalar(m_el[1].z()) > -btScalar(1)) + { + yaw = btScalar(btAtan2(m_el[1].x(), m_el[0].x())); + pitch = btScalar(btAsin(-m_el[1].y())); + roll = btScalar(btAtan2(m_el[2].y(), m_el[2].z())); + } + else + { + yaw = btScalar(-btAtan2(-m_el[0].y(), m_el[0].z())); + pitch = SIMD_HALF_PI; + roll = btScalar(0.0); + } + } + else + { + yaw = btScalar(btAtan2(-m_el[0].y(), m_el[0].z())); + pitch = -SIMD_HALF_PI; + roll = btScalar(0.0); + } + } + + + + + btMatrix3x3 scaled(const btVector3& s) const + { + return btMatrix3x3(m_el[0].x() * s.x(), m_el[0].y() * s.y(), m_el[0].z() * s.z(), + m_el[1].x() * s.x(), m_el[1].y() * s.y(), m_el[1].z() * s.z(), + m_el[2].x() * s.x(), m_el[2].y() * s.y(), m_el[2].z() * s.z()); + } + + btScalar determinant() const; + btMatrix3x3 adjoint() const; + btMatrix3x3 absolute() const; + btMatrix3x3 transpose() const; + btMatrix3x3 inverse() const; + + btMatrix3x3 transposeTimes(const btMatrix3x3& m) const; + btMatrix3x3 timesTranspose(const btMatrix3x3& m) const; + + SIMD_FORCE_INLINE btScalar tdotx(const btVector3& v) const + { + return m_el[0].x() * v.x() + m_el[1].x() * v.y() + m_el[2].x() * v.z(); + } + SIMD_FORCE_INLINE btScalar tdoty(const btVector3& v) const + { + return m_el[0].y() * v.x() + m_el[1].y() * v.y() + m_el[2].y() * v.z(); + } + SIMD_FORCE_INLINE btScalar tdotz(const btVector3& v) const + { + return m_el[0].z() * v.x() + m_el[1].z() * v.y() + m_el[2].z() * v.z(); + } + + + + protected: + btScalar cofac(int r1, int c1, int r2, int c2) const + { + return m_el[r1][c1] * m_el[r2][c2] - m_el[r1][c2] * m_el[r2][c1]; + } + + btVector3 m_el[3]; + }; + + SIMD_FORCE_INLINE btMatrix3x3& + btMatrix3x3::operator*=(const btMatrix3x3& m) + { + setValue(m.tdotx(m_el[0]), m.tdoty(m_el[0]), m.tdotz(m_el[0]), + m.tdotx(m_el[1]), m.tdoty(m_el[1]), m.tdotz(m_el[1]), + m.tdotx(m_el[2]), m.tdoty(m_el[2]), m.tdotz(m_el[2])); + return *this; + } + + SIMD_FORCE_INLINE btScalar + btMatrix3x3::determinant() const + { + return triple((*this)[0], (*this)[1], (*this)[2]); + } + + + SIMD_FORCE_INLINE btMatrix3x3 + btMatrix3x3::absolute() const + { + return btMatrix3x3( + btFabs(m_el[0].x()), btFabs(m_el[0].y()), btFabs(m_el[0].z()), + btFabs(m_el[1].x()), btFabs(m_el[1].y()), btFabs(m_el[1].z()), + btFabs(m_el[2].x()), btFabs(m_el[2].y()), btFabs(m_el[2].z())); + } + + SIMD_FORCE_INLINE btMatrix3x3 + btMatrix3x3::transpose() const + { + return btMatrix3x3(m_el[0].x(), m_el[1].x(), m_el[2].x(), + m_el[0].y(), m_el[1].y(), m_el[2].y(), + m_el[0].z(), m_el[1].z(), m_el[2].z()); + } + + SIMD_FORCE_INLINE btMatrix3x3 + btMatrix3x3::adjoint() const + { + return btMatrix3x3(cofac(1, 1, 2, 2), cofac(0, 2, 2, 1), cofac(0, 1, 1, 2), + cofac(1, 2, 2, 0), cofac(0, 0, 2, 2), cofac(0, 2, 1, 0), + cofac(1, 0, 2, 1), cofac(0, 1, 2, 0), cofac(0, 0, 1, 1)); + } + + SIMD_FORCE_INLINE btMatrix3x3 + btMatrix3x3::inverse() const + { + btVector3 co(cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1)); + btScalar det = (*this)[0].dot(co); + btFullAssert(det != btScalar(0.0)); + btScalar s = btScalar(1.0) / det; + return btMatrix3x3(co.x() * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s, + co.y() * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s, + co.z() * s, cofac(0, 1, 2, 0) * s, cofac(0, 0, 1, 1) * s); + } + + SIMD_FORCE_INLINE btMatrix3x3 + btMatrix3x3::transposeTimes(const btMatrix3x3& m) const + { + return btMatrix3x3( + m_el[0].x() * m[0].x() + m_el[1].x() * m[1].x() + m_el[2].x() * m[2].x(), + m_el[0].x() * m[0].y() + m_el[1].x() * m[1].y() + m_el[2].x() * m[2].y(), + m_el[0].x() * m[0].z() + m_el[1].x() * m[1].z() + m_el[2].x() * m[2].z(), + m_el[0].y() * m[0].x() + m_el[1].y() * m[1].x() + m_el[2].y() * m[2].x(), + m_el[0].y() * m[0].y() + m_el[1].y() * m[1].y() + m_el[2].y() * m[2].y(), + m_el[0].y() * m[0].z() + m_el[1].y() * m[1].z() + m_el[2].y() * m[2].z(), + m_el[0].z() * m[0].x() + m_el[1].z() * m[1].x() + m_el[2].z() * m[2].x(), + m_el[0].z() * m[0].y() + m_el[1].z() * m[1].y() + m_el[2].z() * m[2].y(), + m_el[0].z() * m[0].z() + m_el[1].z() * m[1].z() + m_el[2].z() * m[2].z()); + } + + SIMD_FORCE_INLINE btMatrix3x3 + btMatrix3x3::timesTranspose(const btMatrix3x3& m) const + { + return btMatrix3x3( + m_el[0].dot(m[0]), m_el[0].dot(m[1]), m_el[0].dot(m[2]), + m_el[1].dot(m[0]), m_el[1].dot(m[1]), m_el[1].dot(m[2]), + m_el[2].dot(m[0]), m_el[2].dot(m[1]), m_el[2].dot(m[2])); + + } + + SIMD_FORCE_INLINE btVector3 + operator*(const btMatrix3x3& m, const btVector3& v) + { + return btVector3(m[0].dot(v), m[1].dot(v), m[2].dot(v)); + } + + + SIMD_FORCE_INLINE btVector3 + operator*(const btVector3& v, const btMatrix3x3& m) + { + return btVector3(m.tdotx(v), m.tdoty(v), m.tdotz(v)); + } + + SIMD_FORCE_INLINE btMatrix3x3 + operator*(const btMatrix3x3& m1, const btMatrix3x3& m2) + { + return btMatrix3x3( + m2.tdotx( m1[0]), m2.tdoty( m1[0]), m2.tdotz( m1[0]), + m2.tdotx( m1[1]), m2.tdoty( m1[1]), m2.tdotz( m1[1]), + m2.tdotx( m1[2]), m2.tdoty( m1[2]), m2.tdotz( m1[2])); + } + +/* + SIMD_FORCE_INLINE btMatrix3x3 btMultTransposeLeft(const btMatrix3x3& m1, const btMatrix3x3& m2) { + return btMatrix3x3( + m1[0][0] * m2[0][0] + m1[1][0] * m2[1][0] + m1[2][0] * m2[2][0], + m1[0][0] * m2[0][1] + m1[1][0] * m2[1][1] + m1[2][0] * m2[2][1], + m1[0][0] * m2[0][2] + m1[1][0] * m2[1][2] + m1[2][0] * m2[2][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[1][0] + m1[2][1] * m2[2][0], + m1[0][1] * m2[0][1] + m1[1][1] * m2[1][1] + m1[2][1] * m2[2][1], + m1[0][1] * m2[0][2] + m1[1][1] * m2[1][2] + m1[2][1] * m2[2][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[1][0] + m1[2][2] * m2[2][0], + m1[0][2] * m2[0][1] + m1[1][2] * m2[1][1] + m1[2][2] * m2[2][1], + m1[0][2] * m2[0][2] + m1[1][2] * m2[1][2] + m1[2][2] * m2[2][2]); +} +*/ + + +#endif diff --git a/src/bullet/src/LinearMath/btMinMax.h b/src/bullet/src/LinearMath/btMinMax.h new file mode 100644 index 000000000..5e27d62a4 --- /dev/null +++ b/src/bullet/src/LinearMath/btMinMax.h @@ -0,0 +1,69 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef GEN_MINMAX_H +#define GEN_MINMAX_H + +template +SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b) +{ + return a < b ? a : b ; +} + +template +SIMD_FORCE_INLINE const T& btMax(const T& a, const T& b) +{ + return a > b ? a : b; +} + +template +SIMD_FORCE_INLINE const T& GEN_clamped(const T& a, const T& lb, const T& ub) +{ + return a < lb ? lb : (ub < a ? ub : a); +} + +template +SIMD_FORCE_INLINE void btSetMin(T& a, const T& b) +{ + if (b < a) + { + a = b; + } +} + +template +SIMD_FORCE_INLINE void btSetMax(T& a, const T& b) +{ + if (a < b) + { + a = b; + } +} + +template +SIMD_FORCE_INLINE void GEN_clamp(T& a, const T& lb, const T& ub) +{ + if (a < lb) + { + a = lb; + } + else if (ub < a) + { + a = ub; + } +} + +#endif diff --git a/src/bullet/src/LinearMath/btMotionState.h b/src/bullet/src/LinearMath/btMotionState.h new file mode 100644 index 000000000..e788b3d89 --- /dev/null +++ b/src/bullet/src/LinearMath/btMotionState.h @@ -0,0 +1,40 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BT_MOTIONSTATE_H +#define BT_MOTIONSTATE_H + +#include "btTransform.h" + +///btMotionState allows the dynamics world to synchronize the updated world transforms with graphics +///For optimizations, potentially only moving objects get synchronized (using setWorldPosition/setWorldOrientation) +class btMotionState +{ + public: + + virtual ~btMotionState() + { + + } + + virtual void getWorldTransform(btTransform& worldTrans ) const =0; + + //Bullet only calls the update of worldtransform for active objects + virtual void setWorldTransform(const btTransform& worldTrans)=0; + + +}; + +#endif //BT_MOTIONSTATE_H diff --git a/src/bullet/src/LinearMath/btPoint3.h b/src/bullet/src/LinearMath/btPoint3.h new file mode 100644 index 000000000..a2020e26d --- /dev/null +++ b/src/bullet/src/LinearMath/btPoint3.h @@ -0,0 +1,24 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef btPoint3_H +#define btPoint3_H + +#include "btVector3.h" + +typedef btVector3 btPoint3; + +#endif diff --git a/src/bullet/src/LinearMath/btPoolAllocator.h b/src/bullet/src/LinearMath/btPoolAllocator.h new file mode 100644 index 000000000..69105dc87 --- /dev/null +++ b/src/bullet/src/LinearMath/btPoolAllocator.h @@ -0,0 +1,94 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef _BT_POOL_ALLOCATOR_H +#define _BT_POOL_ALLOCATOR_H + +#include "btScalar.h" +#include "btAlignedAllocator.h" + +class btPoolAllocator +{ + int m_elemSize; + int m_maxElements; + int m_freeCount; + void* m_firstFree; + unsigned char* m_pool; + +public: + + btPoolAllocator(int elemSize, int maxElements) + :m_elemSize(elemSize), + m_maxElements(maxElements) + { + m_pool = (unsigned char*) btAlignedAlloc(m_elemSize*m_maxElements,16); + + unsigned char* p = m_pool; + m_firstFree = p; + m_freeCount = m_maxElements; + int count = m_maxElements; + while (--count) { + *(void**)p = (p + m_elemSize); + p += m_elemSize; + } + *(void**)p = 0; + } + + ~btPoolAllocator() + { + btAlignedFree( m_pool); + } + + int getFreeCount() const + { + return m_freeCount; + } + + void* allocate(int size) + { + btAssert(!size || size<=m_elemSize); + btAssert(m_freeCount>0); + void* result = m_firstFree; + m_firstFree = *(void**)m_firstFree; + --m_freeCount; + return result; + } + + bool validPtr(void* ptr) + { + if (ptr) { + if (((unsigned char*)ptr >= m_pool && (unsigned char*)ptr < m_pool + m_maxElements * m_elemSize)) + { + return true; + } + } + return false; + } + + void free(void* ptr) + { + if (ptr) { + btAssert((unsigned char*)ptr >= m_pool && (unsigned char*)ptr < m_pool + m_maxElements * m_elemSize); + + *(void**)ptr = m_firstFree; + m_firstFree = ptr; + ++m_freeCount; + } + } + + +}; + +#endif //_BT_POOL_ALLOCATOR_H diff --git a/src/bullet/src/LinearMath/btQuadWord.h b/src/bullet/src/LinearMath/btQuadWord.h new file mode 100644 index 000000000..2e5950ebd --- /dev/null +++ b/src/bullet/src/LinearMath/btQuadWord.h @@ -0,0 +1,135 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef SIMD_QUADWORD_H +#define SIMD_QUADWORD_H + +#include "btScalar.h" +#include "btMinMax.h" + +//ATTRIBUTE_ALIGNED16(class) btQuadWordStorage +//some issues under PS3 Linux with IBM 2.1 SDK, gcc compiler prevent from using aligned quadword. todo: look into this + +class btQuadWordStorage +{ +protected: + btScalar m_x; + btScalar m_y; + btScalar m_z; + btScalar m_unusedW; +}; + + +///btQuadWord is base-class for vectors, points +class btQuadWord : public btQuadWordStorage +{ + public: + +// SIMD_FORCE_INLINE btScalar& operator[](int i) { return (&m_x)[i]; } +// SIMD_FORCE_INLINE const btScalar& operator[](int i) const { return (&m_x)[i]; } + + SIMD_FORCE_INLINE const btScalar& getX() const { return m_x; } + + SIMD_FORCE_INLINE const btScalar& getY() const { return m_y; } + + SIMD_FORCE_INLINE const btScalar& getZ() const { return m_z; } + + SIMD_FORCE_INLINE void setX(btScalar x) { m_x = x;}; + + SIMD_FORCE_INLINE void setY(btScalar y) { m_y = y;}; + + SIMD_FORCE_INLINE void setZ(btScalar z) { m_z = z;}; + + SIMD_FORCE_INLINE void setW(btScalar w) { m_unusedW = w;}; + + SIMD_FORCE_INLINE const btScalar& x() const { return m_x; } + + SIMD_FORCE_INLINE const btScalar& y() const { return m_y; } + + SIMD_FORCE_INLINE const btScalar& z() const { return m_z; } + + SIMD_FORCE_INLINE const btScalar& w() const { return m_unusedW; } + + + SIMD_FORCE_INLINE operator btScalar *() { return &m_x; } + SIMD_FORCE_INLINE operator const btScalar *() const { return &m_x; } + + + + SIMD_FORCE_INLINE void setValue(const btScalar& x, const btScalar& y, const btScalar& z) + { + m_x=x; + m_y=y; + m_z=z; + m_unusedW = 0.f; + } + +/* void getValue(btScalar *m) const + { + m[0] = m_x; + m[1] = m_y; + m[2] = m_z; + } +*/ + SIMD_FORCE_INLINE void setValue(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w) + { + m_x=x; + m_y=y; + m_z=z; + m_unusedW=w; + } + + SIMD_FORCE_INLINE btQuadWord() + // :m_x(btScalar(0.)),m_y(btScalar(0.)),m_z(btScalar(0.)),m_unusedW(btScalar(0.)) + { + } + + SIMD_FORCE_INLINE btQuadWord(const btQuadWordStorage& q) + { + *((btQuadWordStorage*)this) = q; + } + + SIMD_FORCE_INLINE btQuadWord(const btScalar& x, const btScalar& y, const btScalar& z) + { + m_x = x, m_y = y, m_z = z, m_unusedW = 0.0f; + } + + SIMD_FORCE_INLINE btQuadWord(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w) + { + m_x = x, m_y = y, m_z = z, m_unusedW = w; + } + + + SIMD_FORCE_INLINE void setMax(const btQuadWord& other) + { + btSetMax(m_x, other.m_x); + btSetMax(m_y, other.m_y); + btSetMax(m_z, other.m_z); + btSetMax(m_unusedW, other.m_unusedW); + } + + SIMD_FORCE_INLINE void setMin(const btQuadWord& other) + { + btSetMin(m_x, other.m_x); + btSetMin(m_y, other.m_y); + btSetMin(m_z, other.m_z); + btSetMin(m_unusedW, other.m_unusedW); + } + + + +}; + +#endif //SIMD_QUADWORD_H diff --git a/src/bullet/src/LinearMath/btQuaternion.h b/src/bullet/src/LinearMath/btQuaternion.h new file mode 100644 index 000000000..27ab1fcd2 --- /dev/null +++ b/src/bullet/src/LinearMath/btQuaternion.h @@ -0,0 +1,321 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef SIMD__QUATERNION_H_ +#define SIMD__QUATERNION_H_ + +#include "btVector3.h" + +class btQuaternion : public btQuadWord { +public: + btQuaternion() {} + + // template + // explicit Quaternion(const btScalar *v) : Tuple4(v) {} + + btQuaternion(const btScalar& x, const btScalar& y, const btScalar& z, const btScalar& w) + : btQuadWord(x, y, z, w) + {} + + btQuaternion(const btVector3& axis, const btScalar& angle) + { + setRotation(axis, angle); + } + + btQuaternion(const btScalar& yaw, const btScalar& pitch, const btScalar& roll) + { + setEuler(yaw, pitch, roll); + } + + void setRotation(const btVector3& axis, const btScalar& angle) + { + btScalar d = axis.length(); + assert(d != btScalar(0.0)); + btScalar s = btSin(angle * btScalar(0.5)) / d; + setValue(axis.x() * s, axis.y() * s, axis.z() * s, + btCos(angle * btScalar(0.5))); + } + + void setEuler(const btScalar& yaw, const btScalar& pitch, const btScalar& roll) + { + btScalar halfYaw = btScalar(yaw) * btScalar(0.5); + btScalar halfPitch = btScalar(pitch) * btScalar(0.5); + btScalar halfRoll = btScalar(roll) * btScalar(0.5); + btScalar cosYaw = btCos(halfYaw); + btScalar sinYaw = btSin(halfYaw); + btScalar cosPitch = btCos(halfPitch); + btScalar sinPitch = btSin(halfPitch); + btScalar cosRoll = btCos(halfRoll); + btScalar sinRoll = btSin(halfRoll); + setValue(cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw, + cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw, + sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw, + cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw); + } + + btQuaternion& operator+=(const btQuaternion& q) + { + m_x += q.x(); m_y += q.y(); m_z += q.z(); m_unusedW += q.m_unusedW; + return *this; + } + + btQuaternion& operator-=(const btQuaternion& q) + { + m_x -= q.x(); m_y -= q.y(); m_z -= q.z(); m_unusedW -= q.m_unusedW; + return *this; + } + + btQuaternion& operator*=(const btScalar& s) + { + m_x *= s; m_y *= s; m_z *= s; m_unusedW *= s; + return *this; + } + + + btQuaternion& operator*=(const btQuaternion& q) + { + setValue(m_unusedW * q.x() + m_x * q.m_unusedW + m_y * q.z() - m_z * q.y(), + m_unusedW * q.y() + m_y * q.m_unusedW + m_z * q.x() - m_x * q.z(), + m_unusedW * q.z() + m_z * q.m_unusedW + m_x * q.y() - m_y * q.x(), + m_unusedW * q.m_unusedW - m_x * q.x() - m_y * q.y() - m_z * q.z()); + return *this; + } + + btScalar dot(const btQuaternion& q) const + { + return m_x * q.x() + m_y * q.y() + m_z * q.z() + m_unusedW * q.m_unusedW; + } + + btScalar length2() const + { + return dot(*this); + } + + btScalar length() const + { + return btSqrt(length2()); + } + + btQuaternion& normalize() + { + return *this /= length(); + } + + SIMD_FORCE_INLINE btQuaternion + operator*(const btScalar& s) const + { + return btQuaternion(x() * s, y() * s, z() * s, m_unusedW * s); + } + + + + btQuaternion operator/(const btScalar& s) const + { + assert(s != btScalar(0.0)); + return *this * (btScalar(1.0) / s); + } + + + btQuaternion& operator/=(const btScalar& s) + { + assert(s != btScalar(0.0)); + return *this *= btScalar(1.0) / s; + } + + + btQuaternion normalized() const + { + return *this / length(); + } + + btScalar angle(const btQuaternion& q) const + { + btScalar s = btSqrt(length2() * q.length2()); + assert(s != btScalar(0.0)); + return btAcos(dot(q) / s); + } + + btScalar getAngle() const + { + btScalar s = btScalar(2.) * btAcos(m_unusedW); + return s; + } + + + + btQuaternion inverse() const + { + return btQuaternion(m_x, m_y, m_z, -m_unusedW); + } + + SIMD_FORCE_INLINE btQuaternion + operator+(const btQuaternion& q2) const + { + const btQuaternion& q1 = *this; + return btQuaternion(q1.x() + q2.x(), q1.y() + q2.y(), q1.z() + q2.z(), q1.m_unusedW + q2.m_unusedW); + } + + SIMD_FORCE_INLINE btQuaternion + operator-(const btQuaternion& q2) const + { + const btQuaternion& q1 = *this; + return btQuaternion(q1.x() - q2.x(), q1.y() - q2.y(), q1.z() - q2.z(), q1.m_unusedW - q2.m_unusedW); + } + + SIMD_FORCE_INLINE btQuaternion operator-() const + { + const btQuaternion& q2 = *this; + return btQuaternion( - q2.x(), - q2.y(), - q2.z(), - q2.m_unusedW); + } + + SIMD_FORCE_INLINE btQuaternion farthest( const btQuaternion& qd) const + { + btQuaternion diff,sum; + diff = *this - qd; + sum = *this + qd; + if( diff.dot(diff) > sum.dot(sum) ) + return qd; + return (-qd); + } + + btQuaternion slerp(const btQuaternion& q, const btScalar& t) const + { + btScalar theta = angle(q); + if (theta != btScalar(0.0)) + { + btScalar d = btScalar(1.0) / btSin(theta); + btScalar s0 = btSin((btScalar(1.0) - t) * theta); + btScalar s1 = btSin(t * theta); + return btQuaternion((m_x * s0 + q.x() * s1) * d, + (m_y * s0 + q.y() * s1) * d, + (m_z * s0 + q.z() * s1) * d, + (m_unusedW * s0 + q.m_unusedW * s1) * d); + } + else + { + return *this; + } + } + + SIMD_FORCE_INLINE const btScalar& getW() const { return m_unusedW; } + + +}; + + + +SIMD_FORCE_INLINE btQuaternion +operator-(const btQuaternion& q) +{ + return btQuaternion(-q.x(), -q.y(), -q.z(), -q.w()); +} + + + + +SIMD_FORCE_INLINE btQuaternion +operator*(const btQuaternion& q1, const btQuaternion& q2) { + return btQuaternion(q1.w() * q2.x() + q1.x() * q2.w() + q1.y() * q2.z() - q1.z() * q2.y(), + q1.w() * q2.y() + q1.y() * q2.w() + q1.z() * q2.x() - q1.x() * q2.z(), + q1.w() * q2.z() + q1.z() * q2.w() + q1.x() * q2.y() - q1.y() * q2.x(), + q1.w() * q2.w() - q1.x() * q2.x() - q1.y() * q2.y() - q1.z() * q2.z()); +} + +SIMD_FORCE_INLINE btQuaternion +operator*(const btQuaternion& q, const btVector3& w) +{ + return btQuaternion( q.w() * w.x() + q.y() * w.z() - q.z() * w.y(), + q.w() * w.y() + q.z() * w.x() - q.x() * w.z(), + q.w() * w.z() + q.x() * w.y() - q.y() * w.x(), + -q.x() * w.x() - q.y() * w.y() - q.z() * w.z()); +} + +SIMD_FORCE_INLINE btQuaternion +operator*(const btVector3& w, const btQuaternion& q) +{ + return btQuaternion( w.x() * q.w() + w.y() * q.z() - w.z() * q.y(), + w.y() * q.w() + w.z() * q.x() - w.x() * q.z(), + w.z() * q.w() + w.x() * q.y() - w.y() * q.x(), + -w.x() * q.x() - w.y() * q.y() - w.z() * q.z()); +} + +SIMD_FORCE_INLINE btScalar +dot(const btQuaternion& q1, const btQuaternion& q2) +{ + return q1.dot(q2); +} + + +SIMD_FORCE_INLINE btScalar +length(const btQuaternion& q) +{ + return q.length(); +} + +SIMD_FORCE_INLINE btScalar +angle(const btQuaternion& q1, const btQuaternion& q2) +{ + return q1.angle(q2); +} + + +SIMD_FORCE_INLINE btQuaternion +inverse(const btQuaternion& q) +{ + return q.inverse(); +} + +SIMD_FORCE_INLINE btQuaternion +slerp(const btQuaternion& q1, const btQuaternion& q2, const btScalar& t) +{ + return q1.slerp(q2, t); +} + +SIMD_FORCE_INLINE btVector3 +quatRotate(const btQuaternion& rotation, const btVector3& v) +{ + btQuaternion q = rotation * v; + q *= rotation.inverse(); + return btVector3(q.getX(),q.getY(),q.getZ()); +} + +SIMD_FORCE_INLINE btQuaternion +shortestArcQuat(const btVector3& v0, const btVector3& v1) // Game Programming Gems 2.10. make sure v0,v1 are normalized +{ + btVector3 c = v0.cross(v1); + btScalar d = v0.dot(v1); + + if (d < -1.0 + SIMD_EPSILON) + return btQuaternion(0.0f,1.0f,0.0f,0.0f); // just pick any vector + + btScalar s = btSqrt((1.0f + d) * 2.0f); + btScalar rs = 1.0f / s; + + return btQuaternion(c.getX()*rs,c.getY()*rs,c.getZ()*rs,s * 0.5f); +} + +SIMD_FORCE_INLINE btQuaternion +shortestArcQuatNormalize2(btVector3& v0,btVector3& v1) +{ + v0.normalize(); + v1.normalize(); + return shortestArcQuat(v0,v1); +} + +#endif + + + diff --git a/src/bullet/src/LinearMath/btQuickprof.cpp b/src/bullet/src/LinearMath/btQuickprof.cpp new file mode 100644 index 000000000..37a0c8c3b --- /dev/null +++ b/src/bullet/src/LinearMath/btQuickprof.cpp @@ -0,0 +1,38 @@ +/* +Copyright (c) 2006 Tyler Streeter + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +*/ + + +// Please visit the project website (http://quickprof.sourceforge.net) +// for usage instructions. + +// Credits: The Clock class was inspired by the Timer classes in +// Ogre (www.ogre3d.org). + +#include "LinearMath/btQuickprof.h" + +#ifdef USE_QUICKPROF + +// Note: We must declare these private static variables again here to +// avoid link errors. +bool btProfiler::mEnabled = false; +btClock btProfiler::mClock; +unsigned long int btProfiler::mCurrentCycleStartMicroseconds = 0; +unsigned long int btProfiler::mLastCycleDurationMicroseconds = 0; +std::map btProfiler::mProfileBlocks; +std::ofstream btProfiler::mOutputFile; +bool btProfiler::mFirstFileOutput = true; +btProfiler::BlockTimingMethod btProfiler::mFileOutputMethod; +unsigned long int btProfiler::mCycleNumber = 0; +#endif //USE_QUICKPROF diff --git a/src/bullet/src/LinearMath/btQuickprof.h b/src/bullet/src/LinearMath/btQuickprof.h new file mode 100644 index 000000000..a885967c5 --- /dev/null +++ b/src/bullet/src/LinearMath/btQuickprof.h @@ -0,0 +1,712 @@ +/* +Copyright (c) 2006 Tyler Streeter + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +*/ + +// Please visit the project website (http://quickprof.sourceforge.net) +// for usage instructions. + +// Credits: The Clock class was inspired by the Timer classes in +// Ogre (www.ogre3d.org). + +#ifndef QUICK_PROF_H +#define QUICK_PROF_H + +#include "btScalar.h" + +//#define USE_QUICKPROF 1 +//Don't use quickprof for now, because it contains STL. TODO: replace STL by Bullet container classes. + + +//if you don't need btClock, you can comment next line +#define USE_BT_CLOCK 1 + +#ifdef USE_BT_CLOCK +#ifdef __CELLOS_LV2__ +#include +#include +typedef uint64_t __int64; +#endif + +#if defined (SUNOS) || defined (__SUNOS__) + #include +#endif + +#if defined(WIN32) || defined(_WIN32) + + #define USE_WINDOWS_TIMERS + #define WIN32_LEAN_AND_MEAN + #define NOWINRES + #define NOMCX + #define NOIME +#ifdef _XBOX + #include +#else + #include +#endif + #include + +#else + #include +#endif + +#define mymin(a,b) (a > b ? a : b) + +/// basic clock +class btClock + { + public: + btClock() + { +#ifdef USE_WINDOWS_TIMERS + QueryPerformanceFrequency(&mClockFrequency); +#endif + reset(); + } + + ~btClock() + { + } + + /// Resets the initial reference time. + void reset() + { +#ifdef USE_WINDOWS_TIMERS + QueryPerformanceCounter(&mStartTime); + mStartTick = GetTickCount(); + mPrevElapsedTime = 0; +#else +#ifdef __CELLOS_LV2__ + + typedef uint64_t __int64; + typedef __int64 ClockSize; + ClockSize newTime; + __asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory"); + mStartTime = newTime; +#else + gettimeofday(&mStartTime, 0); +#endif + +#endif + } + + /// Returns the time in ms since the last call to reset or since + /// the btClock was created. + unsigned long int getTimeMilliseconds() + { +#ifdef USE_WINDOWS_TIMERS + LARGE_INTEGER currentTime; + QueryPerformanceCounter(¤tTime); + LONGLONG elapsedTime = currentTime.QuadPart - + mStartTime.QuadPart; + + // Compute the number of millisecond ticks elapsed. + unsigned long msecTicks = (unsigned long)(1000 * elapsedTime / + mClockFrequency.QuadPart); + + // Check for unexpected leaps in the Win32 performance counter. + // (This is caused by unexpected data across the PCI to ISA + // bridge, aka south bridge. See Microsoft KB274323.) + unsigned long elapsedTicks = GetTickCount() - mStartTick; + signed long msecOff = (signed long)(msecTicks - elapsedTicks); + if (msecOff < -100 || msecOff > 100) + { + // Adjust the starting time forwards. + LONGLONG msecAdjustment = mymin(msecOff * + mClockFrequency.QuadPart / 1000, elapsedTime - + mPrevElapsedTime); + mStartTime.QuadPart += msecAdjustment; + elapsedTime -= msecAdjustment; + + // Recompute the number of millisecond ticks elapsed. + msecTicks = (unsigned long)(1000 * elapsedTime / + mClockFrequency.QuadPart); + } + + // Store the current elapsed time for adjustments next time. + mPrevElapsedTime = elapsedTime; + + return msecTicks; +#else + +#ifdef __CELLOS_LV2__ + __int64 freq=sys_time_get_timebase_frequency(); + double dFreq=((double) freq) / 1000.0; + typedef uint64_t __int64; + typedef __int64 ClockSize; + ClockSize newTime; + __asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory"); + + return (newTime-mStartTime) / dFreq; +#else + + struct timeval currentTime; + gettimeofday(¤tTime, 0); + return (currentTime.tv_sec - mStartTime.tv_sec) * 1000 + + (currentTime.tv_usec - mStartTime.tv_usec) / 1000; +#endif //__CELLOS_LV2__ +#endif + } + + /// Returns the time in us since the last call to reset or since + /// the Clock was created. + unsigned long int getTimeMicroseconds() + { +#ifdef USE_WINDOWS_TIMERS + LARGE_INTEGER currentTime; + QueryPerformanceCounter(¤tTime); + LONGLONG elapsedTime = currentTime.QuadPart - + mStartTime.QuadPart; + + // Compute the number of millisecond ticks elapsed. + unsigned long msecTicks = (unsigned long)(1000 * elapsedTime / + mClockFrequency.QuadPart); + + // Check for unexpected leaps in the Win32 performance counter. + // (This is caused by unexpected data across the PCI to ISA + // bridge, aka south bridge. See Microsoft KB274323.) + unsigned long elapsedTicks = GetTickCount() - mStartTick; + signed long msecOff = (signed long)(msecTicks - elapsedTicks); + if (msecOff < -100 || msecOff > 100) + { + // Adjust the starting time forwards. + LONGLONG msecAdjustment = mymin(msecOff * + mClockFrequency.QuadPart / 1000, elapsedTime - + mPrevElapsedTime); + mStartTime.QuadPart += msecAdjustment; + elapsedTime -= msecAdjustment; + } + + // Store the current elapsed time for adjustments next time. + mPrevElapsedTime = elapsedTime; + + // Convert to microseconds. + unsigned long usecTicks = (unsigned long)(1000000 * elapsedTime / + mClockFrequency.QuadPart); + + return usecTicks; +#else + +#ifdef __CELLOS_LV2__ + __int64 freq=sys_time_get_timebase_frequency(); + double dFreq=((double) freq)/ 1000000.0; + typedef uint64_t __int64; + typedef __int64 ClockSize; + ClockSize newTime; + __asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory"); + + return (newTime-mStartTime) / dFreq; +#else + + struct timeval currentTime; + gettimeofday(¤tTime, 0); + return (currentTime.tv_sec - mStartTime.tv_sec) * 1000000 + + (currentTime.tv_usec - mStartTime.tv_usec); +#endif//__CELLOS_LV2__ +#endif + } + + private: +#ifdef USE_WINDOWS_TIMERS + LARGE_INTEGER mClockFrequency; + DWORD mStartTick; + LONGLONG mPrevElapsedTime; + LARGE_INTEGER mStartTime; +#else +#ifdef __CELLOS_LV2__ + uint64_t mStartTime; +#else + struct timeval mStartTime; +#endif +#endif //__CELLOS_LV2__ + + }; + +#endif //USE_BT_CLOCK + + +#ifdef USE_QUICKPROF + + +#include +#include +#include +#include + + + + +namespace hidden +{ + /// A simple data structure representing a single timed block + /// of code. + struct ProfileBlock + { + ProfileBlock() + { + currentBlockStartMicroseconds = 0; + currentCycleTotalMicroseconds = 0; + lastCycleTotalMicroseconds = 0; + totalMicroseconds = 0; + } + + /// The starting time (in us) of the current block update. + unsigned long int currentBlockStartMicroseconds; + + /// The accumulated time (in us) spent in this block during the + /// current profiling cycle. + unsigned long int currentCycleTotalMicroseconds; + + /// The accumulated time (in us) spent in this block during the + /// past profiling cycle. + unsigned long int lastCycleTotalMicroseconds; + + /// The total accumulated time (in us) spent in this block. + unsigned long int totalMicroseconds; + }; + +}; + +/// A static class that manages timing for a set of profiling blocks. +class btProfiler +{ +public: + /// A set of ways to retrieve block timing data. + enum BlockTimingMethod + { + /// The total time spent in the block (in seconds) since the + /// profiler was initialized. + BLOCK_TOTAL_SECONDS, + + /// The total time spent in the block (in ms) since the + /// profiler was initialized. + BLOCK_TOTAL_MILLISECONDS, + + /// The total time spent in the block (in us) since the + /// profiler was initialized. + BLOCK_TOTAL_MICROSECONDS, + + /// The total time spent in the block, as a % of the total + /// elapsed time since the profiler was initialized. + BLOCK_TOTAL_PERCENT, + + /// The time spent in the block (in seconds) in the most recent + /// profiling cycle. + BLOCK_CYCLE_SECONDS, + + /// The time spent in the block (in ms) in the most recent + /// profiling cycle. + BLOCK_CYCLE_MILLISECONDS, + + /// The time spent in the block (in us) in the most recent + /// profiling cycle. + BLOCK_CYCLE_MICROSECONDS, + + /// The time spent in the block (in seconds) in the most recent + /// profiling cycle, as a % of the total cycle time. + BLOCK_CYCLE_PERCENT + }; + + /// Initializes the profiler. This must be called first. If this is + /// never called, the profiler is effectively disabled; all other + /// functions will return immediately. The first parameter + /// is the name of an output data file; if this string is not empty, + /// data will be saved on every profiling cycle; if this string is + /// empty, no data will be saved to a file. The second parameter + /// determines which timing method is used when printing data to the + /// output file. + inline static void init(const std::string outputFilename="", + BlockTimingMethod outputMethod=BLOCK_CYCLE_MILLISECONDS); + + /// Cleans up allocated memory. + inline static void destroy(); + + /// Begins timing the named block of code. + inline static void beginBlock(const std::string& name); + + /// Updates the accumulated time spent in the named block by adding + /// the elapsed time since the last call to startBlock for this block + /// name. + inline static void endBlock(const std::string& name); + + /// Returns the time spent in the named block according to the + /// given timing method. See comments on BlockTimingMethod for details. + inline static double getBlockTime(const std::string& name, + BlockTimingMethod method=BLOCK_CYCLE_MILLISECONDS); + + /// Defines the end of a profiling cycle. Use this regularly if you + /// want to generate detailed timing information. This must not be + /// called within a timing block. + inline static void endProfilingCycle(); + + /// A helper function that creates a string of statistics for + /// each timing block. This is mainly for printing an overall + /// summary to the command line. + inline static std::string createStatsString( + BlockTimingMethod method=BLOCK_TOTAL_PERCENT); + +//private: + inline btProfiler(); + + inline ~btProfiler(); + + /// Prints an error message to standard output. + inline static void printError(const std::string& msg) + { + //btAssert(0); + std::cout << "[QuickProf error] " << msg << std::endl; + } + + /// Determines whether the profiler is enabled. + static bool mEnabled; + + /// The clock used to time profile blocks. + static btClock mClock; + + /// The starting time (in us) of the current profiling cycle. + static unsigned long int mCurrentCycleStartMicroseconds; + + /// The duration (in us) of the most recent profiling cycle. + static unsigned long int mLastCycleDurationMicroseconds; + + /// Internal map of named profile blocks. + static std::map mProfileBlocks; + + /// The data file used if this feature is enabled in 'init.' + static std::ofstream mOutputFile; + + /// Tracks whether we have begun print data to the output file. + static bool mFirstFileOutput; + + /// The method used when printing timing data to an output file. + static BlockTimingMethod mFileOutputMethod; + + /// The number of the current profiling cycle. + static unsigned long int mCycleNumber; +}; + + +btProfiler::btProfiler() +{ + // This never gets called because a btProfiler instance is never + // created. +} + +btProfiler::~btProfiler() +{ + // This never gets called because a btProfiler instance is never + // created. +} + +void btProfiler::init(const std::string outputFilename, + BlockTimingMethod outputMethod) +{ + mEnabled = true; + + if (!outputFilename.empty()) + { + mOutputFile.open(outputFilename.c_str()); + } + + mFileOutputMethod = outputMethod; + + mClock.reset(); + + // Set the start time for the first cycle. + mCurrentCycleStartMicroseconds = mClock.getTimeMicroseconds(); +} + +void btProfiler::destroy() +{ + if (!mEnabled) + { + return; + } + + if (mOutputFile.is_open()) + { + mOutputFile.close(); + } + + // Destroy all ProfileBlocks. + while (!mProfileBlocks.empty()) + { + delete (*mProfileBlocks.begin()).second; + mProfileBlocks.erase(mProfileBlocks.begin()); + } +} + +void btProfiler::beginBlock(const std::string& name) +{ + if (!mEnabled) + { + return; + } + + if (name.empty()) + { + printError("Cannot allow unnamed profile blocks."); + return; + } + + hidden::ProfileBlock* block = mProfileBlocks[name]; + + if (!block) + { + // Create a new ProfileBlock. + mProfileBlocks[name] = new hidden::ProfileBlock(); + block = mProfileBlocks[name]; + } + + // We do this at the end to get more accurate results. + block->currentBlockStartMicroseconds = mClock.getTimeMicroseconds(); +} + +void btProfiler::endBlock(const std::string& name) +{ + if (!mEnabled) + { + return; + } + + // We do this at the beginning to get more accurate results. + unsigned long int endTick = mClock.getTimeMicroseconds(); + + hidden::ProfileBlock* block = mProfileBlocks[name]; + + if (!block) + { + // The named block does not exist. Print an error. + printError("The profile block named '" + name + + "' does not exist."); + return; + } + + unsigned long int blockDuration = endTick - + block->currentBlockStartMicroseconds; + block->currentCycleTotalMicroseconds += blockDuration; + block->totalMicroseconds += blockDuration; +} + +double btProfiler::getBlockTime(const std::string& name, + BlockTimingMethod method) +{ + if (!mEnabled) + { + return 0; + } + + hidden::ProfileBlock* block = mProfileBlocks[name]; + + if (!block) + { + // The named block does not exist. Print an error. + printError("The profile block named '" + name + + "' does not exist."); + return 0; + } + + double result = 0; + + switch(method) + { + case BLOCK_TOTAL_SECONDS: + result = (double)block->totalMicroseconds * (double)0.000001; + break; + case BLOCK_TOTAL_MILLISECONDS: + result = (double)block->totalMicroseconds * (double)0.001; + break; + case BLOCK_TOTAL_MICROSECONDS: + result = (double)block->totalMicroseconds; + break; + case BLOCK_TOTAL_PERCENT: + { + double timeSinceInit = (double)mClock.getTimeMicroseconds(); + if (timeSinceInit <= 0) + { + result = 0; + } + else + { + result = 100.0 * (double)block->totalMicroseconds / + timeSinceInit; + } + break; + } + case BLOCK_CYCLE_SECONDS: + result = (double)block->lastCycleTotalMicroseconds * + (double)0.000001; + break; + case BLOCK_CYCLE_MILLISECONDS: + result = (double)block->lastCycleTotalMicroseconds * + (double)0.001; + break; + case BLOCK_CYCLE_MICROSECONDS: + result = (double)block->lastCycleTotalMicroseconds; + break; + case BLOCK_CYCLE_PERCENT: + { + if (0 == mLastCycleDurationMicroseconds) + { + // We have not yet finished a cycle, so just return zero + // percent to avoid a divide by zero error. + result = 0; + } + else + { + result = 100.0 * (double)block->lastCycleTotalMicroseconds / + mLastCycleDurationMicroseconds; + } + break; + } + default: + break; + } + + return result; +} + +void btProfiler::endProfilingCycle() +{ + if (!mEnabled) + { + return; + } + + // Store the duration of the cycle that just finished. + mLastCycleDurationMicroseconds = mClock.getTimeMicroseconds() - + mCurrentCycleStartMicroseconds; + + // For each block, update data for the cycle that just finished. + std::map::iterator iter; + for (iter = mProfileBlocks.begin(); iter != mProfileBlocks.end(); ++iter) + { + hidden::ProfileBlock* block = (*iter).second; + block->lastCycleTotalMicroseconds = + block->currentCycleTotalMicroseconds; + block->currentCycleTotalMicroseconds = 0; + } + + if (mOutputFile.is_open()) + { + // Print data to the output file. + if (mFirstFileOutput) + { + // On the first iteration, print a header line that shows the + // names of each profiling block. + mOutputFile << "#cycle, "; + + for (iter = mProfileBlocks.begin(); iter != mProfileBlocks.end(); + ++iter) + { + mOutputFile << (*iter).first << ", "; + } + + mOutputFile << std::endl; + mFirstFileOutput = false; + } + + mOutputFile << mCycleNumber << ", "; + + for (iter = mProfileBlocks.begin(); iter != mProfileBlocks.end(); + ++iter) + { + mOutputFile << getBlockTime((*iter).first, mFileOutputMethod) + << ", "; + } + + mOutputFile << std::endl; + } + + ++mCycleNumber; + mCurrentCycleStartMicroseconds = mClock.getTimeMicroseconds(); +} + +std::string btProfiler::createStatsString(BlockTimingMethod method) +{ + if (!mEnabled) + { + return ""; + } + + std::string s; + std::string suffix; + + switch(method) + { + case BLOCK_TOTAL_SECONDS: + suffix = "s"; + break; + case BLOCK_TOTAL_MILLISECONDS: + suffix = "ms"; + break; + case BLOCK_TOTAL_MICROSECONDS: + suffix = "us"; + break; + case BLOCK_TOTAL_PERCENT: + { + suffix = "%"; + break; + } + case BLOCK_CYCLE_SECONDS: + suffix = "s"; + break; + case BLOCK_CYCLE_MILLISECONDS: + suffix = "ms"; + break; + case BLOCK_CYCLE_MICROSECONDS: + suffix = "us"; + break; + case BLOCK_CYCLE_PERCENT: + { + suffix = "%"; + break; + } + default: + break; + } + + std::map::iterator iter; + for (iter = mProfileBlocks.begin(); iter != mProfileBlocks.end(); ++iter) + { + if (iter != mProfileBlocks.begin()) + { + s += "\n"; + } + + char blockTime[64]; + sprintf(blockTime, "%lf", getBlockTime((*iter).first, method)); + + s += (*iter).first; + s += ": "; + s += blockTime; + s += " "; + s += suffix; + } + + return s; +} + + +#define BEGIN_PROFILE(a) btProfiler::beginBlock(a) +#define END_PROFILE(a) btProfiler::endBlock(a) + +#else //USE_QUICKPROF +#define BEGIN_PROFILE(a) +#define END_PROFILE(a) + +#endif //USE_QUICKPROF + +#endif //QUICK_PROF_H + + diff --git a/src/bullet/src/LinearMath/btRandom.h b/src/bullet/src/LinearMath/btRandom.h new file mode 100644 index 000000000..fdf65e01c --- /dev/null +++ b/src/bullet/src/LinearMath/btRandom.h @@ -0,0 +1,42 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef GEN_RANDOM_H +#define GEN_RANDOM_H + +#ifdef MT19937 + +#include +#include + +#define GEN_RAND_MAX UINT_MAX + +SIMD_FORCE_INLINE void GEN_srand(unsigned int seed) { init_genrand(seed); } +SIMD_FORCE_INLINE unsigned int GEN_rand() { return genrand_int32(); } + +#else + +#include + +#define GEN_RAND_MAX RAND_MAX + +SIMD_FORCE_INLINE void GEN_srand(unsigned int seed) { srand(seed); } +SIMD_FORCE_INLINE unsigned int GEN_rand() { return rand(); } + +#endif + +#endif + diff --git a/src/bullet/src/LinearMath/btScalar.h b/src/bullet/src/LinearMath/btScalar.h new file mode 100644 index 000000000..85dfaf3eb --- /dev/null +++ b/src/bullet/src/LinearMath/btScalar.h @@ -0,0 +1,394 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef SIMD___SCALAR_H +#define SIMD___SCALAR_H + +#include + +#include +#include +#include + + +inline int btGetVersion() +{ + return 264; +} + +#ifdef WIN32 + + #if defined(__MINGW32__) || defined(__CYGWIN__) || (defined (_MSC_VER) && _MSC_VER < 1300) + + #define SIMD_FORCE_INLINE inline + #define ATTRIBUTE_ALIGNED16(a) a + #define ATTRIBUTE_ALIGNED128(a) a + #else + #define BT_HAS_ALIGNED_ALLOCATOR + #pragma warning(disable:4530) + #pragma warning(disable:4996) + #pragma warning(disable:4786) + #define SIMD_FORCE_INLINE __forceinline + #define ATTRIBUTE_ALIGNED16(a) __declspec(align(16)) a + #define ATTRIBUTE_ALIGNED128(a) __declspec (align(128)) a + #ifdef _XBOX + #define BT_USE_VMX128 + + #include + #define BT_HAVE_NATIVE_FSEL + #define btFsel(a,b,c) __fsel((a),(b),(c)) + #else + #define BT_USE_SSE + #endif + #endif //__MINGW32__ + + #include + #define btAssert assert + //btFullAssert is optional, slows down a lot + #define btFullAssert(x) + + #define btLikely(_c) _c + #define btUnlikely(_c) _c + +#else + +#if defined (__CELLOS_LV2__) + #define SIMD_FORCE_INLINE inline + #define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16))) + #define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128))) + #ifndef assert + #include + #endif + #define btAssert assert + //btFullAssert is optional, slows down a lot + #define btFullAssert(x) + + #define btLikely(_c) _c + #define btUnlikely(_c) _c + +#else + +#ifdef USE_LIBSPE2 + + #define SIMD_FORCE_INLINE __inline + #define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16))) + #define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128))) + #ifndef assert + #include + #endif + #define btAssert assert + //btFullAssert is optional, slows down a lot + #define btFullAssert(x) + + + #define btLikely(_c) __builtin_expect((_c), 1) + #define btUnlikely(_c) __builtin_expect((_c), 0) + + +#else + //non-windows systems + + #define SIMD_FORCE_INLINE inline + #define ATTRIBUTE_ALIGNED16(a) a + #define ATTRIBUTE_ALIGNED128(a) a + #ifndef assert + #include + #endif + #define btAssert assert + //btFullAssert is optional, slows down a lot + #define btFullAssert(x) + + +#endif // LIBSPE2 + +#endif //__CELLOS_LV2__ +#endif + +/// older compilers (gcc 3.x) and Sun needs double version of sqrt etc. +/// exclude Apple Intel (i's assumed to be a Macbook or new Intel Dual Core Processor) +#if defined (__sun) || defined (__sun__) || defined (__sparc) || (defined (__APPLE__) && ! defined (__i386__)) +//use slow double float precision operation on those platforms +#ifndef BT_USE_DOUBLE_PRECISION +#define BT_FORCE_DOUBLE_FUNCTIONS +#endif +#endif + +#if defined(BT_USE_DOUBLE_PRECISION) +typedef double btScalar; +#else +typedef float btScalar; +#endif + + +#define BT_DECLARE_ALIGNED_ALLOCATOR() \ + SIMD_FORCE_INLINE void* operator new(size_t sizeInBytes) { return btAlignedAlloc(sizeInBytes,16); } \ + SIMD_FORCE_INLINE void operator delete(void* ptr) { btAlignedFree(ptr); } \ + SIMD_FORCE_INLINE void* operator new(size_t, void* ptr) { return ptr; } \ + SIMD_FORCE_INLINE void operator delete(void*, void*) { } \ + + + +#if defined(BT_USE_DOUBLE_PRECISION) || defined(BT_FORCE_DOUBLE_FUNCTIONS) + +SIMD_FORCE_INLINE btScalar btSqrt(btScalar x) { return sqrt(x); } +SIMD_FORCE_INLINE btScalar btFabs(btScalar x) { return fabs(x); } +SIMD_FORCE_INLINE btScalar btCos(btScalar x) { return cos(x); } +SIMD_FORCE_INLINE btScalar btSin(btScalar x) { return sin(x); } +SIMD_FORCE_INLINE btScalar btTan(btScalar x) { return tan(x); } +SIMD_FORCE_INLINE btScalar btAcos(btScalar x) { return acos(x); } +SIMD_FORCE_INLINE btScalar btAsin(btScalar x) { return asin(x); } +SIMD_FORCE_INLINE btScalar btAtan(btScalar x) { return atan(x); } +SIMD_FORCE_INLINE btScalar btAtan2(btScalar x, btScalar y) { return atan2(x, y); } +SIMD_FORCE_INLINE btScalar btExp(btScalar x) { return exp(x); } +SIMD_FORCE_INLINE btScalar btLog(btScalar x) { return log(x); } +SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return pow(x,y); } + +#else + +SIMD_FORCE_INLINE btScalar btSqrt(btScalar y) +{ +#ifdef USE_APPROXIMATION + double x, z, tempf; + unsigned long *tfptr = ((unsigned long *)&tempf) + 1; + + tempf = y; + *tfptr = (0xbfcdd90a - *tfptr)>>1; /* estimate of 1/sqrt(y) */ + x = tempf; + z = y*btScalar(0.5); /* hoist out the “/2” */ + x = (btScalar(1.5)*x)-(x*x)*(x*z); /* iteration formula */ + x = (btScalar(1.5)*x)-(x*x)*(x*z); + x = (btScalar(1.5)*x)-(x*x)*(x*z); + x = (btScalar(1.5)*x)-(x*x)*(x*z); + x = (btScalar(1.5)*x)-(x*x)*(x*z); + return x*y; +#else + return sqrtf(y); +#endif +} +SIMD_FORCE_INLINE btScalar btFabs(btScalar x) { return fabsf(x); } +SIMD_FORCE_INLINE btScalar btCos(btScalar x) { return cosf(x); } +SIMD_FORCE_INLINE btScalar btSin(btScalar x) { return sinf(x); } +SIMD_FORCE_INLINE btScalar btTan(btScalar x) { return tanf(x); } +SIMD_FORCE_INLINE btScalar btAcos(btScalar x) { + btAssert(x <= btScalar(1.)); + return acosf(x); +} +SIMD_FORCE_INLINE btScalar btAsin(btScalar x) { return asinf(x); } +SIMD_FORCE_INLINE btScalar btAtan(btScalar x) { return atanf(x); } +SIMD_FORCE_INLINE btScalar btAtan2(btScalar x, btScalar y) { return atan2f(x, y); } +SIMD_FORCE_INLINE btScalar btExp(btScalar x) { return expf(x); } +SIMD_FORCE_INLINE btScalar btLog(btScalar x) { return logf(x); } +SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return powf(x,y); } + +#endif + +#define SIMD_2_PI btScalar(6.283185307179586232) +#define SIMD_PI (SIMD_2_PI * btScalar(0.5)) +#define SIMD_HALF_PI (SIMD_2_PI * btScalar(0.25)) +#define SIMD_RADS_PER_DEG (SIMD_2_PI / btScalar(360.0)) +#define SIMD_DEGS_PER_RAD (btScalar(360.0) / SIMD_2_PI) + +#ifdef BT_USE_DOUBLE_PRECISION +#define SIMD_EPSILON DBL_EPSILON +#define SIMD_INFINITY DBL_MAX +#else +#define SIMD_EPSILON FLT_EPSILON +#define SIMD_INFINITY FLT_MAX +#endif + +SIMD_FORCE_INLINE btScalar btAtan2Fast(btScalar y, btScalar x) +{ + btScalar coeff_1 = SIMD_PI / 4.0f; + btScalar coeff_2 = 3.0f * coeff_1; + btScalar abs_y = btFabs(y); + btScalar angle; + if (x >= 0.0f) { + btScalar r = (x - abs_y) / (x + abs_y); + angle = coeff_1 - coeff_1 * r; + } else { + btScalar r = (x + abs_y) / (abs_y - x); + angle = coeff_2 - coeff_1 * r; + } + return (y < 0.0f) ? -angle : angle; +} + +SIMD_FORCE_INLINE bool btFuzzyZero(btScalar x) { return btFabs(x) < SIMD_EPSILON; } + +SIMD_FORCE_INLINE bool btEqual(btScalar a, btScalar eps) { + return (((a) <= eps) && !((a) < -eps)); +} +SIMD_FORCE_INLINE bool btGreaterEqual (btScalar a, btScalar eps) { + return (!((a) <= eps)); +} + + +SIMD_FORCE_INLINE int btIsNegative(btScalar x) { + return x < btScalar(0.0) ? 1 : 0; +} + +SIMD_FORCE_INLINE btScalar btRadians(btScalar x) { return x * SIMD_RADS_PER_DEG; } +SIMD_FORCE_INLINE btScalar btDegrees(btScalar x) { return x * SIMD_DEGS_PER_RAD; } + +#define BT_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name + +#ifndef btFsel +SIMD_FORCE_INLINE btScalar btFsel(btScalar a, btScalar b, btScalar c) +{ + return a >= 0 ? b : c; +} +#endif +#define btFsels(a,b,c) (btScalar)btFsel(a,b,c) + + +SIMD_FORCE_INLINE bool btMachineIsLittleEndian() +{ + long int i = 1; + const char *p = (const char *) &i; + if (p[0] == 1) // Lowest address contains the least significant byte + return true; + else + return false; +} + + + +///btSelect avoids branches, which makes performance much better for consoles like Playstation 3 and XBox 360 +///Thanks Phil Knight. See also http://www.cellperformance.com/articles/2006/04/more_techniques_for_eliminatin_1.html +SIMD_FORCE_INLINE unsigned btSelect(unsigned condition, unsigned valueIfConditionNonZero, unsigned valueIfConditionZero) +{ + // Set testNz to 0xFFFFFFFF if condition is nonzero, 0x00000000 if condition is zero + // Rely on positive value or'ed with its negative having sign bit on + // and zero value or'ed with its negative (which is still zero) having sign bit off + // Use arithmetic shift right, shifting the sign bit through all 32 bits + unsigned testNz = (unsigned)(((int)condition | -(int)condition) >> 31); + unsigned testEqz = ~testNz; + return ((valueIfConditionNonZero & testNz) | (valueIfConditionZero & testEqz)); +} +SIMD_FORCE_INLINE int btSelect(unsigned condition, int valueIfConditionNonZero, int valueIfConditionZero) +{ + unsigned testNz = (unsigned)(((int)condition | -(int)condition) >> 31); + unsigned testEqz = ~testNz; + return ((valueIfConditionNonZero & testNz) | (valueIfConditionZero & testEqz)); +} +SIMD_FORCE_INLINE float btSelect(unsigned condition, float valueIfConditionNonZero, float valueIfConditionZero) +{ +#ifdef BT_HAVE_NATIVE_FSEL + return (float)btFsel((btScalar)condition - btScalar(1.0f), valueIfConditionNonZero, valueIfConditionZero); +#else + return (condition != 0) ? valueIfConditionNonZero : valueIfConditionZero; +#endif +} + +template SIMD_FORCE_INLINE void btSwap(T& a, T& b) +{ + T tmp = a; + a = b; + b = tmp; +} + + +//PCK: endian swapping functions +SIMD_FORCE_INLINE unsigned btSwapEndian(unsigned val) +{ + return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24)); +} + +SIMD_FORCE_INLINE unsigned short btSwapEndian(unsigned short val) +{ + return (((val & 0xff00) >> 8) | ((val & 0x00ff) << 8)); +} + +SIMD_FORCE_INLINE unsigned btSwapEndian(int val) +{ + return btSwapEndian((unsigned)val); +} + +SIMD_FORCE_INLINE unsigned short btSwapEndian(short val) +{ + return btSwapEndian((unsigned short) val); +} + +///btSwapFloat uses using char pointers to swap the endianness +////btSwapFloat/btSwapDouble will NOT return a float, because the machine might 'correct' invalid floating point values +///Not all values of sign/exponent/mantissa are valid floating point numbers according to IEEE 754. +///When a floating point unit is faced with an invalid value, it may actually change the value, or worse, throw an exception. +///In most systems, running user mode code, you wouldn't get an exception, but instead the hardware/os/runtime will 'fix' the number for you. +///so instead of returning a float/double, we return integer/long long integer +SIMD_FORCE_INLINE unsigned int btSwapEndianFloat(float d) +{ + unsigned int a; + unsigned char *dst = (unsigned char *)&a; + unsigned char *src = (unsigned char *)&d; + + dst[0] = src[3]; + dst[1] = src[2]; + dst[2] = src[1]; + dst[3] = src[0]; + return a; +} + +// unswap using char pointers +SIMD_FORCE_INLINE float btUnswapEndianFloat(unsigned int a) +{ + float d; + unsigned char *src = (unsigned char *)&a; + unsigned char *dst = (unsigned char *)&d; + + dst[0] = src[3]; + dst[1] = src[2]; + dst[2] = src[1]; + dst[3] = src[0]; + + return d; +} + + +// swap using char pointers +SIMD_FORCE_INLINE void btSwapEndianDouble(double d, unsigned char* dst) +{ + unsigned char *src = (unsigned char *)&d; + + dst[0] = src[7]; + dst[1] = src[6]; + dst[2] = src[5]; + dst[3] = src[4]; + dst[4] = src[3]; + dst[5] = src[2]; + dst[6] = src[1]; + dst[7] = src[0]; + +} + +// unswap using char pointers +SIMD_FORCE_INLINE double btUnswapEndianDouble(const unsigned char *src) +{ + double d; + unsigned char *dst = (unsigned char *)&d; + + dst[0] = src[7]; + dst[1] = src[6]; + dst[2] = src[5]; + dst[3] = src[4]; + dst[4] = src[3]; + dst[5] = src[2]; + dst[6] = src[1]; + dst[7] = src[0]; + + return d; +} + + +#endif //SIMD___SCALAR_H diff --git a/src/bullet/src/LinearMath/btStackAlloc.h b/src/bullet/src/LinearMath/btStackAlloc.h new file mode 100644 index 000000000..ebdc43004 --- /dev/null +++ b/src/bullet/src/LinearMath/btStackAlloc.h @@ -0,0 +1,115 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +/* +StackAlloc extracted from GJK-EPA collision solver by Nathanael Presson +Nov.2006 +*/ + +#ifndef BT_STACK_ALLOC +#define BT_STACK_ALLOC + +#include "btScalar.h" //for btAssert +#include "btAlignedAllocator.h" + +struct btBlock +{ + btBlock* previous; + unsigned char* address; +}; + +///StackAlloc provides some fast stack-based memory allocator (LIFO last-in first-out) +class btStackAlloc +{ +public: + + btStackAlloc(unsigned int size) { ctor();create(size); } + ~btStackAlloc() { destroy(); } + + inline void create(unsigned int size) + { + destroy(); + data = (unsigned char*) btAlignedAlloc(size,16); + totalsize = size; + } + inline void destroy() + { + btAssert(usedsize==0); + //Raise(L"StackAlloc is still in use"); + + if(usedsize==0) + { + if(!ischild && data) + btAlignedFree(data); + + data = 0; + usedsize = 0; + } + + } + + int getAvailableMemory() const + { + return totalsize - usedsize; + } + + unsigned char* allocate(unsigned int size) + { + const unsigned int nus(usedsize+size); + if(nusprevious = current; + pb->address = data+usedsize; + current = pb; + return(pb); + } + SIMD_FORCE_INLINE void endBlock(btBlock* block) + { + btAssert(block==current); + //Raise(L"Unmatched blocks"); + if(block==current) + { + current = block->previous; + usedsize = (unsigned int)((block->address-data)-sizeof(btBlock)); + } + } + +private: + void ctor() + { + data = 0; + totalsize = 0; + usedsize = 0; + current = 0; + ischild = false; + } + unsigned char* data; + unsigned int totalsize; + unsigned int usedsize; + btBlock* current; + bool ischild; +}; + +#endif //BT_STACK_ALLOC diff --git a/src/bullet/src/LinearMath/btTransform.h b/src/bullet/src/LinearMath/btTransform.h new file mode 100644 index 000000000..883b3a5d2 --- /dev/null +++ b/src/bullet/src/LinearMath/btTransform.h @@ -0,0 +1,200 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef btTransform_H +#define btTransform_H + +#include "btVector3.h" +#include "btMatrix3x3.h" + + +///btTransform supports rigid transforms (only translation and rotation, no scaling/shear) +class btTransform { + + +public: + + + btTransform() {} + + explicit SIMD_FORCE_INLINE btTransform(const btQuaternion& q, + const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0))) + : m_basis(q), + m_origin(c) + {} + + explicit SIMD_FORCE_INLINE btTransform(const btMatrix3x3& b, + const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0))) + : m_basis(b), + m_origin(c) + {} + + SIMD_FORCE_INLINE btTransform (const btTransform& other) + : m_basis(other.m_basis), + m_origin(other.m_origin) + { + } + + SIMD_FORCE_INLINE btTransform& operator=(const btTransform& other) + { + m_basis = other.m_basis; + m_origin = other.m_origin; + return *this; + } + + + SIMD_FORCE_INLINE void mult(const btTransform& t1, const btTransform& t2) { + m_basis = t1.m_basis * t2.m_basis; + m_origin = t1(t2.m_origin); + } + +/* void multInverseLeft(const btTransform& t1, const btTransform& t2) { + btVector3 v = t2.m_origin - t1.m_origin; + m_basis = btMultTransposeLeft(t1.m_basis, t2.m_basis); + m_origin = v * t1.m_basis; + } + */ + + + SIMD_FORCE_INLINE btVector3 operator()(const btVector3& x) const + { + return btVector3(m_basis[0].dot(x) + m_origin.x(), + m_basis[1].dot(x) + m_origin.y(), + m_basis[2].dot(x) + m_origin.z()); + } + + SIMD_FORCE_INLINE btVector3 operator*(const btVector3& x) const + { + return (*this)(x); + } + + SIMD_FORCE_INLINE btMatrix3x3& getBasis() { return m_basis; } + SIMD_FORCE_INLINE const btMatrix3x3& getBasis() const { return m_basis; } + + SIMD_FORCE_INLINE btVector3& getOrigin() { return m_origin; } + SIMD_FORCE_INLINE const btVector3& getOrigin() const { return m_origin; } + + btQuaternion getRotation() const { + btQuaternion q; + m_basis.getRotation(q); + return q; + } + + + void setFromOpenGLMatrix(const btScalar *m) + { + m_basis.setFromOpenGLSubMatrix(m); + m_origin.setValue(m[12],m[13],m[14]); + } + + void getOpenGLMatrix(btScalar *m) const + { + m_basis.getOpenGLSubMatrix(m); + m[12] = m_origin.x(); + m[13] = m_origin.y(); + m[14] = m_origin.z(); + m[15] = btScalar(1.0); + } + + SIMD_FORCE_INLINE void setOrigin(const btVector3& origin) + { + m_origin = origin; + } + + SIMD_FORCE_INLINE btVector3 invXform(const btVector3& inVec) const; + + + + SIMD_FORCE_INLINE void setBasis(const btMatrix3x3& basis) + { + m_basis = basis; + } + + SIMD_FORCE_INLINE void setRotation(const btQuaternion& q) + { + m_basis.setRotation(q); + } + + + + void setIdentity() + { + m_basis.setIdentity(); + m_origin.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0)); + } + + + btTransform& operator*=(const btTransform& t) + { + m_origin += m_basis * t.m_origin; + m_basis *= t.m_basis; + return *this; + } + + btTransform inverse() const + { + btMatrix3x3 inv = m_basis.transpose(); + return btTransform(inv, inv * -m_origin); + } + + btTransform inverseTimes(const btTransform& t) const; + + btTransform operator*(const btTransform& t) const; + + static btTransform getIdentity() + { + btTransform tr; + tr.setIdentity(); + return tr; + } + +private: + + btMatrix3x3 m_basis; + btVector3 m_origin; +}; + + +SIMD_FORCE_INLINE btVector3 +btTransform::invXform(const btVector3& inVec) const +{ + btVector3 v = inVec - m_origin; + return (m_basis.transpose() * v); +} + +SIMD_FORCE_INLINE btTransform +btTransform::inverseTimes(const btTransform& t) const +{ + btVector3 v = t.getOrigin() - m_origin; + return btTransform(m_basis.transposeTimes(t.m_basis), + v * m_basis); +} + +SIMD_FORCE_INLINE btTransform +btTransform::operator*(const btTransform& t) const +{ + return btTransform(m_basis * t.m_basis, + (*this)(t.m_origin)); +} + + + +#endif + + + + + diff --git a/src/bullet/src/LinearMath/btTransformUtil.h b/src/bullet/src/LinearMath/btTransformUtil.h new file mode 100644 index 000000000..d39e2e100 --- /dev/null +++ b/src/bullet/src/LinearMath/btTransformUtil.h @@ -0,0 +1,142 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef SIMD_TRANSFORM_UTIL_H +#define SIMD_TRANSFORM_UTIL_H + +#include "btTransform.h" +#define ANGULAR_MOTION_THRESHOLD btScalar(0.5)*SIMD_HALF_PI + + + +#define SIMDSQRT12 btScalar(0.7071067811865475244008443621048490) + +#define btRecipSqrt(x) ((btScalar)(btScalar(1.0)/btSqrt(btScalar(x)))) /* reciprocal square root */ + +SIMD_FORCE_INLINE btVector3 btAabbSupport(const btVector3& halfExtents,const btVector3& supportDir) +{ + return btVector3(supportDir.x() < btScalar(0.0) ? -halfExtents.x() : halfExtents.x(), + supportDir.y() < btScalar(0.0) ? -halfExtents.y() : halfExtents.y(), + supportDir.z() < btScalar(0.0) ? -halfExtents.z() : halfExtents.z()); +} + + +SIMD_FORCE_INLINE void btPlaneSpace1 (const btVector3& n, btVector3& p, btVector3& q) +{ + if (btFabs(n.z()) > SIMDSQRT12) { + // choose p in y-z plane + btScalar a = n[1]*n[1] + n[2]*n[2]; + btScalar k = btRecipSqrt (a); + p.setValue(0,-n[2]*k,n[1]*k); + // set q = n x p + q.setValue(a*k,-n[0]*p[2],n[0]*p[1]); + } + else { + // choose p in x-y plane + btScalar a = n.x()*n.x() + n.y()*n.y(); + btScalar k = btRecipSqrt (a); + p.setValue(-n.y()*k,n.x()*k,0); + // set q = n x p + q.setValue(-n.z()*p.y(),n.z()*p.x(),a*k); + } +} + + + +/// Utils related to temporal transforms +class btTransformUtil +{ + +public: + + static void integrateTransform(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep,btTransform& predictedTransform) + { + predictedTransform.setOrigin(curTrans.getOrigin() + linvel * timeStep); +// #define QUATERNION_DERIVATIVE + #ifdef QUATERNION_DERIVATIVE + btQuaternion predictedOrn = curTrans.getRotation(); + predictedOrn += (angvel * predictedOrn) * (timeStep * btScalar(0.5)); + predictedOrn.normalize(); + #else + //exponential map + btVector3 axis; + btScalar fAngle = angvel.length(); + //limit the angular motion + if (fAngle*timeStep > ANGULAR_MOTION_THRESHOLD) + { + fAngle = ANGULAR_MOTION_THRESHOLD / timeStep; + } + + if ( fAngle < btScalar(0.001) ) + { + // use Taylor's expansions of sync function + axis = angvel*( btScalar(0.5)*timeStep-(timeStep*timeStep*timeStep)*(btScalar(0.020833333333))*fAngle*fAngle ); + } + else + { + // sync(fAngle) = sin(c*fAngle)/t + axis = angvel*( btSin(btScalar(0.5)*fAngle*timeStep)/fAngle ); + } + btQuaternion dorn (axis.x(),axis.y(),axis.z(),btCos( fAngle*timeStep*btScalar(0.5) )); + btQuaternion orn0 = curTrans.getRotation(); + + btQuaternion predictedOrn = dorn * orn0; + predictedOrn.normalize(); + #endif + predictedTransform.setRotation(predictedOrn); + } + + static void calculateVelocity(const btTransform& transform0,const btTransform& transform1,btScalar timeStep,btVector3& linVel,btVector3& angVel) + { + linVel = (transform1.getOrigin() - transform0.getOrigin()) / timeStep; + btVector3 axis; + btScalar angle; + calculateDiffAxisAngle(transform0,transform1,axis,angle); + angVel = axis * angle / timeStep; + } + + static void calculateDiffAxisAngle(const btTransform& transform0,const btTransform& transform1,btVector3& axis,btScalar& angle) + { + + #ifdef USE_QUATERNION_DIFF + btQuaternion orn0 = transform0.getRotation(); + btQuaternion orn1a = transform1.getRotation(); + btQuaternion orn1 = orn0.farthest(orn1a); + btQuaternion dorn = orn1 * orn0.inverse(); +#else + btMatrix3x3 dmat = transform1.getBasis() * transform0.getBasis().inverse(); + btQuaternion dorn; + dmat.getRotation(dorn); +#endif//USE_QUATERNION_DIFF + + ///floating point inaccuracy can lead to w component > 1..., which breaks + + dorn.normalize(); + + angle = dorn.getAngle(); + axis = btVector3(dorn.x(),dorn.y(),dorn.z()); + axis[3] = btScalar(0.); + //check for axis length + btScalar len = axis.length2(); + if (len < SIMD_EPSILON*SIMD_EPSILON) + axis = btVector3(btScalar(1.),btScalar(0.),btScalar(0.)); + else + axis /= btSqrt(len); + } + +}; + +#endif //SIMD_TRANSFORM_UTIL_H + diff --git a/src/bullet/src/LinearMath/btVector3.h b/src/bullet/src/LinearMath/btVector3.h new file mode 100644 index 000000000..1e331272d --- /dev/null +++ b/src/bullet/src/LinearMath/btVector3.h @@ -0,0 +1,452 @@ +/* +Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + + +#ifndef SIMD__VECTOR3_H +#define SIMD__VECTOR3_H + +#include "btQuadWord.h" + +///btVector3 can be used to represent 3D points and vectors. +///It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user +///Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers +class btVector3 : public btQuadWord { + +public: + SIMD_FORCE_INLINE btVector3() {} + + SIMD_FORCE_INLINE btVector3(const btQuadWordStorage& q) + : btQuadWord(q) + { + } + + + SIMD_FORCE_INLINE btVector3(const btScalar& x, const btScalar& y, const btScalar& z) + :btQuadWord(x,y,z,btScalar(0.)) + { + } + +// SIMD_FORCE_INLINE btVector3(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w) +// : btQuadWord(x,y,z,w) +// { +// } + + + + SIMD_FORCE_INLINE btVector3& operator+=(const btVector3& v) + { + m_x += v.x(); m_y += v.y(); m_z += v.z(); + return *this; + } + + + + SIMD_FORCE_INLINE btVector3& operator-=(const btVector3& v) + { + m_x -= v.x(); m_y -= v.y(); m_z -= v.z(); + return *this; + } + + SIMD_FORCE_INLINE btVector3& operator*=(const btScalar& s) + { + m_x *= s; m_y *= s; m_z *= s; + return *this; + } + + SIMD_FORCE_INLINE btVector3& operator/=(const btScalar& s) + { + btFullAssert(s != btScalar(0.0)); + return *this *= btScalar(1.0) / s; + } + + SIMD_FORCE_INLINE btScalar dot(const btVector3& v) const + { + return m_x * v.x() + m_y * v.y() + m_z * v.z(); + } + + SIMD_FORCE_INLINE btScalar length2() const + { + return dot(*this); + } + + SIMD_FORCE_INLINE btScalar length() const + { + return btSqrt(length2()); + } + + SIMD_FORCE_INLINE btScalar distance2(const btVector3& v) const; + + SIMD_FORCE_INLINE btScalar distance(const btVector3& v) const; + + SIMD_FORCE_INLINE btVector3& normalize() + { + return *this /= length(); + } + + SIMD_FORCE_INLINE btVector3 normalized() const; + + SIMD_FORCE_INLINE btVector3 rotate( const btVector3& wAxis, const btScalar angle ); + + SIMD_FORCE_INLINE btScalar angle(const btVector3& v) const + { + btScalar s = btSqrt(length2() * v.length2()); + btFullAssert(s != btScalar(0.0)); + return btAcos(dot(v) / s); + } + + SIMD_FORCE_INLINE btVector3 absolute() const + { + return btVector3( + btFabs(m_x), + btFabs(m_y), + btFabs(m_z)); + } + + SIMD_FORCE_INLINE btVector3 cross(const btVector3& v) const + { + return btVector3( + m_y * v.z() - m_z * v.y(), + m_z * v.x() - m_x * v.z(), + m_x * v.y() - m_y * v.x()); + } + + SIMD_FORCE_INLINE btScalar triple(const btVector3& v1, const btVector3& v2) const + { + return m_x * (v1.y() * v2.z() - v1.z() * v2.y()) + + m_y * (v1.z() * v2.x() - v1.x() * v2.z()) + + m_z * (v1.x() * v2.y() - v1.y() * v2.x()); + } + + SIMD_FORCE_INLINE int minAxis() const + { + return m_x < m_y ? (m_x < m_z ? 0 : 2) : (m_y < m_z ? 1 : 2); + } + + SIMD_FORCE_INLINE int maxAxis() const + { + return m_x < m_y ? (m_y < m_z ? 2 : 1) : (m_x < m_z ? 2 : 0); + } + + SIMD_FORCE_INLINE int furthestAxis() const + { + return absolute().minAxis(); + } + + SIMD_FORCE_INLINE int closestAxis() const + { + return absolute().maxAxis(); + } + + SIMD_FORCE_INLINE void setInterpolate3(const btVector3& v0, const btVector3& v1, btScalar rt) + { + btScalar s = btScalar(1.0) - rt; + m_x = s * v0.x() + rt * v1.x(); + m_y = s * v0.y() + rt * v1.y(); + m_z = s * v0.z() + rt * v1.z(); + //don't do the unused w component + // m_co[3] = s * v0[3] + rt * v1[3]; + } + + SIMD_FORCE_INLINE btVector3 lerp(const btVector3& v, const btScalar& t) const + { + return btVector3(m_x + (v.x() - m_x) * t, + m_y + (v.y() - m_y) * t, + m_z + (v.z() - m_z) * t); + } + + + SIMD_FORCE_INLINE btVector3& operator*=(const btVector3& v) + { + m_x *= v.x(); m_y *= v.y(); m_z *= v.z(); + return *this; + } + + + +}; + +SIMD_FORCE_INLINE btVector3 +operator+(const btVector3& v1, const btVector3& v2) +{ + return btVector3(v1.x() + v2.x(), v1.y() + v2.y(), v1.z() + v2.z()); +} + +SIMD_FORCE_INLINE btVector3 +operator*(const btVector3& v1, const btVector3& v2) +{ + return btVector3(v1.x() * v2.x(), v1.y() * v2.y(), v1.z() * v2.z()); +} + +SIMD_FORCE_INLINE btVector3 +operator-(const btVector3& v1, const btVector3& v2) +{ + return btVector3(v1.x() - v2.x(), v1.y() - v2.y(), v1.z() - v2.z()); +} + +SIMD_FORCE_INLINE btVector3 +operator-(const btVector3& v) +{ + return btVector3(-v.x(), -v.y(), -v.z()); +} + +SIMD_FORCE_INLINE btVector3 +operator*(const btVector3& v, const btScalar& s) +{ + return btVector3(v.x() * s, v.y() * s, v.z() * s); +} + +SIMD_FORCE_INLINE btVector3 +operator*(const btScalar& s, const btVector3& v) +{ + return v * s; +} + +SIMD_FORCE_INLINE btVector3 +operator/(const btVector3& v, const btScalar& s) +{ + btFullAssert(s != btScalar(0.0)); + return v * (btScalar(1.0) / s); +} + +SIMD_FORCE_INLINE btVector3 +operator/(const btVector3& v1, const btVector3& v2) +{ + return btVector3(v1.x() / v2.x(),v1.y() / v2.y(),v1.z() / v2.z()); +} + +SIMD_FORCE_INLINE btScalar +dot(const btVector3& v1, const btVector3& v2) +{ + return v1.dot(v2); +} + + + +SIMD_FORCE_INLINE btScalar +distance2(const btVector3& v1, const btVector3& v2) +{ + return v1.distance2(v2); +} + + +SIMD_FORCE_INLINE btScalar +distance(const btVector3& v1, const btVector3& v2) +{ + return v1.distance(v2); +} + +SIMD_FORCE_INLINE btScalar +angle(const btVector3& v1, const btVector3& v2) +{ + return v1.angle(v2); +} + +SIMD_FORCE_INLINE btVector3 +cross(const btVector3& v1, const btVector3& v2) +{ + return v1.cross(v2); +} + +SIMD_FORCE_INLINE btScalar +triple(const btVector3& v1, const btVector3& v2, const btVector3& v3) +{ + return v1.triple(v2, v3); +} + +SIMD_FORCE_INLINE btVector3 +lerp(const btVector3& v1, const btVector3& v2, const btScalar& t) +{ + return v1.lerp(v2, t); +} + + +SIMD_FORCE_INLINE bool operator==(const btVector3& p1, const btVector3& p2) +{ + return p1.x() == p2.x() && p1.y() == p2.y() && p1.z() == p2.z(); +} + +SIMD_FORCE_INLINE btScalar btVector3::distance2(const btVector3& v) const +{ + return (v - *this).length2(); +} + +SIMD_FORCE_INLINE btScalar btVector3::distance(const btVector3& v) const +{ + return (v - *this).length(); +} + +SIMD_FORCE_INLINE btVector3 btVector3::normalized() const +{ + return *this / length(); +} + +SIMD_FORCE_INLINE btVector3 btVector3::rotate( const btVector3& wAxis, const btScalar angle ) +{ + // wAxis must be a unit lenght vector + + btVector3 o = wAxis * wAxis.dot( *this ); + btVector3 x = *this - o; + btVector3 y; + + y = wAxis.cross( *this ); + + return ( o + x * btCos( angle ) + y * btSin( angle ) ); +} + +class btVector4 : public btVector3 +{ +public: + + SIMD_FORCE_INLINE btVector4() {} + + + SIMD_FORCE_INLINE btVector4(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w) + : btVector3(x,y,z) + { + m_unusedW = w; + } + + + SIMD_FORCE_INLINE btVector4 absolute4() const + { + return btVector4( + btFabs(m_x), + btFabs(m_y), + btFabs(m_z), + btFabs(m_unusedW)); + } + + + + btScalar getW() const { return m_unusedW;} + + + SIMD_FORCE_INLINE int maxAxis4() const + { + int maxIndex = -1; + btScalar maxVal = btScalar(-1e30); + if (m_x > maxVal) + { + maxIndex = 0; + maxVal = m_x; + } + if (m_y > maxVal) + { + maxIndex = 1; + maxVal = m_y; + } + if (m_z > maxVal) + { + maxIndex = 2; + maxVal = m_z; + } + if (m_unusedW > maxVal) + { + maxIndex = 3; + maxVal = m_unusedW; + } + + + + + return maxIndex; + + } + + + SIMD_FORCE_INLINE int minAxis4() const + { + int minIndex = -1; + btScalar minVal = btScalar(1e30); + if (m_x < minVal) + { + minIndex = 0; + minVal = m_x; + } + if (m_y < minVal) + { + minIndex = 1; + minVal = m_y; + } + if (m_z < minVal) + { + minIndex = 2; + minVal = m_z; + } + if (m_unusedW < minVal) + { + minIndex = 3; + minVal = m_unusedW; + } + + return minIndex; + + } + + + SIMD_FORCE_INLINE int closestAxis4() const + { + return absolute4().maxAxis4(); + } + +}; + + +///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization +SIMD_FORCE_INLINE void btSwapScalarEndian(const btScalar& sourceVal, btScalar& destVal) +{ + #ifdef BT_USE_DOUBLE_PRECISION + unsigned char* dest = (unsigned char*) &destVal; + unsigned char* src = (unsigned char*) &sourceVal; + dest[0] = src[7]; + dest[1] = src[6]; + dest[2] = src[5]; + dest[3] = src[4]; + dest[4] = src[3]; + dest[5] = src[2]; + dest[6] = src[1]; + dest[7] = src[0]; +#else + unsigned char* dest = (unsigned char*) &destVal; + unsigned char* src = (unsigned char*) &sourceVal; + dest[0] = src[3]; + dest[1] = src[2]; + dest[2] = src[1]; + dest[3] = src[0]; +#endif //BT_USE_DOUBLE_PRECISION +} +///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization +SIMD_FORCE_INLINE void btSwapVector3Endian(const btVector3& sourceVec, btVector3& destVec) +{ + for (int i=0;i<4;i++) + { + btSwapScalarEndian(sourceVec[i],destVec[i]); + } + +} + +///btUnSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization +SIMD_FORCE_INLINE void btUnSwapVector3Endian(btVector3& vector) +{ + + btVector3 swappedVec; + for (int i=0;i<4;i++) + { + btSwapScalarEndian(vector[i],swappedVec[i]); + } + vector = swappedVec; +} + +#endif //SIMD__VECTOR3_H diff --git a/src/bullet/src/Makefile.am b/src/bullet/src/Makefile.am new file mode 100644 index 000000000..81a5318e4 --- /dev/null +++ b/src/bullet/src/Makefile.am @@ -0,0 +1,188 @@ +noinst_LIBRARIES = libbulletmath.a libbulletcollision.a libbulletdynamics.a + +libbulletmath_a_SOURCES = \ + LinearMath/btAabbUtil2.h LinearMath/btList.h LinearMath/btQuickprof.h \ + LinearMath/btAlignedAllocator.cpp LinearMath/btMatrix3x3.h \ + LinearMath/btRandom.h LinearMath/btAlignedAllocator.h \ + LinearMath/btMinMax.h LinearMath/btScalar.h \ + LinearMath/btAlignedObjectArray.h LinearMath/btMotionState.h \ + LinearMath/btPoolAllocator.h LinearMath/btDefaultMotionState.h\ + LinearMath/btPoint3.h LinearMath/btStackAlloc.h \ + LinearMath/btGeometryUtil.cpp LinearMath/btQuadWord.h \ + LinearMath/btTransform.h LinearMath/btGeometryUtil.h \ + LinearMath/btQuaternion.h LinearMath/btTransformUtil.h \ + LinearMath/btIDebugDraw.h LinearMath/btQuickprof.cpp \ + LinearMath/btVector3.h + +libbulletcollision_a_SOURCES := \ + BulletCollision/BroadphaseCollision/btAxisSweep3.cpp \ + BulletCollision/BroadphaseCollision/btAxisSweep3.h \ + BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp \ + BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \ + BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \ + BulletCollision/BroadphaseCollision/btDispatcher.cpp \ + BulletCollision/BroadphaseCollision/btDispatcher.h \ + BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp \ + BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \ + BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \ + BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp \ + BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \ + BulletCollision/CollisionDispatch/btCollisionConfiguration.h \ + BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \ + BulletCollision/CollisionDispatch/btCollisionDispatcher.h \ + BulletCollision/CollisionDispatch/btCollisionObject.cpp \ + BulletCollision/CollisionDispatch/btCollisionObject.h \ + BulletCollision/CollisionDispatch/btCollisionWorld.cpp \ + BulletCollision/CollisionDispatch/btCollisionWorld.h \ + BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h \ + BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \ + BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h \ + BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btManifoldResult.cpp \ + BulletCollision/CollisionDispatch/btManifoldResult.h \ + BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \ + BulletCollision/CollisionDispatch/btSimulationIslandManager.h \ + BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \ + BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h \ + BulletCollision/CollisionDispatch/btUnionFind.cpp \ + BulletCollision/CollisionDispatch/btUnionFind.h \ + BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \ + BulletCollision/CollisionDispatch/SphereTriangleDetector.h \ + BulletCollision/CollisionShapes/btBoxShape.cpp \ + BulletCollision/CollisionShapes/btBoxShape.h \ + BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \ + BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btCapsuleShape.cpp \ + BulletCollision/CollisionShapes/btCapsuleShape.h \ + BulletCollision/CollisionShapes/btCollisionMargin.h \ + BulletCollision/CollisionShapes/btCollisionShape.cpp \ + BulletCollision/CollisionShapes/btCollisionShape.h \ + BulletCollision/CollisionShapes/btCompoundShape.cpp \ + BulletCollision/CollisionShapes/btCompoundShape.h \ + BulletCollision/CollisionShapes/btConcaveShape.cpp \ + BulletCollision/CollisionShapes/btConcaveShape.h \ + BulletCollision/CollisionShapes/btConeShape.cpp \ + BulletCollision/CollisionShapes/btConeShape.h \ + BulletCollision/CollisionShapes/btConvexHullShape.cpp \ + BulletCollision/CollisionShapes/btConvexHullShape.h \ + BulletCollision/CollisionShapes/btConvexInternalShape.cpp \ + BulletCollision/CollisionShapes/btConvexInternalShape.h \ + BulletCollision/CollisionShapes/btConvexShape.cpp \ + BulletCollision/CollisionShapes/btConvexShape.h \ + BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp \ + BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btCylinderShape.cpp \ + BulletCollision/CollisionShapes/btCylinderShape.h \ + BulletCollision/CollisionShapes/btEmptyShape.cpp \ + BulletCollision/CollisionShapes/btEmptyShape.h \ + BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp \ + BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h \ + BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp \ + BulletCollision/CollisionShapes/btMinkowskiSumShape.h \ + BulletCollision/CollisionShapes/btMultiSphereShape.cpp \ + BulletCollision/CollisionShapes/btMultiSphereShape.h \ + BulletCollision/CollisionShapes/btOptimizedBvh.cpp \ + BulletCollision/CollisionShapes/btOptimizedBvh.h \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \ + BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \ + BulletCollision/CollisionShapes/btSphereShape.cpp \ + BulletCollision/CollisionShapes/btSphereShape.h \ + BulletCollision/CollisionShapes/btStaticPlaneShape.cpp \ + BulletCollision/CollisionShapes/btStaticPlaneShape.h \ + BulletCollision/CollisionShapes/btStridingMeshInterface.cpp \ + BulletCollision/CollisionShapes/btStridingMeshInterface.h \ + BulletCollision/CollisionShapes/btTetrahedronShape.cpp \ + BulletCollision/CollisionShapes/btTetrahedronShape.h \ + BulletCollision/CollisionShapes/btTriangleBuffer.cpp \ + BulletCollision/CollisionShapes/btTriangleBuffer.h \ + BulletCollision/CollisionShapes/btTriangleCallback.cpp \ + BulletCollision/CollisionShapes/btTriangleCallback.h \ + BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp \ + BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h \ + BulletCollision/CollisionShapes/btTriangleMesh.cpp \ + BulletCollision/CollisionShapes/btTriangleMesh.h \ + BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \ + BulletCollision/CollisionShapes/btTriangleMeshShape.h \ + BulletCollision/CollisionShapes/btTriangleShape.h \ + BulletCollision/CollisionShapes/btUniformScalingShape.cpp \ + BulletCollision/CollisionShapes/btUniformScalingShape.h \ + BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \ + BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \ + BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \ + BulletCollision/NarrowPhaseCollision/btConvexCast.h \ + BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h\ + BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \ + BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \ + BulletCollision/NarrowPhaseCollision/btGjkEpa.cpp \ + BulletCollision/NarrowPhaseCollision/btGjkEpa.h \ + BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \ + BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \ + BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \ + BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \ + BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp\ + BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \ + BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \ + BulletCollision/NarrowPhaseCollision/btPointCollector.h \ + BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \ + BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \ + BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \ + BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \ + BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \ + BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h + +libbulletdynamics_a_SOURCES = \ + BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \ + BulletDynamics/ConstraintSolver/btConeTwistConstraint.h \ + BulletDynamics/ConstraintSolver/btConstraintSolver.h \ + BulletDynamics/ConstraintSolver/btContactConstraint.cpp \ + BulletDynamics/ConstraintSolver/btContactConstraint.h \ + BulletDynamics/ConstraintSolver/btContactSolverInfo.h \ + BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \ + BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h \ + BulletDynamics/ConstraintSolver/btHingeConstraint.cpp \ + BulletDynamics/ConstraintSolver/btHingeConstraint.h \ + BulletDynamics/ConstraintSolver/btJacobianEntry.h \ + BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp \ + BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \ + BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \ + BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \ + BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp \ + BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \ + BulletDynamics/ConstraintSolver/btSolverBody.h \ + BulletDynamics/ConstraintSolver/btSolverConstraint.h \ + BulletDynamics/ConstraintSolver/btTypedConstraint.cpp \ + BulletDynamics/ConstraintSolver/btTypedConstraint.h \ + BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp \ + BulletDynamics/Dynamics/btContinuousDynamicsWorld.h \ + BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp \ + BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \ + BulletDynamics/Dynamics/btDynamicsWorld.h \ + BulletDynamics/Dynamics/btRigidBody.cpp \ + BulletDynamics/Dynamics/btRigidBody.h \ + BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp \ + BulletDynamics/Dynamics/btSimpleDynamicsWorld.h \ + BulletDynamics/Dynamics/Bullet-C-API.cpp \ + BulletDynamics/Vehicle/btRaycastVehicle.cpp \ + BulletDynamics/Vehicle/btRaycastVehicle.h \ + BulletDynamics/Vehicle/btVehicleRaycaster.h \ + BulletDynamics/Vehicle/btWheelInfo.cpp \ + BulletDynamics/Vehicle/btWheelInfo.h diff --git a/src/bullet/src/btBulletCollisionCommon.h b/src/bullet/src/btBulletCollisionCommon.h new file mode 100644 index 000000000..91aaf639f --- /dev/null +++ b/src/bullet/src/btBulletCollisionCommon.h @@ -0,0 +1,63 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BULLET_COLLISION_COMMON_H +#define BULLET_COLLISION_COMMON_H + +///Common headerfile includes for Bullet Collision Detection + +///Bullet's btCollisionWorld and btCollisionObject definitions +#include "BulletCollision/CollisionDispatch/btCollisionWorld.h" +#include "BulletCollision/CollisionDispatch/btCollisionObject.h" + +///Collision Shapes +#include "BulletCollision/CollisionShapes/btBoxShape.h" +#include "BulletCollision/CollisionShapes/btSphereShape.h" +#include "BulletCollision/CollisionShapes/btCapsuleShape.h" +#include "BulletCollision/CollisionShapes/btCylinderShape.h" +#include "BulletCollision/CollisionShapes/btConeShape.h" +#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h" +#include "BulletCollision/CollisionShapes/btConvexHullShape.h" +#include "BulletCollision/CollisionShapes/btTriangleMesh.h" +#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h" +#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" +#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h" +#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h" +#include "BulletCollision/CollisionShapes/btCompoundShape.h" +#include "BulletCollision/CollisionShapes/btTetrahedronShape.h" +#include "BulletCollision/CollisionShapes/btEmptyShape.h" +#include "BulletCollision/CollisionShapes/btMultiSphereShape.h" +#include "BulletCollision/CollisionShapes/btUniformScalingShape.h" + +///Narrowphase Collision Detector +#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h" +#include "BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h" + +///Dispatching and generation of collision pairs (broadphase) +#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" +#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h" +#include "BulletCollision/BroadphaseCollision/btAxisSweep3.h" + + +///Math library & Utils +#include "LinearMath/btQuaternion.h" +#include "LinearMath/btTransform.h" +#include "LinearMath/btDefaultMotionState.h" +#include "LinearMath/btQuickprof.h" +#include "LinearMath/btIDebugDraw.h" + +#endif //BULLET_COLLISION_COMMON_H + diff --git a/src/bullet/src/btBulletDynamicsCommon.h b/src/bullet/src/btBulletDynamicsCommon.h new file mode 100644 index 000000000..300d05bec --- /dev/null +++ b/src/bullet/src/btBulletDynamicsCommon.h @@ -0,0 +1,44 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BULLET_DYNAMICS_COMMON_H +#define BULLET_DYNAMICS_COMMON_H + +///Common headerfile includes for Bullet Dynamics, including Collision Detection +#include "btBulletCollisionCommon.h" + +#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h" +#include "BulletDynamics/Dynamics/btContinuousDynamicsWorld.h" + +#include "BulletDynamics/Dynamics/btSimpleDynamicsWorld.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" + +#include "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h" +#include "BulletDynamics/ConstraintSolver/btHingeConstraint.h" +#include "BulletDynamics/ConstraintSolver/btConeTwistConstraint.h" +#include "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h" + + +#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h" +///Vehicle simulation, with wheel contact simulated by raycasts +#include "BulletDynamics/Vehicle/btRaycastVehicle.h" + + + + + + +#endif //BULLET_DYNAMICS_COMMON_H + diff --git a/src/physics.cpp b/src/physics.cpp index 54011f317..fb2f84a1e 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -48,7 +48,7 @@ Physics::Physics(float gravity) btConstraintSolver *constraintSolver = new btSequentialImpulseConstraintSolver(); m_dynamics_world = new btDiscreteDynamicsWorld(m_dispatcher, axis_sweep, - constraintSolver); + constraintSolver, collisionConf); m_dynamics_world->setGravity(btVector3(0.0f, 0.0f, -gravity)); if(user_config->m_bullet_debug) {