Exemplo n.º 1
0
 public void RemoveCollisionObject(BCollisionObject co)
 {
     if (co is BRigidBody)
     {
         RemoveRigidBody((RigidBody)co.GetCollisionObject());
         return;
     }
     if (co is BSoftBody)
     {
         RemoveSoftBody((SoftBody)co.GetCollisionObject());
         return;
     }
     if (!_isDisposed)
     {
         if (co is BCharacterController && world is DynamicsWorld)
         {
             RemoveAction(((BCharacterController)co).GetKinematicCharacterController());
         }
         if (debugType >= BDebug.DebugType.Debug)
         {
             Debug.LogFormat("Removing collisionObject {0} from world", co);
         }
         m_world.RemoveCollisionObject(co.GetCollisionObject());
         co.isInWorld = false;
     }
 }
Exemplo n.º 2
0
    public bool RemoveCollisionObject(BCollisionObject co)
    {
        if (!isDisposed)
        {
            if (co is BRigidBody)
            {
                return(RemoveRigidBody((RigidBody)co.GetCollisionObject()));
            }
            else if (co is BSoftBody)
            {
                return(RemoveSoftBody((SoftBody)co.GetCollisionObject()));
            }

            if (co is BCharacterController && DWorld != null)
            {
                RemoveAction(((BCharacterController)co).GetKinematicCharacterController());
            }

            if (physicWorldParameters.debugType >= BDebug.DebugType.Debug)
            {
                Debug.LogFormat("Removing collisionObject {0} from world", co);
            }

            _world.RemoveCollisionObject(co.GetCollisionObject());
            co.isInWorld = false;

            return(true);
        }

        return(false);
    }
Exemplo n.º 3
0
 public void RemoveCollisionObject(BulletSharp.CollisionObject co)
 {
     if (co is RigidBody)
     {
         RemoveRigidBody((RigidBody)co);
         return;
     }
     if (co is SoftBody)
     {
         RemoveSoftBody((SoftBody)co);
         return;
     }
     if (!_isDisposed)
     {
         if (debugType >= BDebug.DebugType.Debug)
         {
             Debug.LogFormat("Removing collisionObject {0} from world", co.UserObject);
         }
         m_world.RemoveCollisionObject(co);
         if (co.UserObject is BCollisionObject)
         {
             ((BCollisionObject)co.UserObject).isInWorld = false;
         }
         //TODO handle removing kinematic character controller action
     }
 }
Exemplo n.º 4
0
 public void RemoveCollisionObject(BulletSharp.CollisionObject co)
 {
     if (!_isDisposed)
     {
         BDebug.Log(debugType, "Removing collisionObject {0} from world", co.UserObject);
         m_world.RemoveCollisionObject(co);
         if (co.UserObject is BCollisionObject)
         {
             ((BCollisionObject)co.UserObject).isInWorld = false;
         }
         //TODO handle removing kinematic character controller action
     }
 }
Exemplo n.º 5
0
 public void RemoveCollisionObject(BCollisionObject co)
 {
     if (co is BRigidBody)
     {
         RemoveRigidBody((RigidBody)co.GetCollisionObject());
         return;
     }
     if (co is BSoftBody)
     {
         RemoveSoftBody((SoftBody)co.GetCollisionObject());
         return;
     }
     if (!_isDisposed)
     {
         if (co is BCharacterController && world is DynamicsWorld)
         {
             RemoveAction(((BCharacterController)co).GetKinematicCharacterController());
         }
         m_world.RemoveCollisionObject(co.GetCollisionObject());
         co.isInWorld = false;
     }
 }
Exemplo n.º 6
0
 public void EliminarObjeto(CollisionObject objeto)
 {
     collisionWorld.RemoveCollisionObject(objeto);
     objeto.Dispose();
 }