Blender  V3.3
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  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 
41 protected:
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 
50 public:
51  btSoftMultiBodyDynamicsWorld(btDispatcher* dispatcher, btBroadphaseInterface* pairCache, btMultiBodyConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration, btSoftBodySolver* softBodySolver = 0);
52 
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 
68  {
69  return m_sbi;
70  }
72  {
73  return m_sbi;
74  }
75 
77  {
79  }
80 
82  {
83  return m_softBodies;
84  }
85 
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
@ AllFilter
@ DefaultFilter
btCollisionObject
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
btDynamicsWorldType
@ BT_SOFT_MULTIBODY_DYNAMICS_WORLD
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
btAlignedObjectArray< btSoftBody * > btSoftBodyArray
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. It has an un-used w component to suit 16-by...
Definition: btVector3.h:82
const btSoftBodyArray & getSoftBodyArray() const
virtual void predictUnconstraintMotion(btScalar timeStep)
static void rayTestSingle(const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback)
virtual void internalSingleStepSimulation(btScalar timeStep)
virtual void serialize(btSerializer *serializer)
virtual btDynamicsWorldType getWorldType() const
const btSoftBodyWorldInfo & getWorldInfo() const
void solveSoftBodiesConstraints(btScalar timeStep)
virtual void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
void addSoftBody(btSoftBody *body, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
virtual void rayTest(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, RayResultCallback &resultCallback) const
btSoftMultiBodyDynamicsWorld(btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btMultiBodyConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration, btSoftBodySolver *softBodySolver=0)
void serializeSoftBodies(btSerializer *serializer)