public void removeCollisionObject(PhysicsCollisionObject obj) { if (obj instanceof PhysicsGhostObject) { removeGhostObject((PhysicsGhostObject) obj); } else if (obj instanceof PhysicsRigidBody) { removeRigidBody((PhysicsRigidBody) obj); } else if (obj instanceof PhysicsCharacter) { removeCharacter((PhysicsCharacter) obj); } }
/** * Remove the specified collision object from this space. * * @param obj the PhysicsControl or Spatial with PhysicsControl to remove */ public void removeCollisionObject(PhysicsCollisionObject obj) { if (obj instanceof PhysicsGhostObject) { removeGhostObject((PhysicsGhostObject) obj); } else if (obj instanceof PhysicsRigidBody) { removeRigidBody((PhysicsRigidBody) obj); } else if (obj instanceof PhysicsCharacter) { removeCharacter((PhysicsCharacter) obj); } }
private void removeRigidBody(PhysicsRigidBody node) { if (!physicsBodies.containsKey(node.getObjectId())) { logger.log(Level.WARNING, "RigidBody {0} does not exist in PhysicsSpace, cannot remove.", node); return; } if (node instanceof PhysicsVehicle) { logger.log(Level.FINE, "Removing vehicle constraint {0} from physics space.", Long.toHexString(((PhysicsVehicle) node).getVehicleId())); physicsVehicles.remove(((PhysicsVehicle) node).getVehicleId()); removeVehicle(physicsSpaceId, ((PhysicsVehicle) node).getVehicleId()); } logger.log(Level.FINE, "Removing RigidBody {0} from physics space.", Long.toHexString(node.getObjectId())); physicsBodies.remove(node.getObjectId()); removeRigidBody(physicsSpaceId, node.getObjectId()); }
private void removeRigidBody(PhysicsRigidBody node) { if (node instanceof PhysicsVehicle) { Logger.getLogger(PhysicsSpace.class.getName()).log(Level.FINE, "Removing vehicle constraint {0} from physics space.", Long.toHexString(((PhysicsVehicle) node).getVehicleId())); removeVehicle(physicsSpaceId, ((PhysicsVehicle) node).getVehicleId()); ((PhysicsVehicle) node).setPhysicsSpaceInternal(null); // dynamicsWorld.removeVehicle(((PhysicsVehicle) node).getVehicleId()); } Logger.getLogger(PhysicsSpace.class.getName()).log(Level.FINE, "Removing RigidBody {0} from physics space.", Long.toHexString(node.getObjectId())); physicsNodes.remove(node.getObjectId()); removeRigidBody(physicsSpaceId, node.getObjectId()); }
public void removeCollisionObject(PhysicsCollisionObject obj) { if (obj instanceof PhysicsGhostObject) { removeGhostObject((PhysicsGhostObject) obj); } else if (obj instanceof PhysicsRigidBody) { removeRigidBody((PhysicsRigidBody) obj); } else if (obj instanceof PhysicsCharacter) { removeCharacter((PhysicsCharacter) obj); } }
public void removeCollisionObject(PhysicsCollisionObject obj) { if (obj instanceof PhysicsGhostObject) { removeGhostObject((PhysicsGhostObject) obj); } else if (obj instanceof PhysicsRigidBody) { removeRigidBody((PhysicsRigidBody) obj); } else if (obj instanceof PhysicsCharacter) { removeCharacter((PhysicsCharacter) obj); } }
public void removeCollisionObject(PhysicsCollisionObject obj) { if (obj instanceof PhysicsGhostObject) { removeGhostObject((PhysicsGhostObject) obj); } else if (obj instanceof PhysicsRigidBody) { removeRigidBody((PhysicsRigidBody) obj); } else if (obj instanceof PhysicsCharacter) { removeCharacter((PhysicsCharacter) obj); } }
private void removeRigidBody(PhysicsRigidBody node) { if (!physicsBodies.containsKey(node.getObjectId())) { logger.log(Level.WARNING, "RigidBody {0} does not exist in PhysicsSpace, cannot remove.", node); return; } if (node instanceof PhysicsVehicle) { logger.log(Level.FINE, "Removing vehicle constraint {0} from physics space.", Long.toHexString(((PhysicsVehicle) node).getVehicleId())); physicsVehicles.remove(((PhysicsVehicle) node).getVehicleId()); removeVehicle(physicsSpaceId, ((PhysicsVehicle) node).getVehicleId()); } logger.log(Level.FINE, "Removing RigidBody {0} from physics space.", Long.toHexString(node.getObjectId())); physicsBodies.remove(node.getObjectId()); removeRigidBody(physicsSpaceId, node.getObjectId()); }
remove(physicsJoint.getBodyA()); } else { removeRigidBody(physicsJoint.getBodyA()); remove(physicsJoint.getBodyB()); } else { removeRigidBody(physicsJoint.getBodyB());