ruby-bullet 0.1.0-x86-linux → 0.1.1-x86-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +3 -0
  3. data/Rakefile +14 -2
  4. data/bindings/bullet/interface/BulletCollision/CollisionDispatch/btCollisionWorld.i +2 -2
  5. data/bindings/bullet/interface/bullet_wrap.cpp +17548 -6035
  6. data/bindings/bullet/interface/bullet_wrap.h +7 -7
  7. data/bindings/bullet/interface/bullet_wrap.o +0 -0
  8. data/lib/bullet.so +0 -0
  9. data/lib/ruby-bullet/version.rb +1 -1
  10. data/ruby-bullet.gemspec +0 -3
  11. metadata +169 -444
  12. data/deps/include/bullet/Bullet-C-Api.h +0 -176
  13. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btAxisSweep3.h +0 -1051
  14. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h +0 -82
  15. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h +0 -270
  16. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h +0 -80
  17. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btDbvt.h +0 -1257
  18. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h +0 -146
  19. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btDispatcher.h +0 -110
  20. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h +0 -151
  21. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h +0 -469
  22. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h +0 -40
  23. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.h +0 -579
  24. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h +0 -171
  25. data/deps/include/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.h +0 -51
  26. data/deps/include/bullet/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h +0 -36
  27. data/deps/include/bullet/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h +0 -66
  28. data/deps/include/bullet/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h +0 -66
  29. data/deps/include/bullet/BulletCollision/CollisionDispatch/btBoxBoxDetector.h +0 -44
  30. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionConfiguration.h +0 -48
  31. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h +0 -45
  32. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.h +0 -172
  33. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h +0 -524
  34. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h +0 -509
  35. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h +0 -86
  36. data/deps/include/bullet/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h +0 -95
  37. data/deps/include/bullet/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h +0 -116
  38. data/deps/include/bullet/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h +0 -109
  39. data/deps/include/bullet/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h +0 -84
  40. data/deps/include/bullet/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h +0 -137
  41. data/deps/include/bullet/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h +0 -54
  42. data/deps/include/bullet/BulletCollision/CollisionDispatch/btGhostObject.h +0 -175
  43. data/deps/include/bullet/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h +0 -46
  44. data/deps/include/bullet/BulletCollision/CollisionDispatch/btManifoldResult.h +0 -128
  45. data/deps/include/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.h +0 -81
  46. data/deps/include/bullet/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h +0 -75
  47. data/deps/include/bullet/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h +0 -66
  48. data/deps/include/bullet/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h +0 -69
  49. data/deps/include/bullet/BulletCollision/CollisionDispatch/btUnionFind.h +0 -129
  50. data/deps/include/bullet/BulletCollision/CollisionShapes/btBox2dShape.h +0 -369
  51. data/deps/include/bullet/BulletCollision/CollisionShapes/btBoxShape.h +0 -312
  52. data/deps/include/bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h +0 -139
  53. data/deps/include/bullet/BulletCollision/CollisionShapes/btCapsuleShape.h +0 -173
  54. data/deps/include/bullet/BulletCollision/CollisionShapes/btCollisionMargin.h +0 -27
  55. data/deps/include/bullet/BulletCollision/CollisionShapes/btCollisionShape.h +0 -150
  56. data/deps/include/bullet/BulletCollision/CollisionShapes/btCompoundShape.h +0 -212
  57. data/deps/include/bullet/BulletCollision/CollisionShapes/btConcaveShape.h +0 -60
  58. data/deps/include/bullet/BulletCollision/CollisionShapes/btConeShape.h +0 -103
  59. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvex2dShape.h +0 -80
  60. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexHullShape.h +0 -122
  61. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexInternalShape.h +0 -224
  62. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexPointCloudShape.h +0 -105
  63. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexPolyhedron.h +0 -62
  64. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexShape.h +0 -84
  65. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h +0 -75
  66. data/deps/include/bullet/BulletCollision/CollisionShapes/btCylinderShape.h +0 -200
  67. data/deps/include/bullet/BulletCollision/CollisionShapes/btEmptyShape.h +0 -70
  68. data/deps/include/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h +0 -161
  69. data/deps/include/bullet/BulletCollision/CollisionShapes/btMaterial.h +0 -35
  70. data/deps/include/bullet/BulletCollision/CollisionShapes/btMinkowskiSumShape.h +0 -60
  71. data/deps/include/bullet/BulletCollision/CollisionShapes/btMultiSphereShape.h +0 -99
  72. data/deps/include/bullet/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h +0 -120
  73. data/deps/include/bullet/BulletCollision/CollisionShapes/btOptimizedBvh.h +0 -65
  74. data/deps/include/bullet/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h +0 -112
  75. data/deps/include/bullet/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h +0 -93
  76. data/deps/include/bullet/BulletCollision/CollisionShapes/btShapeHull.h +0 -59
  77. data/deps/include/bullet/BulletCollision/CollisionShapes/btSphereShape.h +0 -73
  78. data/deps/include/bullet/BulletCollision/CollisionShapes/btStaticPlaneShape.h +0 -103
  79. data/deps/include/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.h +0 -162
  80. data/deps/include/bullet/BulletCollision/CollisionShapes/btTetrahedronShape.h +0 -74
  81. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleBuffer.h +0 -69
  82. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleCallback.h +0 -42
  83. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h +0 -133
  84. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h +0 -84
  85. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleInfoMap.h +0 -241
  86. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleMesh.h +0 -69
  87. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleMeshShape.h +0 -89
  88. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleShape.h +0 -182
  89. data/deps/include/bullet/BulletCollision/CollisionShapes/btUniformScalingShape.h +0 -87
  90. data/deps/include/bullet/BulletCollision/Gimpact/btBoxCollision.h +0 -647
  91. data/deps/include/bullet/BulletCollision/Gimpact/btClipPolygon.h +0 -182
  92. data/deps/include/bullet/BulletCollision/Gimpact/btContactProcessing.h +0 -145
  93. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactBvh.h +0 -396
  94. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h +0 -306
  95. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactMassUtil.h +0 -60
  96. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactQuantizedBvh.h +0 -372
  97. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactShape.h +0 -1171
  98. data/deps/include/bullet/BulletCollision/Gimpact/btGenericPoolAllocator.h +0 -163
  99. data/deps/include/bullet/BulletCollision/Gimpact/btGeometryOperations.h +0 -212
  100. data/deps/include/bullet/BulletCollision/Gimpact/btQuantization.h +0 -88
  101. data/deps/include/bullet/BulletCollision/Gimpact/btTriangleShapeEx.h +0 -180
  102. data/deps/include/bullet/BulletCollision/Gimpact/gim_array.h +0 -326
  103. data/deps/include/bullet/BulletCollision/Gimpact/gim_basic_geometry_operations.h +0 -543
  104. data/deps/include/bullet/BulletCollision/Gimpact/gim_bitset.h +0 -123
  105. data/deps/include/bullet/BulletCollision/Gimpact/gim_box_collision.h +0 -590
  106. data/deps/include/bullet/BulletCollision/Gimpact/gim_box_set.h +0 -674
  107. data/deps/include/bullet/BulletCollision/Gimpact/gim_clip_polygon.h +0 -210
  108. data/deps/include/bullet/BulletCollision/Gimpact/gim_contact.h +0 -164
  109. data/deps/include/bullet/BulletCollision/Gimpact/gim_geom_types.h +0 -97
  110. data/deps/include/bullet/BulletCollision/Gimpact/gim_geometry.h +0 -42
  111. data/deps/include/bullet/BulletCollision/Gimpact/gim_hash_table.h +0 -902
  112. data/deps/include/bullet/BulletCollision/Gimpact/gim_linear_math.h +0 -1573
  113. data/deps/include/bullet/BulletCollision/Gimpact/gim_math.h +0 -157
  114. data/deps/include/bullet/BulletCollision/Gimpact/gim_memory.h +0 -190
  115. data/deps/include/bullet/BulletCollision/Gimpact/gim_radixsort.h +0 -406
  116. data/deps/include/bullet/BulletCollision/Gimpact/gim_tri_collision.h +0 -379
  117. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h +0 -59
  118. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btConvexCast.h +0 -73
  119. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h +0 -42
  120. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h +0 -91
  121. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h +0 -50
  122. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h +0 -75
  123. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h +0 -43
  124. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h +0 -103
  125. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h +0 -158
  126. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h +0 -40
  127. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h +0 -228
  128. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btPointCollector.h +0 -64
  129. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h +0 -46
  130. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h +0 -72
  131. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h +0 -63
  132. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h +0 -50
  133. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h +0 -179
  134. data/deps/include/bullet/BulletCollision/btBulletCollisionCommon.h +0 -69
  135. data/deps/include/bullet/BulletDynamics/Character/btCharacterControllerInterface.h +0 -46
  136. data/deps/include/bullet/BulletDynamics/Character/btKinematicCharacterController.h +0 -163
  137. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h +0 -346
  138. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btConstraintSolver.h +0 -52
  139. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btContactConstraint.h +0 -71
  140. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btContactSolverInfo.h +0 -87
  141. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h +0 -614
  142. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h +0 -99
  143. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btHinge2Constraint.h +0 -58
  144. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btHingeConstraint.h +0 -381
  145. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btJacobianEntry.h +0 -156
  146. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h +0 -161
  147. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h +0 -130
  148. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSliderConstraint.h +0 -333
  149. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h +0 -107
  150. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSolverBody.h +0 -191
  151. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSolverConstraint.h +0 -98
  152. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btTypedConstraint.h +0 -452
  153. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btUniversalConstraint.h +0 -62
  154. data/deps/include/bullet/BulletDynamics/Dynamics/btActionInterface.h +0 -46
  155. data/deps/include/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h +0 -203
  156. data/deps/include/bullet/BulletDynamics/Dynamics/btDynamicsWorld.h +0 -151
  157. data/deps/include/bullet/BulletDynamics/Dynamics/btRigidBody.h +0 -691
  158. data/deps/include/bullet/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h +0 -89
  159. data/deps/include/bullet/BulletDynamics/Vehicle/btRaycastVehicle.h +0 -236
  160. data/deps/include/bullet/BulletDynamics/Vehicle/btVehicleRaycaster.h +0 -35
  161. data/deps/include/bullet/BulletDynamics/Vehicle/btWheelInfo.h +0 -119
  162. data/deps/include/bullet/BulletDynamics/btBulletDynamicsCommon.h +0 -48
  163. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverBuffer_DX11.h +0 -323
  164. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverLinkData_DX11.h +0 -103
  165. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverLinkData_DX11SIMDAware.h +0 -173
  166. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverTriangleData_DX11.h +0 -96
  167. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverVertexBuffer_DX11.h +0 -107
  168. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverVertexData_DX11.h +0 -63
  169. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h +0 -691
  170. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.h +0 -81
  171. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverBuffer_OpenCL.h +0 -209
  172. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverLinkData_OpenCL.h +0 -99
  173. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverLinkData_OpenCLSIMDAware.h +0 -169
  174. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverOutputCLtoGL.h +0 -62
  175. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverTriangleData_OpenCL.h +0 -84
  176. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverVertexBuffer_OpenGL.h +0 -166
  177. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverVertexData_OpenCL.h +0 -52
  178. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.h +0 -527
  179. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCLSIMDAware.h +0 -81
  180. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/Shared/btSoftBodySolverData.h +0 -748
  181. data/deps/include/bullet/BulletMultiThreaded/HeapManager.h +0 -117
  182. data/deps/include/bullet/BulletMultiThreaded/PlatformDefinitions.h +0 -99
  183. data/deps/include/bullet/BulletMultiThreaded/PosixThreadSupport.h +0 -142
  184. data/deps/include/bullet/BulletMultiThreaded/PpuAddressSpace.h +0 -37
  185. data/deps/include/bullet/BulletMultiThreaded/SequentialThreadSupport.h +0 -96
  186. data/deps/include/bullet/BulletMultiThreaded/SpuCollisionObjectWrapper.h +0 -40
  187. data/deps/include/bullet/BulletMultiThreaded/SpuCollisionTaskProcess.h +0 -163
  188. data/deps/include/bullet/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h +0 -120
  189. data/deps/include/bullet/BulletMultiThreaded/SpuDoubleBuffer.h +0 -126
  190. data/deps/include/bullet/BulletMultiThreaded/SpuFakeDma.h +0 -135
  191. data/deps/include/bullet/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h +0 -72
  192. data/deps/include/bullet/BulletMultiThreaded/SpuLibspe2Support.h +0 -180
  193. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h +0 -167
  194. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h +0 -128
  195. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h +0 -106
  196. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h +0 -51
  197. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h +0 -140
  198. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h +0 -19
  199. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h +0 -48
  200. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h +0 -70
  201. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h +0 -65
  202. data/deps/include/bullet/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h +0 -54
  203. data/deps/include/bullet/BulletMultiThreaded/SpuSampleTaskProcess.h +0 -153
  204. data/deps/include/bullet/BulletMultiThreaded/SpuSync.h +0 -149
  205. data/deps/include/bullet/BulletMultiThreaded/TrbDynBody.h +0 -79
  206. data/deps/include/bullet/BulletMultiThreaded/TrbStateVec.h +0 -339
  207. data/deps/include/bullet/BulletMultiThreaded/Win32ThreadSupport.h +0 -138
  208. data/deps/include/bullet/BulletMultiThreaded/btGpu3DGridBroadphase.h +0 -138
  209. data/deps/include/bullet/BulletMultiThreaded/btGpu3DGridBroadphaseSharedCode.h +0 -430
  210. data/deps/include/bullet/BulletMultiThreaded/btGpu3DGridBroadphaseSharedDefs.h +0 -61
  211. data/deps/include/bullet/BulletMultiThreaded/btGpu3DGridBroadphaseSharedTypes.h +0 -67
  212. data/deps/include/bullet/BulletMultiThreaded/btGpuDefines.h +0 -211
  213. data/deps/include/bullet/BulletMultiThreaded/btGpuUtilsSharedCode.h +0 -55
  214. data/deps/include/bullet/BulletMultiThreaded/btGpuUtilsSharedDefs.h +0 -52
  215. data/deps/include/bullet/BulletMultiThreaded/btParallelConstraintSolver.h +0 -285
  216. data/deps/include/bullet/BulletMultiThreaded/btThreadSupportInterface.h +0 -85
  217. data/deps/include/bullet/BulletMultiThreaded/vectormath2bullet.h +0 -73
  218. data/deps/include/bullet/BulletSoftBody/btDefaultSoftBodySolver.h +0 -63
  219. data/deps/include/bullet/BulletSoftBody/btSoftBody.h +0 -987
  220. data/deps/include/bullet/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h +0 -153
  221. data/deps/include/bullet/BulletSoftBody/btSoftBodyData.h +0 -217
  222. data/deps/include/bullet/BulletSoftBody/btSoftBodyHelpers.h +0 -143
  223. data/deps/include/bullet/BulletSoftBody/btSoftBodyInternals.h +0 -930
  224. data/deps/include/bullet/BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.h +0 -48
  225. data/deps/include/bullet/BulletSoftBody/btSoftBodySolverVertexBuffer.h +0 -165
  226. data/deps/include/bullet/BulletSoftBody/btSoftBodySolvers.h +0 -154
  227. data/deps/include/bullet/BulletSoftBody/btSoftRigidCollisionAlgorithm.h +0 -75
  228. data/deps/include/bullet/BulletSoftBody/btSoftRigidDynamicsWorld.h +0 -107
  229. data/deps/include/bullet/BulletSoftBody/btSoftSoftCollisionAlgorithm.h +0 -69
  230. data/deps/include/bullet/BulletSoftBody/btSparseSDF.h +0 -306
  231. data/deps/include/bullet/LinearMath/btAabbUtil2.h +0 -236
  232. data/deps/include/bullet/LinearMath/btAlignedAllocator.h +0 -107
  233. data/deps/include/bullet/LinearMath/btAlignedObjectArray.h +0 -494
  234. data/deps/include/bullet/LinearMath/btConvexHull.h +0 -241
  235. data/deps/include/bullet/LinearMath/btConvexHullComputer.h +0 -103
  236. data/deps/include/bullet/LinearMath/btDefaultMotionState.h +0 -40
  237. data/deps/include/bullet/LinearMath/btGeometryUtil.h +0 -42
  238. data/deps/include/bullet/LinearMath/btGrahamScan2dConvexHull.h +0 -110
  239. data/deps/include/bullet/LinearMath/btHashMap.h +0 -450
  240. data/deps/include/bullet/LinearMath/btIDebugDraw.h +0 -418
  241. data/deps/include/bullet/LinearMath/btList.h +0 -73
  242. data/deps/include/bullet/LinearMath/btMatrix3x3.h +0 -771
  243. data/deps/include/bullet/LinearMath/btMinMax.h +0 -71
  244. data/deps/include/bullet/LinearMath/btMotionState.h +0 -40
  245. data/deps/include/bullet/LinearMath/btPoolAllocator.h +0 -121
  246. data/deps/include/bullet/LinearMath/btQuadWord.h +0 -180
  247. data/deps/include/bullet/LinearMath/btQuaternion.h +0 -430
  248. data/deps/include/bullet/LinearMath/btQuickprof.h +0 -203
  249. data/deps/include/bullet/LinearMath/btRandom.h +0 -42
  250. data/deps/include/bullet/LinearMath/btScalar.h +0 -539
  251. data/deps/include/bullet/LinearMath/btSerializer.h +0 -639
  252. data/deps/include/bullet/LinearMath/btStackAlloc.h +0 -116
  253. data/deps/include/bullet/LinearMath/btTransform.h +0 -307
  254. data/deps/include/bullet/LinearMath/btTransformUtil.h +0 -228
  255. data/deps/include/bullet/LinearMath/btVector3.h +0 -766
  256. data/deps/include/bullet/MiniCL/MiniCLTask/MiniCLTask.h +0 -62
  257. data/deps/include/bullet/MiniCL/MiniCLTaskScheduler.h +0 -194
  258. data/deps/include/bullet/MiniCL/cl.h +0 -867
  259. data/deps/include/bullet/MiniCL/cl_MiniCL_Defs.h +0 -439
  260. data/deps/include/bullet/MiniCL/cl_gl.h +0 -113
  261. data/deps/include/bullet/MiniCL/cl_platform.h +0 -254
  262. data/deps/include/bullet/btBulletCollisionCommon.h +0 -69
  263. data/deps/include/bullet/btBulletDynamicsCommon.h +0 -48
  264. data/deps/include/bullet/vectormath/scalar/boolInVec.h +0 -225
  265. data/deps/include/bullet/vectormath/scalar/floatInVec.h +0 -343
  266. data/deps/include/bullet/vectormath/scalar/mat_aos.h +0 -1630
  267. data/deps/include/bullet/vectormath/scalar/quat_aos.h +0 -433
  268. data/deps/include/bullet/vectormath/scalar/vec_aos.h +0 -1426
  269. data/deps/include/bullet/vectormath/scalar/vectormath_aos.h +0 -1872
  270. data/deps/include/bullet/vectormath/sse/boolInVec.h +0 -247
  271. data/deps/include/bullet/vectormath/sse/floatInVec.h +0 -340
  272. data/deps/include/bullet/vectormath/sse/mat_aos.h +0 -2190
  273. data/deps/include/bullet/vectormath/sse/quat_aos.h +0 -579
  274. data/deps/include/bullet/vectormath/sse/vec_aos.h +0 -1455
  275. data/deps/include/bullet/vectormath/sse/vecidx_aos.h +0 -80
  276. data/deps/include/bullet/vectormath/sse/vectormath_aos.h +0 -2547
  277. data/deps/include/bullet/vectormath/vmInclude.h +0 -27
  278. data/deps/lib/libBulletCollision.a +0 -0
  279. data/deps/lib/libBulletDynamics.a +0 -0
  280. data/deps/lib/libBulletMultiThreaded.a +0 -0
  281. data/deps/lib/libBulletSoftBody.a +0 -0
  282. data/deps/lib/libBulletSoftBodySolvers_OpenCL_Mini.a +0 -0
  283. data/deps/lib/libLinearMath.a +0 -0
  284. data/deps/lib/libMiniCL.a +0 -0
@@ -1,930 +0,0 @@
1
- /*
2
- Bullet Continuous Collision Detection and Physics Library
3
- Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4
-
5
- This software is provided 'as-is', without any express or implied warranty.
6
- In no event will the authors be held liable for any damages arising from the use of this software.
7
- Permission is granted to anyone to use this software for any purpose,
8
- including commercial applications, and to alter it and redistribute it freely,
9
- subject to the following restrictions:
10
-
11
- 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.
12
- 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13
- 3. This notice may not be removed or altered from any source distribution.
14
- */
15
- ///btSoftBody implementation by Nathanael Presson
16
-
17
- #ifndef _BT_SOFT_BODY_INTERNALS_H
18
- #define _BT_SOFT_BODY_INTERNALS_H
19
-
20
- #include "btSoftBody.h"
21
-
22
-
23
- #include "LinearMath/btQuickprof.h"
24
- #include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
25
- #include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
26
- #include "BulletCollision/CollisionShapes/btConvexInternalShape.h"
27
- #include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
28
- #include <string.h> //for memset
29
- //
30
- // btSymMatrix
31
- //
32
- template <typename T>
33
- struct btSymMatrix
34
- {
35
- btSymMatrix() : dim(0) {}
36
- btSymMatrix(int n,const T& init=T()) { resize(n,init); }
37
- void resize(int n,const T& init=T()) { dim=n;store.resize((n*(n+1))/2,init); }
38
- int index(int c,int r) const { if(c>r) btSwap(c,r);btAssert(r<dim);return((r*(r+1))/2+c); }
39
- T& operator()(int c,int r) { return(store[index(c,r)]); }
40
- const T& operator()(int c,int r) const { return(store[index(c,r)]); }
41
- btAlignedObjectArray<T> store;
42
- int dim;
43
- };
44
-
45
- //
46
- // btSoftBodyCollisionShape
47
- //
48
- class btSoftBodyCollisionShape : public btConcaveShape
49
- {
50
- public:
51
- btSoftBody* m_body;
52
-
53
- btSoftBodyCollisionShape(btSoftBody* backptr)
54
- {
55
- m_shapeType = SOFTBODY_SHAPE_PROXYTYPE;
56
- m_body=backptr;
57
- }
58
-
59
- virtual ~btSoftBodyCollisionShape()
60
- {
61
-
62
- }
63
-
64
- void processAllTriangles(btTriangleCallback* /*callback*/,const btVector3& /*aabbMin*/,const btVector3& /*aabbMax*/) const
65
- {
66
- //not yet
67
- btAssert(0);
68
- }
69
-
70
- ///getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
71
- virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
72
- {
73
- /* t is usually identity, except when colliding against btCompoundShape. See Issue 512 */
74
- const btVector3 mins=m_body->m_bounds[0];
75
- const btVector3 maxs=m_body->m_bounds[1];
76
- const btVector3 crns[]={t*btVector3(mins.x(),mins.y(),mins.z()),
77
- t*btVector3(maxs.x(),mins.y(),mins.z()),
78
- t*btVector3(maxs.x(),maxs.y(),mins.z()),
79
- t*btVector3(mins.x(),maxs.y(),mins.z()),
80
- t*btVector3(mins.x(),mins.y(),maxs.z()),
81
- t*btVector3(maxs.x(),mins.y(),maxs.z()),
82
- t*btVector3(maxs.x(),maxs.y(),maxs.z()),
83
- t*btVector3(mins.x(),maxs.y(),maxs.z())};
84
- aabbMin=aabbMax=crns[0];
85
- for(int i=1;i<8;++i)
86
- {
87
- aabbMin.setMin(crns[i]);
88
- aabbMax.setMax(crns[i]);
89
- }
90
- }
91
-
92
-
93
- virtual void setLocalScaling(const btVector3& /*scaling*/)
94
- {
95
- ///na
96
- }
97
- virtual const btVector3& getLocalScaling() const
98
- {
99
- static const btVector3 dummy(1,1,1);
100
- return dummy;
101
- }
102
- virtual void calculateLocalInertia(btScalar /*mass*/,btVector3& /*inertia*/) const
103
- {
104
- ///not yet
105
- btAssert(0);
106
- }
107
- virtual const char* getName()const
108
- {
109
- return "SoftBody";
110
- }
111
-
112
- };
113
-
114
- //
115
- // btSoftClusterCollisionShape
116
- //
117
- class btSoftClusterCollisionShape : public btConvexInternalShape
118
- {
119
- public:
120
- const btSoftBody::Cluster* m_cluster;
121
-
122
- btSoftClusterCollisionShape (const btSoftBody::Cluster* cluster) : m_cluster(cluster) { setMargin(0); }
123
-
124
-
125
- virtual btVector3 localGetSupportingVertex(const btVector3& vec) const
126
- {
127
- btSoftBody::Node* const * n=&m_cluster->m_nodes[0];
128
- btScalar d=btDot(vec,n[0]->m_x);
129
- int j=0;
130
- for(int i=1,ni=m_cluster->m_nodes.size();i<ni;++i)
131
- {
132
- const btScalar k=btDot(vec,n[i]->m_x);
133
- if(k>d) { d=k;j=i; }
134
- }
135
- return(n[j]->m_x);
136
- }
137
- virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const
138
- {
139
- return(localGetSupportingVertex(vec));
140
- }
141
- //notice that the vectors should be unit length
142
- virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
143
- {}
144
-
145
-
146
- virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const
147
- {}
148
-
149
- virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
150
- {}
151
-
152
- virtual int getShapeType() const { return SOFTBODY_SHAPE_PROXYTYPE; }
153
-
154
- //debugging
155
- virtual const char* getName()const {return "SOFTCLUSTER";}
156
-
157
- virtual void setMargin(btScalar margin)
158
- {
159
- btConvexInternalShape::setMargin(margin);
160
- }
161
- virtual btScalar getMargin() const
162
- {
163
- return getMargin();
164
- }
165
- };
166
-
167
- //
168
- // Inline's
169
- //
170
-
171
- //
172
- template <typename T>
173
- static inline void ZeroInitialize(T& value)
174
- {
175
- memset(&value,0,sizeof(T));
176
- }
177
- //
178
- template <typename T>
179
- static inline bool CompLess(const T& a,const T& b)
180
- { return(a<b); }
181
- //
182
- template <typename T>
183
- static inline bool CompGreater(const T& a,const T& b)
184
- { return(a>b); }
185
- //
186
- template <typename T>
187
- static inline T Lerp(const T& a,const T& b,btScalar t)
188
- { return(a+(b-a)*t); }
189
- //
190
- template <typename T>
191
- static inline T InvLerp(const T& a,const T& b,btScalar t)
192
- { return((b+a*t-b*t)/(a*b)); }
193
- //
194
- static inline btMatrix3x3 Lerp( const btMatrix3x3& a,
195
- const btMatrix3x3& b,
196
- btScalar t)
197
- {
198
- btMatrix3x3 r;
199
- r[0]=Lerp(a[0],b[0],t);
200
- r[1]=Lerp(a[1],b[1],t);
201
- r[2]=Lerp(a[2],b[2],t);
202
- return(r);
203
- }
204
- //
205
- static inline btVector3 Clamp(const btVector3& v,btScalar maxlength)
206
- {
207
- const btScalar sql=v.length2();
208
- if(sql>(maxlength*maxlength))
209
- return((v*maxlength)/btSqrt(sql));
210
- else
211
- return(v);
212
- }
213
- //
214
- template <typename T>
215
- static inline T Clamp(const T& x,const T& l,const T& h)
216
- { return(x<l?l:x>h?h:x); }
217
- //
218
- template <typename T>
219
- static inline T Sq(const T& x)
220
- { return(x*x); }
221
- //
222
- template <typename T>
223
- static inline T Cube(const T& x)
224
- { return(x*x*x); }
225
- //
226
- template <typename T>
227
- static inline T Sign(const T& x)
228
- { return((T)(x<0?-1:+1)); }
229
- //
230
- template <typename T>
231
- static inline bool SameSign(const T& x,const T& y)
232
- { return((x*y)>0); }
233
- //
234
- static inline btScalar ClusterMetric(const btVector3& x,const btVector3& y)
235
- {
236
- const btVector3 d=x-y;
237
- return(btFabs(d[0])+btFabs(d[1])+btFabs(d[2]));
238
- }
239
- //
240
- static inline btMatrix3x3 ScaleAlongAxis(const btVector3& a,btScalar s)
241
- {
242
- const btScalar xx=a.x()*a.x();
243
- const btScalar yy=a.y()*a.y();
244
- const btScalar zz=a.z()*a.z();
245
- const btScalar xy=a.x()*a.y();
246
- const btScalar yz=a.y()*a.z();
247
- const btScalar zx=a.z()*a.x();
248
- btMatrix3x3 m;
249
- m[0]=btVector3(1-xx+xx*s,xy*s-xy,zx*s-zx);
250
- m[1]=btVector3(xy*s-xy,1-yy+yy*s,yz*s-yz);
251
- m[2]=btVector3(zx*s-zx,yz*s-yz,1-zz+zz*s);
252
- return(m);
253
- }
254
- //
255
- static inline btMatrix3x3 Cross(const btVector3& v)
256
- {
257
- btMatrix3x3 m;
258
- m[0]=btVector3(0,-v.z(),+v.y());
259
- m[1]=btVector3(+v.z(),0,-v.x());
260
- m[2]=btVector3(-v.y(),+v.x(),0);
261
- return(m);
262
- }
263
- //
264
- static inline btMatrix3x3 Diagonal(btScalar x)
265
- {
266
- btMatrix3x3 m;
267
- m[0]=btVector3(x,0,0);
268
- m[1]=btVector3(0,x,0);
269
- m[2]=btVector3(0,0,x);
270
- return(m);
271
- }
272
- //
273
- static inline btMatrix3x3 Add(const btMatrix3x3& a,
274
- const btMatrix3x3& b)
275
- {
276
- btMatrix3x3 r;
277
- for(int i=0;i<3;++i) r[i]=a[i]+b[i];
278
- return(r);
279
- }
280
- //
281
- static inline btMatrix3x3 Sub(const btMatrix3x3& a,
282
- const btMatrix3x3& b)
283
- {
284
- btMatrix3x3 r;
285
- for(int i=0;i<3;++i) r[i]=a[i]-b[i];
286
- return(r);
287
- }
288
- //
289
- static inline btMatrix3x3 Mul(const btMatrix3x3& a,
290
- btScalar b)
291
- {
292
- btMatrix3x3 r;
293
- for(int i=0;i<3;++i) r[i]=a[i]*b;
294
- return(r);
295
- }
296
- //
297
- static inline void Orthogonalize(btMatrix3x3& m)
298
- {
299
- m[2]=btCross(m[0],m[1]).normalized();
300
- m[1]=btCross(m[2],m[0]).normalized();
301
- m[0]=btCross(m[1],m[2]).normalized();
302
- }
303
- //
304
- static inline btMatrix3x3 MassMatrix(btScalar im,const btMatrix3x3& iwi,const btVector3& r)
305
- {
306
- const btMatrix3x3 cr=Cross(r);
307
- return(Sub(Diagonal(im),cr*iwi*cr));
308
- }
309
-
310
- //
311
- static inline btMatrix3x3 ImpulseMatrix( btScalar dt,
312
- btScalar ima,
313
- btScalar imb,
314
- const btMatrix3x3& iwi,
315
- const btVector3& r)
316
- {
317
- return(Diagonal(1/dt)*Add(Diagonal(ima),MassMatrix(imb,iwi,r)).inverse());
318
- }
319
-
320
- //
321
- static inline btMatrix3x3 ImpulseMatrix( btScalar ima,const btMatrix3x3& iia,const btVector3& ra,
322
- btScalar imb,const btMatrix3x3& iib,const btVector3& rb)
323
- {
324
- return(Add(MassMatrix(ima,iia,ra),MassMatrix(imb,iib,rb)).inverse());
325
- }
326
-
327
- //
328
- static inline btMatrix3x3 AngularImpulseMatrix( const btMatrix3x3& iia,
329
- const btMatrix3x3& iib)
330
- {
331
- return(Add(iia,iib).inverse());
332
- }
333
-
334
- //
335
- static inline btVector3 ProjectOnAxis( const btVector3& v,
336
- const btVector3& a)
337
- {
338
- return(a*btDot(v,a));
339
- }
340
- //
341
- static inline btVector3 ProjectOnPlane( const btVector3& v,
342
- const btVector3& a)
343
- {
344
- return(v-ProjectOnAxis(v,a));
345
- }
346
-
347
- //
348
- static inline void ProjectOrigin( const btVector3& a,
349
- const btVector3& b,
350
- btVector3& prj,
351
- btScalar& sqd)
352
- {
353
- const btVector3 d=b-a;
354
- const btScalar m2=d.length2();
355
- if(m2>SIMD_EPSILON)
356
- {
357
- const btScalar t=Clamp<btScalar>(-btDot(a,d)/m2,0,1);
358
- const btVector3 p=a+d*t;
359
- const btScalar l2=p.length2();
360
- if(l2<sqd)
361
- {
362
- prj=p;
363
- sqd=l2;
364
- }
365
- }
366
- }
367
- //
368
- static inline void ProjectOrigin( const btVector3& a,
369
- const btVector3& b,
370
- const btVector3& c,
371
- btVector3& prj,
372
- btScalar& sqd)
373
- {
374
- const btVector3& q=btCross(b-a,c-a);
375
- const btScalar m2=q.length2();
376
- if(m2>SIMD_EPSILON)
377
- {
378
- const btVector3 n=q/btSqrt(m2);
379
- const btScalar k=btDot(a,n);
380
- const btScalar k2=k*k;
381
- if(k2<sqd)
382
- {
383
- const btVector3 p=n*k;
384
- if( (btDot(btCross(a-p,b-p),q)>0)&&
385
- (btDot(btCross(b-p,c-p),q)>0)&&
386
- (btDot(btCross(c-p,a-p),q)>0))
387
- {
388
- prj=p;
389
- sqd=k2;
390
- }
391
- else
392
- {
393
- ProjectOrigin(a,b,prj,sqd);
394
- ProjectOrigin(b,c,prj,sqd);
395
- ProjectOrigin(c,a,prj,sqd);
396
- }
397
- }
398
- }
399
- }
400
-
401
- //
402
- template <typename T>
403
- static inline T BaryEval( const T& a,
404
- const T& b,
405
- const T& c,
406
- const btVector3& coord)
407
- {
408
- return(a*coord.x()+b*coord.y()+c*coord.z());
409
- }
410
- //
411
- static inline btVector3 BaryCoord( const btVector3& a,
412
- const btVector3& b,
413
- const btVector3& c,
414
- const btVector3& p)
415
- {
416
- const btScalar w[]={ btCross(a-p,b-p).length(),
417
- btCross(b-p,c-p).length(),
418
- btCross(c-p,a-p).length()};
419
- const btScalar isum=1/(w[0]+w[1]+w[2]);
420
- return(btVector3(w[1]*isum,w[2]*isum,w[0]*isum));
421
- }
422
-
423
- //
424
- static btScalar ImplicitSolve( btSoftBody::ImplicitFn* fn,
425
- const btVector3& a,
426
- const btVector3& b,
427
- const btScalar accuracy,
428
- const int maxiterations=256)
429
- {
430
- btScalar span[2]={0,1};
431
- btScalar values[2]={fn->Eval(a),fn->Eval(b)};
432
- if(values[0]>values[1])
433
- {
434
- btSwap(span[0],span[1]);
435
- btSwap(values[0],values[1]);
436
- }
437
- if(values[0]>-accuracy) return(-1);
438
- if(values[1]<+accuracy) return(-1);
439
- for(int i=0;i<maxiterations;++i)
440
- {
441
- const btScalar t=Lerp(span[0],span[1],values[0]/(values[0]-values[1]));
442
- const btScalar v=fn->Eval(Lerp(a,b,t));
443
- if((t<=0)||(t>=1)) break;
444
- if(btFabs(v)<accuracy) return(t);
445
- if(v<0)
446
- { span[0]=t;values[0]=v; }
447
- else
448
- { span[1]=t;values[1]=v; }
449
- }
450
- return(-1);
451
- }
452
-
453
- //
454
- static inline btVector3 NormalizeAny(const btVector3& v)
455
- {
456
- const btScalar l=v.length();
457
- if(l>SIMD_EPSILON)
458
- return(v/l);
459
- else
460
- return(btVector3(0,0,0));
461
- }
462
-
463
- //
464
- static inline btDbvtVolume VolumeOf( const btSoftBody::Face& f,
465
- btScalar margin)
466
- {
467
- const btVector3* pts[]={ &f.m_n[0]->m_x,
468
- &f.m_n[1]->m_x,
469
- &f.m_n[2]->m_x};
470
- btDbvtVolume vol=btDbvtVolume::FromPoints(pts,3);
471
- vol.Expand(btVector3(margin,margin,margin));
472
- return(vol);
473
- }
474
-
475
- //
476
- static inline btVector3 CenterOf( const btSoftBody::Face& f)
477
- {
478
- return((f.m_n[0]->m_x+f.m_n[1]->m_x+f.m_n[2]->m_x)/3);
479
- }
480
-
481
- //
482
- static inline btScalar AreaOf( const btVector3& x0,
483
- const btVector3& x1,
484
- const btVector3& x2)
485
- {
486
- const btVector3 a=x1-x0;
487
- const btVector3 b=x2-x0;
488
- const btVector3 cr=btCross(a,b);
489
- const btScalar area=cr.length();
490
- return(area);
491
- }
492
-
493
- //
494
- static inline btScalar VolumeOf( const btVector3& x0,
495
- const btVector3& x1,
496
- const btVector3& x2,
497
- const btVector3& x3)
498
- {
499
- const btVector3 a=x1-x0;
500
- const btVector3 b=x2-x0;
501
- const btVector3 c=x3-x0;
502
- return(btDot(a,btCross(b,c)));
503
- }
504
-
505
- //
506
- static void EvaluateMedium( const btSoftBodyWorldInfo* wfi,
507
- const btVector3& x,
508
- btSoftBody::sMedium& medium)
509
- {
510
- medium.m_velocity = btVector3(0,0,0);
511
- medium.m_pressure = 0;
512
- medium.m_density = wfi->air_density;
513
- if(wfi->water_density>0)
514
- {
515
- const btScalar depth=-(btDot(x,wfi->water_normal)+wfi->water_offset);
516
- if(depth>0)
517
- {
518
- medium.m_density = wfi->water_density;
519
- medium.m_pressure = depth*wfi->water_density*wfi->m_gravity.length();
520
- }
521
- }
522
- }
523
-
524
- //
525
- static inline void ApplyClampedForce( btSoftBody::Node& n,
526
- const btVector3& f,
527
- btScalar dt)
528
- {
529
- const btScalar dtim=dt*n.m_im;
530
- if((f*dtim).length2()>n.m_v.length2())
531
- {/* Clamp */
532
- n.m_f-=ProjectOnAxis(n.m_v,f.normalized())/dtim;
533
- }
534
- else
535
- {/* Apply */
536
- n.m_f+=f;
537
- }
538
- }
539
-
540
- //
541
- static inline int MatchEdge( const btSoftBody::Node* a,
542
- const btSoftBody::Node* b,
543
- const btSoftBody::Node* ma,
544
- const btSoftBody::Node* mb)
545
- {
546
- if((a==ma)&&(b==mb)) return(0);
547
- if((a==mb)&&(b==ma)) return(1);
548
- return(-1);
549
- }
550
-
551
- //
552
- // btEigen : Extract eigen system,
553
- // straitforward implementation of http://math.fullerton.edu/mathews/n2003/JacobiMethodMod.html
554
- // outputs are NOT sorted.
555
- //
556
- struct btEigen
557
- {
558
- static int system(btMatrix3x3& a,btMatrix3x3* vectors,btVector3* values=0)
559
- {
560
- static const int maxiterations=16;
561
- static const btScalar accuracy=(btScalar)0.0001;
562
- btMatrix3x3& v=*vectors;
563
- int iterations=0;
564
- vectors->setIdentity();
565
- do {
566
- int p=0,q=1;
567
- if(btFabs(a[p][q])<btFabs(a[0][2])) { p=0;q=2; }
568
- if(btFabs(a[p][q])<btFabs(a[1][2])) { p=1;q=2; }
569
- if(btFabs(a[p][q])>accuracy)
570
- {
571
- const btScalar w=(a[q][q]-a[p][p])/(2*a[p][q]);
572
- const btScalar z=btFabs(w);
573
- const btScalar t=w/(z*(btSqrt(1+w*w)+z));
574
- if(t==t)/* [WARNING] let hope that one does not get thrown aways by some compilers... */
575
- {
576
- const btScalar c=1/btSqrt(t*t+1);
577
- const btScalar s=c*t;
578
- mulPQ(a,c,s,p,q);
579
- mulTPQ(a,c,s,p,q);
580
- mulPQ(v,c,s,p,q);
581
- } else break;
582
- } else break;
583
- } while((++iterations)<maxiterations);
584
- if(values)
585
- {
586
- *values=btVector3(a[0][0],a[1][1],a[2][2]);
587
- }
588
- return(iterations);
589
- }
590
- private:
591
- static inline void mulTPQ(btMatrix3x3& a,btScalar c,btScalar s,int p,int q)
592
- {
593
- const btScalar m[2][3]={ {a[p][0],a[p][1],a[p][2]},
594
- {a[q][0],a[q][1],a[q][2]}};
595
- int i;
596
-
597
- for(i=0;i<3;++i) a[p][i]=c*m[0][i]-s*m[1][i];
598
- for(i=0;i<3;++i) a[q][i]=c*m[1][i]+s*m[0][i];
599
- }
600
- static inline void mulPQ(btMatrix3x3& a,btScalar c,btScalar s,int p,int q)
601
- {
602
- const btScalar m[2][3]={ {a[0][p],a[1][p],a[2][p]},
603
- {a[0][q],a[1][q],a[2][q]}};
604
- int i;
605
-
606
- for(i=0;i<3;++i) a[i][p]=c*m[0][i]-s*m[1][i];
607
- for(i=0;i<3;++i) a[i][q]=c*m[1][i]+s*m[0][i];
608
- }
609
- };
610
-
611
- //
612
- // Polar decomposition,
613
- // "Computing the Polar Decomposition with Applications", Nicholas J. Higham, 1986.
614
- //
615
- static inline int PolarDecompose( const btMatrix3x3& m,btMatrix3x3& q,btMatrix3x3& s)
616
- {
617
- static const btScalar half=(btScalar)0.5;
618
- static const btScalar accuracy=(btScalar)0.0001;
619
- static const int maxiterations=16;
620
- int i=0;
621
- btScalar det=0;
622
- q = Mul(m,1/btVector3(m[0][0],m[1][1],m[2][2]).length());
623
- det = q.determinant();
624
- if(!btFuzzyZero(det))
625
- {
626
- for(;i<maxiterations;++i)
627
- {
628
- q=Mul(Add(q,Mul(q.adjoint(),1/det).transpose()),half);
629
- const btScalar ndet=q.determinant();
630
- if(Sq(ndet-det)>accuracy) det=ndet; else break;
631
- }
632
- /* Final orthogonalization */
633
- Orthogonalize(q);
634
- /* Compute 'S' */
635
- s=q.transpose()*m;
636
- }
637
- else
638
- {
639
- q.setIdentity();
640
- s.setIdentity();
641
- }
642
- return(i);
643
- }
644
-
645
- //
646
- // btSoftColliders
647
- //
648
- struct btSoftColliders
649
- {
650
- //
651
- // ClusterBase
652
- //
653
- struct ClusterBase : btDbvt::ICollide
654
- {
655
- btScalar erp;
656
- btScalar idt;
657
- btScalar m_margin;
658
- btScalar friction;
659
- btScalar threshold;
660
- ClusterBase()
661
- {
662
- erp =(btScalar)1;
663
- idt =0;
664
- m_margin =0;
665
- friction =0;
666
- threshold =(btScalar)0;
667
- }
668
- bool SolveContact( const btGjkEpaSolver2::sResults& res,
669
- btSoftBody::Body ba,btSoftBody::Body bb,
670
- btSoftBody::CJoint& joint)
671
- {
672
- if(res.distance<m_margin)
673
- {
674
- btVector3 norm = res.normal;
675
- norm.normalize();//is it necessary?
676
-
677
- const btVector3 ra=res.witnesses[0]-ba.xform().getOrigin();
678
- const btVector3 rb=res.witnesses[1]-bb.xform().getOrigin();
679
- const btVector3 va=ba.velocity(ra);
680
- const btVector3 vb=bb.velocity(rb);
681
- const btVector3 vrel=va-vb;
682
- const btScalar rvac=btDot(vrel,norm);
683
- btScalar depth=res.distance-m_margin;
684
-
685
- // printf("depth=%f\n",depth);
686
- const btVector3 iv=norm*rvac;
687
- const btVector3 fv=vrel-iv;
688
- joint.m_bodies[0] = ba;
689
- joint.m_bodies[1] = bb;
690
- joint.m_refs[0] = ra*ba.xform().getBasis();
691
- joint.m_refs[1] = rb*bb.xform().getBasis();
692
- joint.m_rpos[0] = ra;
693
- joint.m_rpos[1] = rb;
694
- joint.m_cfm = 1;
695
- joint.m_erp = 1;
696
- joint.m_life = 0;
697
- joint.m_maxlife = 0;
698
- joint.m_split = 1;
699
-
700
- joint.m_drift = depth*norm;
701
-
702
- joint.m_normal = norm;
703
- // printf("normal=%f,%f,%f\n",res.normal.getX(),res.normal.getY(),res.normal.getZ());
704
- joint.m_delete = false;
705
- joint.m_friction = fv.length2()<(-rvac*friction)?1:friction;
706
- joint.m_massmatrix = ImpulseMatrix( ba.invMass(),ba.invWorldInertia(),joint.m_rpos[0],
707
- bb.invMass(),bb.invWorldInertia(),joint.m_rpos[1]);
708
-
709
- return(true);
710
- }
711
- return(false);
712
- }
713
- };
714
- //
715
- // CollideCL_RS
716
- //
717
- struct CollideCL_RS : ClusterBase
718
- {
719
- btSoftBody* psb;
720
-
721
- btCollisionObject* m_colObj;
722
- void Process(const btDbvtNode* leaf)
723
- {
724
- btSoftBody::Cluster* cluster=(btSoftBody::Cluster*)leaf->data;
725
- btSoftClusterCollisionShape cshape(cluster);
726
-
727
- const btConvexShape* rshape=(const btConvexShape*)m_colObj->getCollisionShape();
728
-
729
- ///don't collide an anchored cluster with a static/kinematic object
730
- if(m_colObj->isStaticOrKinematicObject() && cluster->m_containsAnchor)
731
- return;
732
-
733
- btGjkEpaSolver2::sResults res;
734
- if(btGjkEpaSolver2::SignedDistance( &cshape,btTransform::getIdentity(),
735
- rshape,m_colObj->getWorldTransform(),
736
- btVector3(1,0,0),res))
737
- {
738
- btSoftBody::CJoint joint;
739
- if(SolveContact(res,cluster,m_colObj,joint))//prb,joint))
740
- {
741
- btSoftBody::CJoint* pj=new(btAlignedAlloc(sizeof(btSoftBody::CJoint),16)) btSoftBody::CJoint();
742
- *pj=joint;psb->m_joints.push_back(pj);
743
- if(m_colObj->isStaticOrKinematicObject())
744
- {
745
- pj->m_erp *= psb->m_cfg.kSKHR_CL;
746
- pj->m_split *= psb->m_cfg.kSK_SPLT_CL;
747
- }
748
- else
749
- {
750
- pj->m_erp *= psb->m_cfg.kSRHR_CL;
751
- pj->m_split *= psb->m_cfg.kSR_SPLT_CL;
752
- }
753
- }
754
- }
755
- }
756
- void Process(btSoftBody* ps,btCollisionObject* colOb)
757
- {
758
- psb = ps;
759
- m_colObj = colOb;
760
- idt = ps->m_sst.isdt;
761
- m_margin = m_colObj->getCollisionShape()->getMargin()+psb->getCollisionShape()->getMargin();
762
- ///Bullet rigid body uses multiply instead of minimum to determine combined friction. Some customization would be useful.
763
- friction = btMin(psb->m_cfg.kDF,m_colObj->getFriction());
764
- btVector3 mins;
765
- btVector3 maxs;
766
-
767
- ATTRIBUTE_ALIGNED16(btDbvtVolume) volume;
768
- colOb->getCollisionShape()->getAabb(colOb->getWorldTransform(),mins,maxs);
769
- volume=btDbvtVolume::FromMM(mins,maxs);
770
- volume.Expand(btVector3(1,1,1)*m_margin);
771
- ps->m_cdbvt.collideTV(ps->m_cdbvt.m_root,volume,*this);
772
- }
773
- };
774
- //
775
- // CollideCL_SS
776
- //
777
- struct CollideCL_SS : ClusterBase
778
- {
779
- btSoftBody* bodies[2];
780
- void Process(const btDbvtNode* la,const btDbvtNode* lb)
781
- {
782
- btSoftBody::Cluster* cla=(btSoftBody::Cluster*)la->data;
783
- btSoftBody::Cluster* clb=(btSoftBody::Cluster*)lb->data;
784
-
785
-
786
- bool connected=false;
787
- if ((bodies[0]==bodies[1])&&(bodies[0]->m_clusterConnectivity.size()))
788
- {
789
- connected = bodies[0]->m_clusterConnectivity[cla->m_clusterIndex+bodies[0]->m_clusters.size()*clb->m_clusterIndex];
790
- }
791
-
792
- if (!connected)
793
- {
794
- btSoftClusterCollisionShape csa(cla);
795
- btSoftClusterCollisionShape csb(clb);
796
- btGjkEpaSolver2::sResults res;
797
- if(btGjkEpaSolver2::SignedDistance( &csa,btTransform::getIdentity(),
798
- &csb,btTransform::getIdentity(),
799
- cla->m_com-clb->m_com,res))
800
- {
801
- btSoftBody::CJoint joint;
802
- if(SolveContact(res,cla,clb,joint))
803
- {
804
- btSoftBody::CJoint* pj=new(btAlignedAlloc(sizeof(btSoftBody::CJoint),16)) btSoftBody::CJoint();
805
- *pj=joint;bodies[0]->m_joints.push_back(pj);
806
- pj->m_erp *= btMax(bodies[0]->m_cfg.kSSHR_CL,bodies[1]->m_cfg.kSSHR_CL);
807
- pj->m_split *= (bodies[0]->m_cfg.kSS_SPLT_CL+bodies[1]->m_cfg.kSS_SPLT_CL)/2;
808
- }
809
- }
810
- } else
811
- {
812
- static int count=0;
813
- count++;
814
- //printf("count=%d\n",count);
815
-
816
- }
817
- }
818
- void Process(btSoftBody* psa,btSoftBody* psb)
819
- {
820
- idt = psa->m_sst.isdt;
821
- //m_margin = (psa->getCollisionShape()->getMargin()+psb->getCollisionShape()->getMargin())/2;
822
- m_margin = (psa->getCollisionShape()->getMargin()+psb->getCollisionShape()->getMargin());
823
- friction = btMin(psa->m_cfg.kDF,psb->m_cfg.kDF);
824
- bodies[0] = psa;
825
- bodies[1] = psb;
826
- psa->m_cdbvt.collideTT(psa->m_cdbvt.m_root,psb->m_cdbvt.m_root,*this);
827
- }
828
- };
829
- //
830
- // CollideSDF_RS
831
- //
832
- struct CollideSDF_RS : btDbvt::ICollide
833
- {
834
- void Process(const btDbvtNode* leaf)
835
- {
836
- btSoftBody::Node* node=(btSoftBody::Node*)leaf->data;
837
- DoNode(*node);
838
- }
839
- void DoNode(btSoftBody::Node& n) const
840
- {
841
- const btScalar m=n.m_im>0?dynmargin:stamargin;
842
- btSoftBody::RContact c;
843
- if( (!n.m_battach)&&
844
- psb->checkContact(m_colObj1,n.m_x,m,c.m_cti))
845
- {
846
- const btScalar ima=n.m_im;
847
- const btScalar imb= m_rigidBody? m_rigidBody->getInvMass() : 0.f;
848
- const btScalar ms=ima+imb;
849
- if(ms>0)
850
- {
851
- const btTransform& wtr=m_rigidBody?m_rigidBody->getWorldTransform() : m_colObj1->getWorldTransform();
852
- static const btMatrix3x3 iwiStatic(0,0,0,0,0,0,0,0,0);
853
- const btMatrix3x3& iwi=m_rigidBody?m_rigidBody->getInvInertiaTensorWorld() : iwiStatic;
854
- const btVector3 ra=n.m_x-wtr.getOrigin();
855
- const btVector3 va=m_rigidBody ? m_rigidBody->getVelocityInLocalPoint(ra)*psb->m_sst.sdt : btVector3(0,0,0);
856
- const btVector3 vb=n.m_x-n.m_q;
857
- const btVector3 vr=vb-va;
858
- const btScalar dn=btDot(vr,c.m_cti.m_normal);
859
- const btVector3 fv=vr-c.m_cti.m_normal*dn;
860
- const btScalar fc=psb->m_cfg.kDF*m_colObj1->getFriction();
861
- c.m_node = &n;
862
- c.m_c0 = ImpulseMatrix(psb->m_sst.sdt,ima,imb,iwi,ra);
863
- c.m_c1 = ra;
864
- c.m_c2 = ima*psb->m_sst.sdt;
865
- c.m_c3 = fv.length2()<(btFabs(dn)*fc)?0:1-fc;
866
- c.m_c4 = m_colObj1->isStaticOrKinematicObject()?psb->m_cfg.kKHR:psb->m_cfg.kCHR;
867
- psb->m_rcontacts.push_back(c);
868
- if (m_rigidBody)
869
- m_rigidBody->activate();
870
- }
871
- }
872
- }
873
- btSoftBody* psb;
874
- btCollisionObject* m_colObj1;
875
- btRigidBody* m_rigidBody;
876
- btScalar dynmargin;
877
- btScalar stamargin;
878
- };
879
- //
880
- // CollideVF_SS
881
- //
882
- struct CollideVF_SS : btDbvt::ICollide
883
- {
884
- void Process(const btDbvtNode* lnode,
885
- const btDbvtNode* lface)
886
- {
887
- btSoftBody::Node* node=(btSoftBody::Node*)lnode->data;
888
- btSoftBody::Face* face=(btSoftBody::Face*)lface->data;
889
- btVector3 o=node->m_x;
890
- btVector3 p;
891
- btScalar d=SIMD_INFINITY;
892
- ProjectOrigin( face->m_n[0]->m_x-o,
893
- face->m_n[1]->m_x-o,
894
- face->m_n[2]->m_x-o,
895
- p,d);
896
- const btScalar m=mrg+(o-node->m_q).length()*2;
897
- if(d<(m*m))
898
- {
899
- const btSoftBody::Node* n[]={face->m_n[0],face->m_n[1],face->m_n[2]};
900
- const btVector3 w=BaryCoord(n[0]->m_x,n[1]->m_x,n[2]->m_x,p+o);
901
- const btScalar ma=node->m_im;
902
- btScalar mb=BaryEval(n[0]->m_im,n[1]->m_im,n[2]->m_im,w);
903
- if( (n[0]->m_im<=0)||
904
- (n[1]->m_im<=0)||
905
- (n[2]->m_im<=0))
906
- {
907
- mb=0;
908
- }
909
- const btScalar ms=ma+mb;
910
- if(ms>0)
911
- {
912
- btSoftBody::SContact c;
913
- c.m_normal = p/-btSqrt(d);
914
- c.m_margin = m;
915
- c.m_node = node;
916
- c.m_face = face;
917
- c.m_weights = w;
918
- c.m_friction = btMax(psb[0]->m_cfg.kDF,psb[1]->m_cfg.kDF);
919
- c.m_cfm[0] = ma/ms*psb[0]->m_cfg.kSHR;
920
- c.m_cfm[1] = mb/ms*psb[1]->m_cfg.kSHR;
921
- psb[0]->m_scontacts.push_back(c);
922
- }
923
- }
924
- }
925
- btSoftBody* psb[2];
926
- btScalar mrg;
927
- };
928
- };
929
-
930
- #endif //_BT_SOFT_BODY_INTERNALS_H