1 #ifndef _BT_FRACTURE_DYNAMICS_WORLD_H
\r
2 #define _BT_FRACTURE_DYNAMICS_WORLD_H
\r
4 #include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
\r
5 #include "LinearMath/btAlignedObjectArray.h"
\r
7 class btFractureBody;
\r
8 class btCompoundShape;
\r
12 ///The btFractureDynamicsWorld class enabled basic glue and fracture of objects.
\r
13 ///If/once this implementation is stablized/tested we might merge it into btDiscreteDynamicsWorld and remove the class.
\r
14 class btFractureDynamicsWorld : public btDiscreteDynamicsWorld
\r
16 btAlignedObjectArray<btFractureBody*> m_fractureBodies;
\r
18 bool m_fracturingMode;
\r
20 btFractureBody* addNewBody(const btTransform& oldTransform,btScalar* masses, btCompoundShape* oldCompound);
\r
22 void breakDisconnectedParts( btFractureBody* fracObj);
\r
26 btFractureDynamicsWorld ( btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
\r
28 virtual void addRigidBody(btRigidBody* body);
\r
30 virtual void removeRigidBody(btRigidBody* body);
\r
32 void solveConstraints(btContactSolverInfo& solverInfo);
\r
34 ///either fracture or glue (!fracture)
\r
35 void setFractureMode(bool fracture)
\r
37 m_fracturingMode = fracture;
\r
40 bool getFractureMode() const { return m_fracturingMode;}
\r
42 ///normally those callbacks are called internally by the 'solveConstraints'
\r
43 void glueCallback();
\r
45 ///normally those callbacks are called internally by the 'solveConstraints'
\r
46 void fractureCallback();
\r
50 #endif //_BT_FRACTURE_DYNAMICS_WORLD_H
\r