#ifndef BT_FRACTURE_BODY #define BT_FRACTURE_BODY class btCollisionShape; class btDynamicsWorld; class btCollisionWorld; class btCompoundShape; class btManifoldPoint; #include "LinearMath/btAlignedObjectArray.h" #include "BulletDynamics/Dynamics/btRigidBody.h" #define CUSTOM_FRACTURE_TYPE (btRigidBody::CO_USER_TYPE+1) struct btConnection { btCollisionShape* m_childShape0; btCollisionShape* m_childShape1; int m_childIndex0; int m_childIndex1; btScalar m_strength; }; class btFractureBody : public btRigidBody { //connections public: btDynamicsWorld* m_world; btAlignedObjectArray m_masses; btAlignedObjectArray m_connections; btFractureBody( const btRigidBodyConstructionInfo& constructionInfo, btDynamicsWorld* world) :btRigidBody(constructionInfo), m_world(world) { m_masses.push_back(constructionInfo.m_mass); m_internalType=CUSTOM_FRACTURE_TYPE+CO_RIGID_BODY; } ///btRigidBody constructor for backwards compatibility. ///To specify friction (etc) during rigid body construction, please use the other constructor (using btRigidBodyConstructionInfo) btFractureBody( btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia, btScalar* masses, int numMasses, btDynamicsWorld* world) :btRigidBody(mass,motionState,collisionShape,localInertia), m_world(world) { for (int i=0;i