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

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

btSoftMultiBodyDynamicsWorld.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. 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.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16#ifndef BT_SOFT_MULTIBODY_DYNAMICS_WORLD_H
17#define BT_SOFT_MULTIBODY_DYNAMICS_WORLD_H
18
19#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
20#include "BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.h"
21#include "BulletSoftBody/btSoftBody.h"
22
23#ifndef BT_SOFT_RIGID_DYNAMICS_WORLD_H
24 typedef btAlignedObjectArray<btSoftBody*> btSoftBodyArray;
25#endif
26
27class btSoftBodySolver;
28
29 class btSoftMultiBodyDynamicsWorld : public btMultiBodyDynamicsWorld
30{
31 btSoftBodyArray m_softBodies;
32 int m_drawFlags;
33 bool m_drawNodeTree;
34 bool m_drawFaceTree;
35 bool m_drawClusterTree;
36 btSoftBodyWorldInfo m_sbi;
38 btSoftBodySolver* m_softBodySolver;
39 bool m_ownsSolver;
40
41protected:
42 virtual void predictUnconstraintMotion(btScalar timeStep);
43
44 virtual void internalSingleStepSimulation(btScalar timeStep);
45
46 void solveSoftBodiesConstraints(btScalar timeStep);
47
48 void serializeSoftBodies(btSerializer* serializer);
49
50public:
51 btSoftMultiBodyDynamicsWorld(btDispatcher* dispatcher, btBroadphaseInterface* pairCache, btMultiBodyConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration, btSoftBodySolver* softBodySolver = 0);
52
53 virtual ~btSoftMultiBodyDynamicsWorld();
54
55 virtual void debugDrawWorld();
56
57 void addSoftBody(btSoftBody* body, int collisionFilterGroup = btBroadphaseProxy::DefaultFilter, int collisionFilterMask = btBroadphaseProxy::AllFilter);
58
59 void removeSoftBody(btSoftBody* body);
60
62 virtual void removeCollisionObject(btCollisionObject* collisionObject);
63
64 int getDrawFlags() const { return (m_drawFlags); }
65 void setDrawFlags(int f) { m_drawFlags = f; }
66
67 btSoftBodyWorldInfo& getWorldInfo()
68 {
69 return m_sbi;
70 }
71 const btSoftBodyWorldInfo& getWorldInfo() const
72 {
73 return m_sbi;
74 }
75
76 virtual btDynamicsWorldType getWorldType() const
77 {
78 return BT_SOFT_MULTIBODY_DYNAMICS_WORLD;
79 }
80
81 btSoftBodyArray& getSoftBodyArray()
82 {
83 return m_softBodies;
84 }
85
86 const btSoftBodyArray& getSoftBodyArray() const
87 {
88 return m_softBodies;
89 }
90
91 virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const;
92
96 static void rayTestSingle(const btTransform& rayFromTrans, const btTransform& rayToTrans,
97 btCollisionObject* collisionObject,
98 const btCollisionShape* collisionShape,
99 const btTransform& colObjWorldTransform,
100 RayResultCallback& resultCallback);
101
102 virtual void serialize(btSerializer* serializer);
103};
104
105#endif //BT_SOFT_MULTIBODY_DYNAMICS_WORLD_H
btDiscreteDynamicsWorld.h
btDynamicsWorldType
btDynamicsWorldType
Definition: btDynamicsWorld.h:31
BT_SOFT_MULTIBODY_DYNAMICS_WORLD
@ BT_SOFT_MULTIBODY_DYNAMICS_WORLD
Definition: btDynamicsWorld.h:37
btMultiBodyDynamicsWorld.h
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
btSoftBody.h
btSoftBodyArray
btAlignedObjectArray< btSoftBody * > btSoftBodyArray
Definition: btSoftMultiBodyDynamicsWorld.h:24
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
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
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
Definition: btCollisionShape.h:28
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:77
btMultiBodyConstraintSolver
Definition: btMultiBodyConstraintSolver.h:30
btMultiBodyDynamicsWorld
The btMultiBodyDynamicsWorld adds Featherstone multi body dynamics to Bullet This implementation is s...
Definition: btMultiBodyDynamicsWorld.h:32
btSerializer
Definition: btSerializer.h:66
btSoftBodySolver
Definition: btSoftBodySolvers.h:29
btSoftBody
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
Definition: btSoftBody.h:75
btSoftMultiBodyDynamicsWorld
Definition: btSoftMultiBodyDynamicsWorld.h:30
btSoftMultiBodyDynamicsWorld::m_ownsSolver
bool m_ownsSolver
Definition: btSoftMultiBodyDynamicsWorld.h:39
btSoftMultiBodyDynamicsWorld::m_softBodySolver
btSoftBodySolver * m_softBodySolver
Solver classes that encapsulate multiple soft bodies for solving.
Definition: btSoftMultiBodyDynamicsWorld.h:38
btSoftMultiBodyDynamicsWorld::getSoftBodyArray
btSoftBodyArray & getSoftBodyArray()
Definition: btSoftMultiBodyDynamicsWorld.h:81
btSoftMultiBodyDynamicsWorld::predictUnconstraintMotion
virtual void predictUnconstraintMotion(btScalar timeStep)
Definition: btSoftMultiBodyDynamicsWorld.cpp:69
btSoftMultiBodyDynamicsWorld::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: btSoftMultiBodyDynamicsWorld.cpp:271
btSoftMultiBodyDynamicsWorld::getSoftBodyArray
const btSoftBodyArray & getSoftBodyArray() const
Definition: btSoftMultiBodyDynamicsWorld.h:86
btSoftMultiBodyDynamicsWorld::getWorldInfo
const btSoftBodyWorldInfo & getWorldInfo() const
Definition: btSoftMultiBodyDynamicsWorld.h:71
btSoftMultiBodyDynamicsWorld::m_drawClusterTree
bool m_drawClusterTree
Definition: btSoftMultiBodyDynamicsWorld.h:35
btSoftMultiBodyDynamicsWorld::removeSoftBody
void removeSoftBody(btSoftBody *body)
Definition: btSoftMultiBodyDynamicsWorld.cpp:138
btSoftMultiBodyDynamicsWorld::m_sbi
btSoftBodyWorldInfo m_sbi
Definition: btSoftMultiBodyDynamicsWorld.h:36
btSoftMultiBodyDynamicsWorld::internalSingleStepSimulation
virtual void internalSingleStepSimulation(btScalar timeStep)
Definition: btSoftMultiBodyDynamicsWorld.cpp:78
btSoftMultiBodyDynamicsWorld::debugDrawWorld
virtual void debugDrawWorld()
Definition: btSoftMultiBodyDynamicsWorld.cpp:154
btSoftMultiBodyDynamicsWorld::serialize
virtual void serialize(btSerializer *serializer)
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see B...
Definition: btSoftMultiBodyDynamicsWorld.cpp:338
btSoftMultiBodyDynamicsWorld::m_drawFlags
int m_drawFlags
Definition: btSoftMultiBodyDynamicsWorld.h:32
btSoftMultiBodyDynamicsWorld::setDrawFlags
void setDrawFlags(int f)
Definition: btSoftMultiBodyDynamicsWorld.h:65
btSoftMultiBodyDynamicsWorld::getWorldType
virtual btDynamicsWorldType getWorldType() const
Definition: btSoftMultiBodyDynamicsWorld.h:76
btSoftMultiBodyDynamicsWorld::~btSoftMultiBodyDynamicsWorld
virtual ~btSoftMultiBodyDynamicsWorld()
Definition: btSoftMultiBodyDynamicsWorld.cpp:60
btSoftMultiBodyDynamicsWorld::m_softBodies
btSoftBodyArray m_softBodies
Definition: btSoftMultiBodyDynamicsWorld.h:31
btSoftMultiBodyDynamicsWorld::getDrawFlags
int getDrawFlags() const
Definition: btSoftMultiBodyDynamicsWorld.h:64
btSoftMultiBodyDynamicsWorld::solveSoftBodiesConstraints
void solveSoftBodiesConstraints(btScalar timeStep)
Definition: btSoftMultiBodyDynamicsWorld.cpp:112
btSoftMultiBodyDynamicsWorld::removeCollisionObject
virtual void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
Definition: btSoftMultiBodyDynamicsWorld.cpp:145
btSoftMultiBodyDynamicsWorld::getWorldInfo
btSoftBodyWorldInfo & getWorldInfo()
Definition: btSoftMultiBodyDynamicsWorld.h:67
btSoftMultiBodyDynamicsWorld::addSoftBody
void addSoftBody(btSoftBody *body, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
Definition: btSoftMultiBodyDynamicsWorld.cpp:125
btSoftMultiBodyDynamicsWorld::rayTest
virtual 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: btSoftMultiBodyDynamicsWorld.cpp:254
btSoftMultiBodyDynamicsWorld::m_drawNodeTree
bool m_drawNodeTree
Definition: btSoftMultiBodyDynamicsWorld.h:33
btSoftMultiBodyDynamicsWorld::m_drawFaceTree
bool m_drawFaceTree
Definition: btSoftMultiBodyDynamicsWorld.h:34
btSoftMultiBodyDynamicsWorld::serializeSoftBodies
void serializeSoftBodies(btSerializer *serializer)
Definition: btSoftMultiBodyDynamicsWorld.cpp:321
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:30
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:82
btBroadphaseProxy::AllFilter
@ AllFilter
Definition: btBroadphaseProxy.h:98
btBroadphaseProxy::DefaultFilter
@ DefaultFilter
Definition: btBroadphaseProxy.h:92
btSoftBodyWorldInfo
Definition: btSoftBody.h:48