Ejemplo n.º 1
0
 public bool AddSoftBody(BSoftBody softBody)
 {
     if (!(m_world is BulletSharp.SoftBody.SoftRigidDynamicsWorld))
     {
         if (debugType <= BDebug.DebugType.Trace)
         {
             Debug.LogErrorFormat("The Physics World must be a BSoftBodyWorld for adding soft bodies");
         }
         return(false);
     }
     if (!_isDisposed)
     {
         if (debugType >= BDebug.DebugType.Debug)
         {
             Debug.LogFormat(softBody, "Adding softbody {0} to world", softBody.name);
         }
         if (softBody._BuildCollisionObject())
         {
             ((BulletSharp.SoftBody.SoftRigidDynamicsWorld)m_world).AddSoftBody((SoftBody)softBody.GetCollisionObject());
             softBody.isInWorld = true;
         }
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
 public bool AddSoftBody(BSoftBody softBody)
 {
     if (!(m_world is BulletSharp.SoftBody.SoftRigidDynamicsWorld))
     {
         if (debugType >= BDebug.DebugType.Debug) Debug.LogFormat("The Physics World must be a BSoftBodyWorld for adding soft bodies");
         return false;
     }
     if (!_isDisposed)
     {
         if (debugType >= BDebug.DebugType.Debug) Debug.LogFormat("Adding softbody {0} to world", softBody);
         if (softBody._BuildCollisionObject())
         {
             ((BulletSharp.SoftBody.SoftRigidDynamicsWorld)m_world).AddSoftBody((SoftBody)softBody.GetCollisionObject());
             softBody.isInWorld = true;
         }
         return true;
     }
     return false;
 }