Bullet Collision Detection & Physics Library
btSoftMultiBodyDynamicsWorld.h
Go to the documentation of this file.
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 
16 #ifndef BT_SOFT_MULTIBODY_DYNAMICS_WORLD_H
17 #define BT_SOFT_MULTIBODY_DYNAMICS_WORLD_H
18 
22 
23 #ifndef BT_SOFT_RIGID_DYNAMICS_WORLD_H
25 #endif
26 
27 class btSoftBodySolver;
28 
30 {
31 
41 
42 protected:
43 
44  virtual void predictUnconstraintMotion(btScalar timeStep);
45 
46  virtual void internalSingleStepSimulation( btScalar timeStep);
47 
48  void solveSoftBodiesConstraints( btScalar timeStep );
49 
50  void serializeSoftBodies(btSerializer* serializer);
51 
52 public:
53 
54  btSoftMultiBodyDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btMultiBodyConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration, btSoftBodySolver *softBodySolver = 0 );
55 
57 
58  virtual void debugDrawWorld();
59 
60  void addSoftBody(btSoftBody* body, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter);
61 
62  void removeSoftBody(btSoftBody* body);
63 
65  virtual void removeCollisionObject(btCollisionObject* collisionObject);
66 
67  int getDrawFlags() const { return(m_drawFlags); }
68  void setDrawFlags(int f) { m_drawFlags=f; }
69 
71  {
72  return m_sbi;
73  }
75  {
76  return m_sbi;
77  }
78 
80  {
82  }
83 
85  {
86  return m_softBodies;
87  }
88 
90  {
91  return m_softBodies;
92  }
93 
94 
95  virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const;
96 
100  static void rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans,
101  btCollisionObject* collisionObject,
102  const btCollisionShape* collisionShape,
103  const btTransform& colObjWorldTransform,
104  RayResultCallback& resultCallback);
105 
106  virtual void serialize(btSerializer* serializer);
107 
108 };
109 
110 #endif //BT_SOFT_MULTIBODY_DYNAMICS_WORLD_H
virtual void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
btSoftBodySolver * m_softBodySolver
Solver classes that encapsulate multiple soft bodies for solving.
void solveSoftBodiesConstraints(btScalar timeStep)
void addSoftBody(btSoftBody *body, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size...
const btSoftBodyWorldInfo & getWorldInfo() const
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
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.
const btSoftBodyArray & getSoftBodyArray() const
RayResultCallback is used to report new raycast results.
virtual void serialize(btSerializer *serializer)
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see B...
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 ...
virtual void internalSingleStepSimulation(btScalar timeStep)
virtual btDynamicsWorldType getWorldType() const
btCollisionObject can be used to manage collision detection objects.
btSoftMultiBodyDynamicsWorld(btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btMultiBodyConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration, btSoftBodySolver *softBodySolver=0)
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs...
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:34
btAlignedObjectArray< btSoftBody * > btSoftBodyArray
void serializeSoftBodies(btSerializer *serializer)
btDynamicsWorldType
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
Definition: btSoftBody.h:71
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:77
The btMultiBodyDynamicsWorld adds Featherstone multi body dynamics to Bullet This implementation is s...
virtual void predictUnconstraintMotion(btScalar timeStep)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:292