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

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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
29class btDeformableBodySolver;
30class btDeformableLagrangianForce;
31struct MultiBodyInplaceSolverIslandCallback;
32struct DeformableBodyInplaceSolverIslandCallback;
33class btDeformableMultiBodyConstraintSolver;
34
35typedef 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
58protected:
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
71public:
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 virtual void setGravity(const btVector3& gravity);
125
126 void reinitialize(btScalar timeStep);
127
128 void applyRigidBodyGravity(btScalar timeStep);
129
130 void beforeSolverCallbacks(btScalar timeStep);
131
132 void afterSolverCallbacks(btScalar timeStep);
133
134 void addForce(btSoftBody* psb, btDeformableLagrangianForce* force);
135
136 void removeForce(btSoftBody* psb, btDeformableLagrangianForce* force);
137
138 void removeSoftBodyForce(btSoftBody* psb);
139
140 void removeSoftBody(btSoftBody* body);
141
142 void removeCollisionObject(btCollisionObject* collisionObject);
143
144 int getDrawFlags() const { return (m_drawFlags); }
145 void setDrawFlags(int f) { m_drawFlags = f; }
146
147 void setupConstraints();
148
149 void performDeformableCollisionDetection();
150
151 void solveMultiBodyConstraints();
152
153 void solveContactConstraints();
154
155 void sortConstraints();
156
157 void softBodySelfCollision();
158
159 void setImplicit(bool implicit)
160 {
161 m_implicit = implicit;
162 }
163
164 void setLineSearch(bool lineSearch)
165 {
166 m_lineSearch = lineSearch;
167 }
168
169 void setUseProjection(bool useProjection)
170 {
171 m_useProjection = useProjection;
172 }
173
174 void applyRepulsionForce(btScalar timeStep);
175
176 void performGeometricCollisions(btScalar timeStep);
177
178 struct btDeformableSingleRayCallback : public btBroadphaseRayCallback
179 {
180 btVector3 m_rayFromWorld;
181 btVector3 m_rayToWorld;
182 btTransform m_rayFromTrans;
183 btTransform m_rayToTrans;
184 btVector3 m_hitNormal;
185
186 const btDeformableMultiBodyDynamicsWorld* m_world;
187 btCollisionWorld::RayResultCallback& m_resultCallback;
188
189 btDeformableSingleRayCallback(const btVector3& rayFromWorld, const btVector3& rayToWorld, const btDeformableMultiBodyDynamicsWorld* world, btCollisionWorld::RayResultCallback& resultCallback)
190 : m_rayFromWorld(rayFromWorld),
191 m_rayToWorld(rayToWorld),
192 m_world(world),
193 m_resultCallback(resultCallback)
194 {
195 m_rayFromTrans.setIdentity();
196 m_rayFromTrans.setOrigin(m_rayFromWorld);
197 m_rayToTrans.setIdentity();
198 m_rayToTrans.setOrigin(m_rayToWorld);
199
200 btVector3 rayDir = (rayToWorld - rayFromWorld);
201
202 rayDir.normalize();
204 m_rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[0];
205 m_rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[1];
206 m_rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[2];
207 m_signs[0] = m_rayDirectionInverse[0] < 0.0;
208 m_signs[1] = m_rayDirectionInverse[1] < 0.0;
209 m_signs[2] = m_rayDirectionInverse[2] < 0.0;
210
211 m_lambda_max = rayDir.dot(m_rayToWorld - m_rayFromWorld);
212 }
213
214 virtual bool process(const btBroadphaseProxy* proxy)
215 {
217 if (m_resultCallback.m_closestHitFraction == btScalar(0.f))
218 return false;
219
220 btCollisionObject* collisionObject = (btCollisionObject*)proxy->m_clientObject;
221
222 //only perform raycast if filterMask matches
223 if (m_resultCallback.needsCollision(collisionObject->getBroadphaseHandle()))
224 {
225 //RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
226 //btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
227#if 0
228#ifdef RECALCULATE_AABB
229 btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
230 collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax);
231#else
232 //getBroadphase()->getAabb(collisionObject->getBroadphaseHandle(),collisionObjectAabbMin,collisionObjectAabbMax);
233 const btVector3& collisionObjectAabbMin = collisionObject->getBroadphaseHandle()->m_aabbMin;
234 const btVector3& collisionObjectAabbMax = collisionObject->getBroadphaseHandle()->m_aabbMax;
235#endif
236#endif
237 //btScalar hitLambda = m_resultCallback.m_closestHitFraction;
238 //culling already done by broadphase
239 //if (btRayAabb(m_rayFromWorld,m_rayToWorld,collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,m_hitNormal))
240 {
241 m_world->rayTestSingle(m_rayFromTrans, m_rayToTrans,
242 collisionObject,
243 collisionObject->getCollisionShape(),
244 collisionObject->getWorldTransform(),
245 m_resultCallback);
246 }
247 }
248 return true;
249 }
250 };
251
252 void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const
253 {
254 BT_PROFILE("rayTest");
257 btDeformableSingleRayCallback rayCB(rayFromWorld, rayToWorld, this, resultCallback);
258
259#ifndef USE_BRUTEFORCE_RAYBROADPHASE
260 m_broadphasePairCache->rayTest(rayFromWorld, rayToWorld, rayCB);
261#else
262 for (int i = 0; i < this->getNumCollisionObjects(); i++)
263 {
264 rayCB.process(m_collisionObjects[i]->getBroadphaseHandle());
265 }
266#endif //USE_BRUTEFORCE_RAYBROADPHASE
267 }
268
269 void rayTestSingle(const btTransform& rayFromTrans, const btTransform& rayToTrans,
270 btCollisionObject* collisionObject,
271 const btCollisionShape* collisionShape,
272 const btTransform& colObjWorldTransform,
273 RayResultCallback& resultCallback) const
274 {
275 if (collisionShape->isSoftBody())
276 {
277 btSoftBody* softBody = btSoftBody::upcast(collisionObject);
278 if (softBody)
279 {
280 btSoftBody::sRayCast softResult;
281 if (softBody->rayFaceTest(rayFromTrans.getOrigin(), rayToTrans.getOrigin(), softResult))
282 {
283 if (softResult.fraction <= resultCallback.m_closestHitFraction)
284 {
285 btCollisionWorld::LocalShapeInfo shapeInfo;
286 shapeInfo.m_shapePart = 0;
287 shapeInfo.m_triangleIndex = softResult.index;
288 // get the normal
289 btVector3 rayDir = rayToTrans.getOrigin() - rayFromTrans.getOrigin();
290 btVector3 normal = -rayDir;
291 normal.normalize();
292 {
293 normal = softBody->m_faces[softResult.index].m_normal;
294 if (normal.dot(rayDir) > 0)
295 {
296 // normal always point toward origin of the ray
297 normal = -normal;
298 }
299 }
300
301 btCollisionWorld::LocalRayResult rayResult(collisionObject,
302 &shapeInfo,
303 normal,
304 softResult.fraction);
305 bool normalInWorldSpace = true;
306 resultCallback.addSingleResult(rayResult, normalInWorldSpace);
307 }
308 }
309 }
310 }
311 else
312 {
313 btCollisionWorld::rayTestSingle(rayFromTrans, rayToTrans, collisionObject, collisionShape, colObjWorldTransform, resultCallback);
314 }
315 }
316};
317
318#endif //BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD_H
btDeformableLagrangianForce.h
btDeformableMassSpringForce.h
btDeformableMultiBodyConstraintSolver.h
btSoftBodyArray
btAlignedObjectArray< btSoftBody * > btSoftBodyArray
Definition btDeformableMultiBodyDynamicsWorld.h:27
btDynamicsWorldType
btDynamicsWorldType
Definition btDynamicsWorld.h:31
BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD
@ BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD
Definition btDynamicsWorld.h:38
BT_PROFILE
#define BT_PROFILE(name)
Definition btQuickprof.h:198
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition btScalar.h:314
btSimulationIslandManager.h
btSoftBodyHelpers.h
btSoftMultiBodyDynamicsWorld.h
btAlignedObjectArray
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
Definition btAlignedObjectArray.h:46
btBroadphaseInterface
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
Definition btBroadphaseInterface.h:50
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
btCollisionConfiguration
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size,...
Definition btCollisionConfiguration.h:27
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition btCollisionObject.h:51
btCollisionObject::getWorldTransform
btTransform & getWorldTransform()
Definition btCollisionObject.h:379
btCollisionObject::getBroadphaseHandle
btBroadphaseProxy * getBroadphaseHandle()
Definition btCollisionObject.h:395
btCollisionObject::getCollisionShape
const btCollisionShape * getCollisionShape() const
Definition btCollisionObject.h:228
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
Definition btCollisionShape.h:28
btCollisionShape::isSoftBody
bool isSoftBody() const
Definition btCollisionShape.h:87
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.
btCollisionWorld::m_broadphasePairCache
btBroadphaseInterface * m_broadphasePairCache
Definition btCollisionWorld.h:94
btCollisionWorld::m_collisionObjects
btAlignedObjectArray< btCollisionObject * > m_collisionObjects
Definition btCollisionWorld.h:88
btCollisionWorld::getNumCollisionObjects
int getNumCollisionObjects() const
Definition btCollisionWorld.h:427
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:276
btDeformableBodySolver
Definition btDeformableBodySolver.h:31
btDeformableLagrangianForce
Definition btDeformableLagrangianForce.h:39
btDeformableMultiBodyConstraintSolver
Definition btDeformableMultiBodyConstraintSolver.h:33
btDeformableMultiBodyDynamicsWorld
Definition btDeformableMultiBodyDynamicsWorld.h:38
btDeformableMultiBodyDynamicsWorld::setImplicit
void setImplicit(bool implicit)
Definition btDeformableMultiBodyDynamicsWorld.h:159
btDeformableMultiBodyDynamicsWorld::m_drawFaceTree
bool m_drawFaceTree
Definition btDeformableMultiBodyDynamicsWorld.h:45
btDeformableMultiBodyDynamicsWorld::setLineSearch
void setLineSearch(bool lineSearch)
Definition btDeformableMultiBodyDynamicsWorld.h:164
btDeformableMultiBodyDynamicsWorld::getWorldInfo
const btSoftBodyWorldInfo & getWorldInfo() const
Definition btDeformableMultiBodyDynamicsWorld.h:119
btDeformableMultiBodyDynamicsWorld::applyRigidBodyGravity
void applyRigidBodyGravity(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:491
btDeformableMultiBodyDynamicsWorld::getWorldInfo
btSoftBodyWorldInfo & getWorldInfo()
Definition btDeformableMultiBodyDynamicsWorld.h:114
btDeformableMultiBodyDynamicsWorld::solveMultiBodyConstraints
void solveMultiBodyConstraints()
btDeformableMultiBodyDynamicsWorld::setUseProjection
void setUseProjection(bool useProjection)
Definition btDeformableMultiBodyDynamicsWorld.h:169
btDeformableMultiBodyDynamicsWorld::btDeformableMultiBodyDynamicsWorld
btDeformableMultiBodyDynamicsWorld(btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btDeformableMultiBodyConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration, btDeformableBodySolver *deformableBodySolver=0)
Definition btDeformableMultiBodyDynamicsWorld.cpp:42
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:670
btDeformableMultiBodyDynamicsWorld::m_drawFlags
int m_drawFlags
Definition btDeformableMultiBodyDynamicsWorld.h:43
btDeformableMultiBodyDynamicsWorld::addSoftBody
virtual void addSoftBody(btSoftBody *body, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
Definition btDeformableMultiBodyDynamicsWorld.cpp:426
btDeformableMultiBodyDynamicsWorld::removeSoftBodyForce
void removeSoftBodyForce(btSoftBody *psb)
Definition btDeformableMultiBodyDynamicsWorld.cpp:652
btDeformableMultiBodyDynamicsWorld::getSoftBodyArray
const btSoftBodyArray & getSoftBodyArray() const
Definition btDeformableMultiBodyDynamicsWorld.h:109
btDeformableMultiBodyDynamicsWorld::sortConstraints
void sortConstraints()
Definition btDeformableMultiBodyDynamicsWorld.cpp:350
btDeformableMultiBodyDynamicsWorld::removeSoftBody
void removeSoftBody(btSoftBody *body)
Definition btDeformableMultiBodyDynamicsWorld.cpp:661
btDeformableMultiBodyDynamicsWorld::reinitialize
void reinitialize(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:452
btDeformableMultiBodyDynamicsWorld::m_drawNodeTree
bool m_drawNodeTree
Definition btDeformableMultiBodyDynamicsWorld.h:44
btDeformableMultiBodyDynamicsWorld::positionCorrection
void positionCorrection(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:274
btDeformableMultiBodyDynamicsWorld::predictUnconstraintMotion
virtual void predictUnconstraintMotion(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:439
btDeformableMultiBodyDynamicsWorld::afterSolverCallbacks
void afterSolverCallbacks(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:605
btDeformableMultiBodyDynamicsWorld::applyRepulsionForce
void applyRepulsionForce(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:163
btDeformableMultiBodyDynamicsWorld::rayTestSingle
void rayTestSingle(const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback) const
Definition btDeformableMultiBodyDynamicsWorld.h:269
btDeformableMultiBodyDynamicsWorld::debugDrawWorld
virtual void debugDrawWorld()
Definition btDeformableMultiBodyDynamicsWorld.cpp:477
btDeformableMultiBodyDynamicsWorld::solveConstraints
void solveConstraints(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:304
btDeformableMultiBodyDynamicsWorld::addForce
void addForce(btSoftBody *psb, btDeformableLagrangianForce *force)
Definition btDeformableMultiBodyDynamicsWorld.cpp:613
btDeformableMultiBodyDynamicsWorld::setupConstraints
void setupConstraints()
Definition btDeformableMultiBodyDynamicsWorld.cpp:332
btDeformableMultiBodyDynamicsWorld::softBodySelfCollision
void softBodySelfCollision()
Definition btDeformableMultiBodyDynamicsWorld.cpp:261
btDeformableMultiBodyDynamicsWorld::btSolverCallback
void(*) btSolverCallback(btScalar time, btDeformableMultiBodyDynamicsWorld *world)
Definition btDeformableMultiBodyDynamicsWorld.h:55
btDeformableMultiBodyDynamicsWorld::m_solverCallback
btSolverCallback m_solverCallback
Definition btDeformableMultiBodyDynamicsWorld.h:56
btDeformableMultiBodyDynamicsWorld::performGeometricCollisions
void performGeometricCollisions(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:176
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:252
btDeformableMultiBodyDynamicsWorld::integrateTransforms
virtual void integrateTransforms(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:296
btDeformableMultiBodyDynamicsWorld::getWorldType
virtual btDynamicsWorldType getWorldType() const
Definition btDeformableMultiBodyDynamicsWorld.h:95
btDeformableMultiBodyDynamicsWorld::m_internalTime
btScalar m_internalTime
Definition btDeformableMultiBodyDynamicsWorld.h:48
btDeformableMultiBodyDynamicsWorld::removeForce
void removeForce(btSoftBody *psb, btDeformableLagrangianForce *force)
Definition btDeformableMultiBodyDynamicsWorld.cpp:634
btDeformableMultiBodyDynamicsWorld::m_sbi
btSoftBodyWorldInfo m_sbi
Definition btDeformableMultiBodyDynamicsWorld.h:47
btDeformableMultiBodyDynamicsWorld::internalSingleStepSimulation
virtual void internalSingleStepSimulation(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:75
btDeformableMultiBodyDynamicsWorld::m_ccdIterations
int m_ccdIterations
Definition btDeformableMultiBodyDynamicsWorld.h:49
btDeformableMultiBodyDynamicsWorld::updateActivationState
void updateActivationState(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:139
btDeformableMultiBodyDynamicsWorld::~btDeformableMultiBodyDynamicsWorld
virtual ~btDeformableMultiBodyDynamicsWorld()
Definition btDeformableMultiBodyDynamicsWorld.cpp:70
btDeformableMultiBodyDynamicsWorld::solveContactConstraints
void solveContactConstraints()
Definition btDeformableMultiBodyDynamicsWorld.cpp:368
btDeformableMultiBodyDynamicsWorld::setDrawFlags
void setDrawFlags(int f)
Definition btDeformableMultiBodyDynamicsWorld.h:145
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:679
btDeformableMultiBodyDynamicsWorld::getDrawFlags
int getDrawFlags() const
Definition btDeformableMultiBodyDynamicsWorld.h:144
btDeformableMultiBodyDynamicsWorld::m_softBodies
btSoftBodyArray m_softBodies
Definition btDeformableMultiBodyDynamicsWorld.h:42
btDeformableMultiBodyDynamicsWorld::setSolverCallback
void setSolverCallback(btSolverCallback cb)
Definition btDeformableMultiBodyDynamicsWorld.h:78
btDeformableMultiBodyDynamicsWorld::m_drawClusterTree
bool m_drawClusterTree
Definition btDeformableMultiBodyDynamicsWorld.h:46
btDeformableMultiBodyDynamicsWorld::m_useProjection
bool m_useProjection
Definition btDeformableMultiBodyDynamicsWorld.h:52
btDeformableMultiBodyDynamicsWorld::getMultiBodyDynamicsWorld
virtual const btMultiBodyDynamicsWorld * getMultiBodyDynamicsWorld() const
Definition btDeformableMultiBodyDynamicsWorld.h:90
btDeformableMultiBodyDynamicsWorld::m_solverDeformableBodyIslandCallback
DeformableBodyInplaceSolverIslandCallback * m_solverDeformableBodyIslandCallback
Definition btDeformableMultiBodyDynamicsWorld.h:53
btDeformableMultiBodyDynamicsWorld::setGravity
virtual void setGravity(const btVector3 &gravity)
Definition btDeformableMultiBodyDynamicsWorld.cpp:446
btDeformableMultiBodyDynamicsWorld::getSoftBodyArray
btSoftBodyArray & getSoftBodyArray()
Definition btDeformableMultiBodyDynamicsWorld.h:104
btDeformableMultiBodyDynamicsWorld::beforeSolverCallbacks
void beforeSolverCallbacks(btScalar timeStep)
Definition btDeformableMultiBodyDynamicsWorld.cpp:592
btDeformableMultiBodyDynamicsWorld::performDeformableCollisionDetection
void performDeformableCollisionDetection()
Definition btDeformableMultiBodyDynamicsWorld.cpp:118
btDeformableMultiBodyDynamicsWorld::TVStack
btAlignedObjectArray< btVector3 > TVStack
Definition btDeformableMultiBodyDynamicsWorld.h:39
btDeformableMultiBodyDynamicsWorld::clearGravity
void clearGravity()
Definition btDeformableMultiBodyDynamicsWorld.cpp:551
btDeformableMultiBodyDynamicsWorld::m_implicit
bool m_implicit
Definition btDeformableMultiBodyDynamicsWorld.h:50
btDeformableMultiBodyDynamicsWorld::m_deformableBodySolver
btDeformableBodySolver * m_deformableBodySolver
Solver classes that encapsulate multiple deformable bodies for solving.
Definition btDeformableMultiBodyDynamicsWorld.h:41
btDeformableMultiBodyDynamicsWorld::getMultiBodyDynamicsWorld
virtual btMultiBodyDynamicsWorld * getMultiBodyDynamicsWorld()
Definition btDeformableMultiBodyDynamicsWorld.h:85
btDeformableMultiBodyDynamicsWorld::m_lineSearch
bool m_lineSearch
Definition btDeformableMultiBodyDynamicsWorld.h:51
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition btDispatcher.h:77
btMultiBodyDynamicsWorld
The btMultiBodyDynamicsWorld adds Featherstone multi body dynamics to Bullet This implementation is s...
Definition btMultiBodyDynamicsWorld.h:32
btSoftBody
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
Definition btSoftBody.h:75
btSoftBody::rayFaceTest
bool rayFaceTest(const btVector3 &rayFrom, const btVector3 &rayTo, sRayCast &results)
Definition btSoftBody.cpp:2054
btSoftBody::m_faces
tFaceArray m_faces
Definition btSoftBody.h:817
btSoftBody::upcast
static const btSoftBody * upcast(const btCollisionObject *colObj)
Definition btSoftBody.h:1157
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition btTransform.h:30
btTransform::setIdentity
void setIdentity()
Set this transformation to the identity.
Definition btTransform.h:167
btTransform::getOrigin
btVector3 & getOrigin()
Return the origin vector translation.
Definition btTransform.h:114
btTransform::setOrigin
void setOrigin(const btVector3 &origin)
Set the translational element.
Definition btTransform.h:147
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition btVector3.h:82
btVector3::dot
btScalar dot(const btVector3 &v) const
Return the dot product.
Definition btVector3.h:229
btVector3::normalize
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
Definition btVector3.h:303
DeformableBodyInplaceSolverIslandCallback
Definition DeformableBodyInplaceSolverIslandCallback.h:12
MultiBodyInplaceSolverIslandCallback
Definition btMultiBodyInplaceSolverIslandCallback.h:66
btBroadphaseProxy
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
Definition btBroadphaseProxy.h:86
btBroadphaseProxy::AllFilter
@ AllFilter
Definition btBroadphaseProxy.h:98
btBroadphaseProxy::DefaultFilter
@ DefaultFilter
Definition btBroadphaseProxy.h:92
btBroadphaseProxy::m_aabbMin
btVector3 m_aabbMin
Definition btBroadphaseProxy.h:108
btBroadphaseProxy::m_clientObject
void * m_clientObject
Definition btBroadphaseProxy.h:102
btBroadphaseProxy::m_aabbMax
btVector3 m_aabbMax
Definition btBroadphaseProxy.h:109
btBroadphaseRayCallback
Definition btBroadphaseInterface.h:32
btBroadphaseRayCallback::m_rayDirectionInverse
btVector3 m_rayDirectionInverse
added some cached data to accelerate ray-AABB tests
Definition btBroadphaseInterface.h:34
btBroadphaseRayCallback::m_signs
unsigned int m_signs[3]
Definition btBroadphaseInterface.h:35
btBroadphaseRayCallback::m_lambda_max
btScalar m_lambda_max
Definition btBroadphaseInterface.h:36
btCollisionWorld::LocalRayResult
Definition btCollisionWorld.h:176
btCollisionWorld::LocalShapeInfo
LocalShapeInfo gives extra information for complex shapes Currently, only btTriangleMeshShape is avai...
Definition btCollisionWorld.h:167
btCollisionWorld::LocalShapeInfo::m_triangleIndex
int m_triangleIndex
Definition btCollisionWorld.h:169
btCollisionWorld::LocalShapeInfo::m_shapePart
int m_shapePart
Definition btCollisionWorld.h:168
btCollisionWorld::RayResultCallback
RayResultCallback is used to report new raycast results.
Definition btCollisionWorld.h:196
btCollisionWorld::RayResultCallback::m_closestHitFraction
btScalar m_closestHitFraction
Definition btCollisionWorld.h:197
btCollisionWorld::RayResultCallback::needsCollision
virtual bool needsCollision(btBroadphaseProxy *proxy0) const
Definition btCollisionWorld.h:222
btCollisionWorld::RayResultCallback::addSingleResult
virtual btScalar addSingleResult(LocalRayResult &rayResult, bool normalInWorldSpace)=0
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback
Definition btDeformableMultiBodyDynamicsWorld.h:179
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::btDeformableSingleRayCallback
btDeformableSingleRayCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const btDeformableMultiBodyDynamicsWorld *world, btCollisionWorld::RayResultCallback &resultCallback)
Definition btDeformableMultiBodyDynamicsWorld.h:189
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_hitNormal
btVector3 m_hitNormal
Definition btDeformableMultiBodyDynamicsWorld.h:184
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_world
const btDeformableMultiBodyDynamicsWorld * m_world
Definition btDeformableMultiBodyDynamicsWorld.h:186
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_rayToTrans
btTransform m_rayToTrans
Definition btDeformableMultiBodyDynamicsWorld.h:183
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_rayToWorld
btVector3 m_rayToWorld
Definition btDeformableMultiBodyDynamicsWorld.h:181
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::process
virtual bool process(const btBroadphaseProxy *proxy)
Definition btDeformableMultiBodyDynamicsWorld.h:214
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_rayFromWorld
btVector3 m_rayFromWorld
Definition btDeformableMultiBodyDynamicsWorld.h:180
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_rayFromTrans
btTransform m_rayFromTrans
Definition btDeformableMultiBodyDynamicsWorld.h:182
btDeformableMultiBodyDynamicsWorld::btDeformableSingleRayCallback::m_resultCallback
btCollisionWorld::RayResultCallback & m_resultCallback
Definition btDeformableMultiBodyDynamicsWorld.h:187
btSoftBodyWorldInfo
Definition btSoftBody.h:48
btSoftBody::sRayCast
Definition btSoftBody.h:202
btSoftBody::sRayCast::fraction
btScalar fraction
feature index
Definition btSoftBody.h:206
btSoftBody::sRayCast::index
int index
feature type
Definition btSoftBody.h:205