Bullet Collision Detection & Physics Library: btDeformableMultiBodyDynamicsWorld.h Source File

Bullet Collision Detection & Physics Library

btDeformableMultiBodyDynamicsWorld.h
Go to the documentation of this file.
1 /*
2 Written by Xuchen Han <xuchenhan2015@u.northwestern.edu>
3
4 Bullet Continuous Collision Detection and Physics Library
5 Copyright (c) 2019 Google Inc. http://bulletphysics.org
6 This software is provided 'as-is', without any express or implied warranty.
7 In no event will the authors be held liable for any damages arising from the use of this software.
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it freely,
10 subject to the following restrictions:
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
16 #ifndef BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD_H
17 #define BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD_H
18
19 #include "btSoftMultiBodyDynamicsWorld.h"
20 #include "btDeformableLagrangianForce.h"
21 #include "btDeformableMassSpringForce.h"
22 #include "btDeformableBodySolver.h"
23 #include "btDeformableMultiBodyConstraintSolver.h"
24 #include "btSoftBodyHelpers.h"
25 #include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
26 #include <functional>
27 typedef btAlignedObjectArray<btSoftBody*> btSoftBodyArray;
28
29 class btDeformableBodySolver;
30 class btDeformableLagrangianForce;
31 struct MultiBodyInplaceSolverIslandCallback;
32 struct DeformableBodyInplaceSolverIslandCallback;
33 class btDeformableMultiBodyConstraintSolver;
34
35 typedef btAlignedObjectArray<btSoftBody*> btSoftBodyArray;
36
37 class btDeformableMultiBodyDynamicsWorld : public btMultiBodyDynamicsWorld
38 {
39 typedef btAlignedObjectArray<btVector3> TVStack;
41 btDeformableBodySolver* m_deformableBodySolver;
42 btSoftBodyArray m_softBodies;
43 int m_drawFlags;
44 bool m_drawNodeTree;
45 bool m_drawFaceTree;
46 bool m_drawClusterTree;
47 btSoftBodyWorldInfo m_sbi;
48 btScalar m_internalTime;
49 int m_ccdIterations;
50 bool m_implicit;
51 bool m_lineSearch;
52 bool m_useProjection;
53 DeformableBodyInplaceSolverIslandCallback* m_solverDeformableBodyIslandCallback;
54
55 typedef void (*btSolverCallback)(btScalar time, btDeformableMultiBodyDynamicsWorld* world);
56 btSolverCallback m_solverCallback;
57
58 protected:
59 virtual void internalSingleStepSimulation(btScalar timeStep);
60
61 virtual void integrateTransforms(btScalar timeStep);
62
63 void positionCorrection(btScalar timeStep);
64
65 void solveConstraints(btScalar timeStep);
66
67 void updateActivationState(btScalar timeStep);
68
69 void clearGravity();
70
71 public:
72 btDeformableMultiBodyDynamicsWorld(btDispatcher* dispatcher, btBroadphaseInterface* pairCache, btDeformableMultiBodyConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration, btDeformableBodySolver* deformableBodySolver = 0);
73
74 virtual int stepSimulation(btScalar timeStep, int maxSubSteps = 1, btScalar fixedTimeStep = btScalar(1.) / btScalar(60.));
75
76 virtual void debugDrawWorld();
77
78 void setSolverCallback(btSolverCallback cb)
79 {
80 m_solverCallback = cb;
81 }
82
83 virtual ~btDeformableMultiBodyDynamicsWorld();
84
85 virtual btMultiBodyDynamicsWorld* getMultiBodyDynamicsWorld()
86 {
87 return (btMultiBodyDynamicsWorld*)(this);
88 }
89
90 virtual const btMultiBodyDynamicsWorld* getMultiBodyDynamicsWorld() const
91 {
92 return (const btMultiBodyDynamicsWorld*)(this);
93 }
94
95 virtual btDynamicsWorldType getWorldType() const
96 {
97 return BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD;
98 }
99
100 virtual void predictUnconstraintMotion(btScalar timeStep);
101
102 virtual void addSoftBody(btSoftBody* body, int collisionFilterGroup = btBroadphaseProxy::DefaultFilter, int collisionFilterMask = btBroadphaseProxy::AllFilter);
103
104 btSoftBodyArray& getSoftBodyArray()
105 {
106 return m_softBodies;
107 }
108
109 const btSoftBodyArray& getSoftBodyArray() const
110 {
111 return m_softBodies;
112 }
113
114 btSoftBodyWorldInfo& getWorldInfo()
115 {
116 return m_sbi;
117 }
118
119 const btSoftBodyWorldInfo& getWorldInfo() const
120 {
121 return m_sbi;
122 }
123
124 void reinitialize(btScalar timeStep);
125
126 void applyRigidBodyGravity(btScalar timeStep);
127
128 void beforeSolverCallbacks(btScalar timeStep);
129
130 void afterSolverCallbacks(btScalar timeStep);
131
132 void addForce(btSoftBody* psb, btDeformableLagrangianForce* force);
133
134 void removeForce(btSoftBody* psb, btDeformableLagrangianForce* force);
135
136 void removeSoftBodyForce(btSoftBody* psb);
137
138 void removeSoftBody(btSoftBody* body);
139
140 void removeCollisionObject(btCollisionObject* collisionObject);
141
142 int getDrawFlags() const { return (m_drawFlags); }
143 void setDrawFlags(int f) { m_drawFlags = f; }
144
145 void setupConstraints();
146
147 void performDeformableCollisionDetection();
148
149 void solveMultiBodyConstraints();
150
151 void solveContactConstraints();
152
153 void sortConstraints();
154
155 void softBodySelfCollision();
156
157 void setImplicit(bool implicit)
158 {
159 m_implicit = implicit;
160 }
161
162 void setLineSearch(bool lineSearch)
163 {
164 m_lineSearch = lineSearch;
165 }
166
167 void setUseProjection(bool useProjection)
168 {
169 m_useProjection = useProjection;
170 }
171
172 void applyRepulsionForce(btScalar timeStep);
173
174 void performGeometricCollisions(btScalar timeStep);
175
176 struct btDeformableSingleRayCallback : public btBroadphaseRayCallback
177 {
178 btVector3 m_rayFromWorld;
179 btVector3 m_rayToWorld;
180 btTransform m_rayFromTrans;
181 btTransform m_rayToTrans;
182 btVector3 m_hitNormal;
183
184 const btDeformableMultiBodyDynamicsWorld* m_world;
185 btCollisionWorld::RayResultCallback& m_resultCallback;
186
187 btDeformableSingleRayCallback(const btVector3& rayFromWorld, const btVector3& rayToWorld, const btDeformableMultiBodyDynamicsWorld* world, btCollisionWorld::RayResultCallback& resultCallback)
188 : m_rayFromWorld(rayFromWorld),
189 m_rayToWorld(rayToWorld),
190 m_world(world),
191 m_resultCallback(resultCallback)
192 {
193 m_rayFromTrans.setIdentity();
194 m_rayFromTrans.setOrigin(m_rayFromWorld);
195 m_rayToTrans.setIdentity();
196 m_rayToTrans.setOrigin(m_rayToWorld);
197
198 btVector3 rayDir = (rayToWorld - rayFromWorld);
199
200 rayDir.normalize();
202 m_rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[0];
203 m_rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[1];
204 m_rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[2];
205 m_signs[0] = m_rayDirectionInverse[0] < 0.0;
206 m_signs[1] = m_rayDirectionInverse[1] < 0.0;
207 m_signs[2] = m_rayDirectionInverse[2] < 0.0;
208
209 m_lambda_max = rayDir.dot(m_rayToWorld - m_rayFromWorld);
210 }
211
212 virtual bool process(const btBroadphaseProxy* proxy)
213 {
215 if (m_resultCallback.m_closestHitFraction == btScalar(0.f))
216 return false;
217
218 btCollisionObject* collisionObject = (btCollisionObject*)proxy->m_clientObject;
219
220 //only perform raycast if filterMask matches
221 if (m_resultCallback.needsCollision(collisionObject->getBroadphaseHandle()))
222 {
223 //RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
224 //btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
225 #if 0
226 #ifdef RECALCULATE_AABB
227 btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
228 collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax);
229 #else
230 //getBroadphase()->getAabb(collisionObject->getBroadphaseHandle(),collisionObjectAabbMin,collisionObjectAabbMax);
231 const btVector3& collisionObjectAabbMin = collisionObject->getBroadphaseHandle()->m_aabbMin;
232 const btVector3& collisionObjectAabbMax = collisionObject->getBroadphaseHandle()->m_aabbMax;
233 #endif
234 #endif
235 //btScalar hitLambda = m_resultCallback.m_closestHitFraction;
236 //culling already done by broadphase
237 //if (btRayAabb(m_rayFromWorld,m_rayToWorld,collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,m_hitNormal))
238 {
239 m_world->rayTestSingle(m_rayFromTrans, m_rayToTrans,
240 collisionObject,
241 collisionObject->getCollisionShape(),
242 collisionObject->getWorldTransform(),
243 m_resultCallback);
244 }
245 }
246 return true;
247 }
248 };
249
250 void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const
251 {
252 BT_PROFILE("rayTest");
255 btDeformableSingleRayCallback rayCB(rayFromWorld, rayToWorld, this, resultCallback);
256
257 #ifndef USE_BRUTEFORCE_RAYBROADPHASE
258 m_broadphasePairCache->rayTest(rayFromWorld, rayToWorld, rayCB);
259 #else
260 for (int i = 0; i < this->getNumCollisionObjects(); i++)
261 {
262 rayCB.process(m_collisionObjects[i]->getBroadphaseHandle());
263 }
264 #endif //USE_BRUTEFORCE_RAYBROADPHASE
265 }
266
267 void rayTestSingle(const btTransform& rayFromTrans, const btTransform& rayToTrans,
268 btCollisionObject* collisionObject,
269 const btCollisionShape* collisionShape,
270 const btTransform& colObjWorldTransform,
271 RayResultCallback& resultCallback) const
272 {
273 if (collisionShape->isSoftBody())
274 {
275 btSoftBody* softBody = btSoftBody::upcast(collisionObject);
276 if (softBody)
277 {
278 btSoftBody::sRayCast softResult;
279 if (softBody->rayFaceTest(rayFromTrans.getOrigin(), rayToTrans.getOrigin(), softResult))
280 {
281 if (softResult.fraction <= resultCallback.m_closestHitFraction)
282 {
283 btCollisionWorld::LocalShapeInfo shapeInfo;
284 shapeInfo.m_shapePart = 0;
285 shapeInfo.m_triangleIndex = softResult.index;
286 // get the normal
287 btVector3 rayDir = rayToTrans.getOrigin() - rayFromTrans.getOrigin();
288 btVector3 normal = -rayDir;
289 normal.normalize();
290 {
291 normal = softBody->m_faces[softResult.index].m_normal;
292 if (normal.dot(rayDir) > 0)
293 {
294 // normal always point toward origin of the ray
295 normal = -normal;
296 }
297 }
298
299 btCollisionWorld::LocalRayResult rayResult(collisionObject,
300 &shapeInfo,
301 normal,
302 softResult.fraction);
303 bool normalInWorldSpace = true;
304 resultCallback.addSingleResult(rayResult, normalInWorldSpace);
305 }
306 }
307 }
308 }
309 else
310 {
311 btCollisionWorld::rayTestSingle(rayFromTrans, rayToTrans, collisionObject, collisionShape, colObjWorldTransform, resultCallback);
312 }
313 }
314 };
315
316 #endif //BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD_H
btSimulationIslandManager.h
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:50
btDeformableMultiBodyDynamicsWorld::TVStack
btAlignedObjectArray< btVector3 > TVStack
Definition: btDeformableMultiBodyDynamicsWorld.h:39
btBroadphaseProxy
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
Definition: btBroadphaseProxy.h:86
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_hitNormal
btVector3 m_hitNormal
Definition: btDeformableMultiBodyDynamicsWorld.h:182
btDeformableMultiBodyDynamicsWorld::getWorldType
virtual btDynamicsWorldType getWorldType() const
Definition: btDeformableMultiBodyDynamicsWorld.h:95
btCollisionWorld::rayTestSingle
static void rayTestSingle(const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback)
rayTestSingle performs a raycast call and calls the resultCallback.
Definition: btCollisionWorld.cpp:277
btDeformableMultiBodyDynamicsWorld::solveConstraints
void solveConstraints(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:379
btDeformableMultiBodyDynamicsWorld::getDrawFlags
int getDrawFlags() const
Definition: btDeformableMultiBodyDynamicsWorld.h:142
btDeformableMassSpringForce.h
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
btBroadphaseProxy::DefaultFilter
@ DefaultFilter
Definition: btBroadphaseProxy.h:92
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:77
btDeformableMultiBodyDynamicsWorld::m_implicit
bool m_implicit
Definition: btDeformableMultiBodyDynamicsWorld.h:50
btDeformableMultiBodyDynamicsWorld::rayTest
void rayTest(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, RayResultCallback &resultCallback) const
rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback This ...
Definition: btDeformableMultiBodyDynamicsWorld.h:250
btDeformableMultiBodyDynamicsWorld::getWorldInfo
btSoftBodyWorldInfo & getWorldInfo()
Definition: btDeformableMultiBodyDynamicsWorld.h:114
btCollisionWorld::m_collisionObjects
btAlignedObjectArray< btCollisionObject * > m_collisionObjects
Definition: btCollisionWorld.h:88
btSoftBody::upcast
static const btSoftBody * upcast(const btCollisionObject *colObj)
Definition: btSoftBody.h:1142
btDeformableMultiBodyDynamicsWorld::positionCorrection
void positionCorrection(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:273
btVector3::dot
btScalar dot(const btVector3 &v) const
Return the dot product.
Definition: btVector3.h:229
btDeformableMultiBodyDynamicsWorld::debugDrawWorld
virtual void debugDrawWorld()
Definition: btDeformableMultiBodyDynamicsWorld.cpp:546
btCollisionWorld::m_broadphasePairCache
btBroadphaseInterface * m_broadphasePairCache
Definition: btCollisionWorld.h:94
btSoftBody::rayFaceTest
bool rayFaceTest(const btVector3 &rayFrom, const btVector3 &rayTo, sRayCast &results)
Definition: btSoftBody.cpp:2036
btSoftBody::m_faces
tFaceArray m_faces
Definition: btSoftBody.h:815
btDeformableMultiBodyDynamicsWorld::m_ccdIterations
int m_ccdIterations
Definition: btDeformableMultiBodyDynamicsWorld.h:49
BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD
@ BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD
Definition: btDynamicsWorld.h:38
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_rayToTrans
btTransform m_rayToTrans
Definition: btDeformableMultiBodyDynamicsWorld.h:181
btDeformableMultiBodyDynamicsWorld::softBodySelfCollision
void softBodySelfCollision()
Definition: btDeformableMultiBodyDynamicsWorld.cpp:260
btDeformableMultiBodyDynamicsWorld::solveMultiBodyConstraints
void solveMultiBodyConstraints()
btBroadphaseRayCallback::m_lambda_max
btScalar m_lambda_max
Definition: btBroadphaseInterface.h:36
btDeformableMultiBodyDynamicsWorld::m_drawClusterTree
bool m_drawClusterTree
Definition: btDeformableMultiBodyDynamicsWorld.h:46
btCollisionWorld::LocalShapeInfo::m_triangleIndex
int m_triangleIndex
Definition: btCollisionWorld.h:169
btDeformableMultiBodyDynamicsWorld::setupConstraints
void setupConstraints()
Definition: btDeformableMultiBodyDynamicsWorld.cpp:407
btSoftBodyWorldInfo
Definition: btSoftBody.h:48
btDeformableMultiBodyDynamicsWorld::reinitialize
void reinitialize(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:521
btTransform::setIdentity
void setIdentity()
Set this transformation to the identity.
Definition: btTransform.h:166
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_resultCallback
btCollisionWorld::RayResultCallback & m_resultCallback
Definition: btDeformableMultiBodyDynamicsWorld.h:185
btDeformableMultiBodyDynamicsWorld::m_softBodies
btSoftBodyArray m_softBodies
Definition: btDeformableMultiBodyDynamicsWorld.h:42
btSoftBody::sRayCast
Definition: btSoftBody.h:202
btDeformableMultiBodyDynamicsWorld::m_useProjection
bool m_useProjection
Definition: btDeformableMultiBodyDynamicsWorld.h:52
btDeformableMultiBodyDynamicsWorld::addSoftBody
virtual void addSoftBody(btSoftBody *body, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:501
btCollisionObject::getWorldTransform
btTransform & getWorldTransform()
Definition: btCollisionObject.h:378
btDeformableMultiBodyDynamicsWorld::removeForce
void removeForce(btSoftBody *psb, btDeformableLagrangianForce *force)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:703
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
Definition: btCollisionShape.h:28
btSoftBody::sRayCast::fraction
btScalar fraction
feature index
Definition: btSoftBody.h:206
btDeformableMultiBodyDynamicsWorld::beforeSolverCallbacks
void beforeSolverCallbacks(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:661
btCollisionWorld::RayResultCallback::m_closestHitFraction
btScalar m_closestHitFraction
Definition: btCollisionWorld.h:197
MultiBodyInplaceSolverIslandCallback
Definition: btMultiBodyInplaceSolverIslandCallback.h:66
btCollisionWorld::LocalRayResult
Definition: btCollisionWorld.h:176
btDeformableMultiBodyDynamicsWorld::setLineSearch
void setLineSearch(bool lineSearch)
Definition: btDeformableMultiBodyDynamicsWorld.h:162
btBroadphaseProxy::AllFilter
@ AllFilter
Definition: btBroadphaseProxy.h:98
btDynamicsWorldType
btDynamicsWorldType
Definition: btDynamicsWorld.h:31
btDeformableMultiBodyConstraintSolver.h
btDeformableMultiBodyDynamicsWorld::stepSimulation
virtual int stepSimulation(btScalar timeStep, int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.))
if maxSubSteps > 0, it will interpolate motion between fixedTimeStep's
Definition: btDeformableMultiBodyDynamicsWorld.cpp:748
btDeformableMultiBodyDynamicsWorld::performDeformableCollisionDetection
void performDeformableCollisionDetection()
Definition: btDeformableMultiBodyDynamicsWorld.cpp:118
btBroadphaseProxy::m_clientObject
void * m_clientObject
Definition: btBroadphaseProxy.h:102
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_world
const btDeformableMultiBodyDynamicsWorld * m_world
Definition: btDeformableMultiBodyDynamicsWorld.h:184
btDeformableMultiBodyDynamicsWorld::internalSingleStepSimulation
virtual void internalSingleStepSimulation(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:75
btDeformableLagrangianForce
Definition: btDeformableLagrangianForce.h:39
btBroadphaseProxy::m_aabbMax
btVector3 m_aabbMax
Definition: btBroadphaseProxy.h:109
btCollisionWorld::LocalShapeInfo::m_shapePart
int m_shapePart
Definition: btCollisionWorld.h:168
btCollisionObject::getBroadphaseHandle
btBroadphaseProxy * getBroadphaseHandle()
Definition: btCollisionObject.h:394
btCollisionShape::getAabb
virtual void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const =0
getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_rayToWorld
btVector3 m_rayToWorld
Definition: btDeformableMultiBodyDynamicsWorld.h:179
btCollisionWorld::getNumCollisionObjects
int getNumCollisionObjects() const
Definition: btCollisionWorld.h:427
btBroadphaseInterface::rayTest
virtual void rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, btBroadphaseRayCallback &rayCallback, const btVector3 &aabbMin=btVector3(0, 0, 0), const btVector3 &aabbMax=btVector3(0, 0, 0))=0
btDeformableMultiBodyDynamicsWorld::sortConstraints
void sortConstraints()
Definition: btDeformableMultiBodyDynamicsWorld.cpp:425
btBroadphaseRayCallback::m_signs
unsigned int m_signs[3]
Definition: btBroadphaseInterface.h:35
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:30
btDeformableMultiBodyDynamicsWorld::setSolverCallback
void setSolverCallback(btSolverCallback cb)
Definition: btDeformableMultiBodyDynamicsWorld.h:78
btDeformableMultiBodyDynamicsWorld::applyRepulsionForce
void applyRepulsionForce(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:163
btDeformableMultiBodyDynamicsWorld::addForce
void addForce(btSoftBody *psb, btDeformableLagrangianForce *force)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:682
btDeformableMultiBodyDynamicsWorld::setUseProjection
void setUseProjection(bool useProjection)
Definition: btDeformableMultiBodyDynamicsWorld.h:167
btBroadphaseProxy::m_aabbMin
btVector3 m_aabbMin
Definition: btBroadphaseProxy.h:108
btDeformableMultiBodyDynamicsWorld::~btDeformableMultiBodyDynamicsWorld
virtual ~btDeformableMultiBodyDynamicsWorld()
Definition: btDeformableMultiBodyDynamicsWorld.cpp:70
btDeformableMultiBodyDynamicsWorld::rayTestSingle
void rayTestSingle(const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback) const
Definition: btDeformableMultiBodyDynamicsWorld.h:267
btDeformableMultiBodyDynamicsWorld::m_deformableBodySolver
btDeformableBodySolver * m_deformableBodySolver
Solver classes that encapsulate multiple deformable bodies for solving.
Definition: btDeformableMultiBodyDynamicsWorld.h:41
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:82
btDeformableMultiBodyDynamicsWorld::m_lineSearch
bool m_lineSearch
Definition: btDeformableMultiBodyDynamicsWorld.h:51
btDeformableMultiBodyDynamicsWorld::afterSolverCallbacks
void afterSolverCallbacks(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:674
btTransform::getOrigin
btVector3 & getOrigin()
Return the origin vector translation.
Definition: btTransform.h:113
btDeformableMultiBodyDynamicsWorld::performGeometricCollisions
void performGeometricCollisions(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:176
btCollisionWorld::LocalShapeInfo
LocalShapeInfo gives extra information for complex shapes Currently, only btTriangleMeshShape is avai...
Definition: btCollisionWorld.h:167
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::btDeformableSingleRayCallback
btDeformableSingleRayCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const btDeformableMultiBodyDynamicsWorld *world, btCollisionWorld::RayResultCallback &resultCallback)
Definition: btDeformableMultiBodyDynamicsWorld.h:187
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_rayFromTrans
btTransform m_rayFromTrans
Definition: btDeformableMultiBodyDynamicsWorld.h:180
btDeformableMultiBodyDynamicsWorld::m_solverCallback
btSolverCallback m_solverCallback
Definition: btDeformableMultiBodyDynamicsWorld.h:56
btDeformableMultiBodyDynamicsWorld::m_sbi
btSoftBodyWorldInfo m_sbi
Definition: btDeformableMultiBodyDynamicsWorld.h:47
btDeformableMultiBodyDynamicsWorld::clearGravity
void clearGravity()
Definition: btDeformableMultiBodyDynamicsWorld.cpp:620
btDeformableMultiBodyDynamicsWorld::m_drawFlags
int m_drawFlags
Definition: btDeformableMultiBodyDynamicsWorld.h:43
btAlignedObjectArray< btSoftBody * >
btCollisionWorld::RayResultCallback::needsCollision
virtual bool needsCollision(btBroadphaseProxy *proxy0) const
Definition: btCollisionWorld.h:222
btDeformableMultiBodyDynamicsWorld::solveContactConstraints
void solveContactConstraints()
Definition: btDeformableMultiBodyDynamicsWorld.cpp:443
btDeformableMultiBodyDynamicsWorld::removeSoftBodyForce
void removeSoftBodyForce(btSoftBody *psb)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:721
btSoftBody
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
Definition: btSoftBody.h:75
btDeformableBodySolver.h
btBroadphaseInterface
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
Definition: btBroadphaseInterface.h:50
btDeformableMultiBodyConstraintSolver
Definition: btDeformableMultiBodyConstraintSolver.h:33
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::process
virtual bool process(const btBroadphaseProxy *proxy)
Definition: btDeformableMultiBodyDynamicsWorld.h:212
btDeformableMultiBodyDynamicsWorld::removeSoftBody
void removeSoftBody(btSoftBody *body)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:730
btDeformableMultiBodyDynamicsWorld::integrateTransforms
virtual void integrateTransforms(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:295
btDeformableMultiBodyDynamicsWorld::getMultiBodyDynamicsWorld
virtual const btMultiBodyDynamicsWorld * getMultiBodyDynamicsWorld() const
Definition: btDeformableMultiBodyDynamicsWorld.h:90
btSoftBodyHelpers.h
btCollisionWorld::RayResultCallback::addSingleResult
virtual btScalar addSingleResult(LocalRayResult &rayResult, bool normalInWorldSpace)=0
btDeformableMultiBodyDynamicsWorld::getWorldInfo
const btSoftBodyWorldInfo & getWorldInfo() const
Definition: btDeformableMultiBodyDynamicsWorld.h:119
btDeformableMultiBodyDynamicsWorld::removeCollisionObject
void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
Definition: btDeformableMultiBodyDynamicsWorld.cpp:739
btDeformableMultiBodyDynamicsWorld::applyRigidBodyGravity
void applyRigidBodyGravity(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:560
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_rayFromWorld
btVector3 m_rayFromWorld
Definition: btDeformableMultiBodyDynamicsWorld.h:178
btDeformableMultiBodyDynamicsWorld::setDrawFlags
void setDrawFlags(int f)
Definition: btDeformableMultiBodyDynamicsWorld.h:143
btDeformableMultiBodyDynamicsWorld::m_drawNodeTree
bool m_drawNodeTree
Definition: btDeformableMultiBodyDynamicsWorld.h:44
btDeformableBodySolver
Definition: btDeformableBodySolver.h:31
btDeformableMultiBodyDynamicsWorld::getSoftBodyArray
btSoftBodyArray & getSoftBodyArray()
Definition: btDeformableMultiBodyDynamicsWorld.h:104
btDeformableMultiBodyDynamicsWorld::m_solverDeformableBodyIslandCallback
DeformableBodyInplaceSolverIslandCallback * m_solverDeformableBodyIslandCallback
Definition: btDeformableMultiBodyDynamicsWorld.h:53
btMultiBodyDynamicsWorld
The btMultiBodyDynamicsWorld adds Featherstone multi body dynamics to Bullet This implementation is s...
Definition: btMultiBodyDynamicsWorld.h:32
btDeformableMultiBodyDynamicsWorld::getSoftBodyArray
const btSoftBodyArray & getSoftBodyArray() const
Definition: btDeformableMultiBodyDynamicsWorld.h:109
btCollisionWorld::RayResultCallback
RayResultCallback is used to report new raycast results.
Definition: btCollisionWorld.h:196
DeformableBodyInplaceSolverIslandCallback
Definition: DeformableBodyInplaceSolverIslandCallback.h:12
btCollisionConfiguration
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size,...
Definition: btCollisionConfiguration.h:27
btSoftBodyArray
btAlignedObjectArray< btSoftBody * > btSoftBodyArray
Definition: btDeformableMultiBodyDynamicsWorld.h:27
btDeformableLagrangianForce.h
btTransform::setOrigin
void setOrigin(const btVector3 &origin)
Set the translational element.
Definition: btTransform.h:146
btDeformableMultiBodyDynamicsWorld::btDeformableMultiBodyDynamicsWorld
btDeformableMultiBodyDynamicsWorld(btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btDeformableMultiBodyConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration, btDeformableBodySolver *deformableBodySolver=0)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:42
btVector3::normalize
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
Definition: btVector3.h:303
btDeformableMultiBodyDynamicsWorld::m_internalTime
btScalar m_internalTime
Definition: btDeformableMultiBodyDynamicsWorld.h:48
BT_PROFILE
#define BT_PROFILE(name)
Definition: btQuickprof.h:198
btDeformableMultiBodyDynamicsWorld::btSolverCallback
void(* btSolverCallback)(btScalar time, btDeformableMultiBodyDynamicsWorld *world)
Definition: btDeformableMultiBodyDynamicsWorld.h:55
btDeformableMultiBodyDynamicsWorld::getMultiBodyDynamicsWorld
virtual btMultiBodyDynamicsWorld * getMultiBodyDynamicsWorld()
Definition: btDeformableMultiBodyDynamicsWorld.h:85
btDeformableMultiBodyDynamicsWorld::updateActivationState
void updateActivationState(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:139
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback
Definition: btDeformableMultiBodyDynamicsWorld.h:177
btDeformableMultiBodyDynamicsWorld::predictUnconstraintMotion
virtual void predictUnconstraintMotion(btScalar timeStep)
Definition: btDeformableMultiBodyDynamicsWorld.cpp:514
btBroadphaseRayCallback
Definition: btBroadphaseInterface.h:32
btCollisionShape::isSoftBody
bool isSoftBody() const
Definition: btCollisionShape.h:87
btSoftBody::sRayCast::index
int index
feature type
Definition: btSoftBody.h:205
btSoftMultiBodyDynamicsWorld.h
btBroadphaseRayCallback::m_rayDirectionInverse
btVector3 m_rayDirectionInverse
added some cached data to accelerate ray-AABB tests
Definition: btBroadphaseInterface.h:34
btDeformableMultiBodyDynamicsWorld::setImplicit
void setImplicit(bool implicit)
Definition: btDeformableMultiBodyDynamicsWorld.h:157
btCollisionObject::getCollisionShape
const btCollisionShape * getCollisionShape() const
Definition: btCollisionObject.h:227
btDeformableMultiBodyDynamicsWorld::m_drawFaceTree
bool m_drawFaceTree
Definition: btDeformableMultiBodyDynamicsWorld.h:45
btDeformableMultiBodyDynamicsWorld
Definition: btDeformableMultiBodyDynamicsWorld.h:38