internal void RemoveRigidBody(RigidbodyComponent rigidBody) { if (discreteDynamicsWorld == null) { throw new Exception("Cannot perform this action when the physics engine is set to CollisionsOnly"); } discreteDynamicsWorld.RemoveRigidBody(rigidBody.InternalRigidBody); }
/// <summary> /// Removes the rigid body from the engine processing pipeline. /// </summary> /// <param name="rigidBody">The rigid body.</param> /// <exception cref="System.Exception">Cannot perform this action when the physics engine is set to CollisionsOnly</exception> public void RemoveRigidBody(RigidBody rigidBody) { if (discreteDynamicsWorld == null) { throw new Exception("Cannot perform this action when the physics engine is set to CollisionsOnly"); } discreteDynamicsWorld.RemoveRigidBody(rigidBody.InternalRigidBody); aliveColliders.Remove(rigidBody.InternalRigidBody); rigidBody.Simulation = null; }