BEPUphysics.Constraints.Collision.ContactManifoldConstraintGroup.Remove C# (CSharp) Method

Remove() public method

Removes a constraint from the group.
public Remove ( EntitySolverUpdateable manifoldConstraint ) : void
manifoldConstraint EntitySolverUpdateable Constraint to remove.
return void
        public new void Remove(EntitySolverUpdateable manifoldConstraint)
        {
            //This is a similar process to a normal solver group.
            //However, it does not attempt to change involved entities.
            //This is for two reasons:
            //-It is unnecessary; a contact manifold is always between the same two entities throughout its lifespan.
            //-It causes race conditions; this method is called in a multithreaded context and changing involved 
            // entities calls upon sequential-only methods.
            if (manifoldConstraint.SolverGroup == this)
            {
                solverUpdateables.Remove(manifoldConstraint);
                manifoldConstraint.SolverGroup = null;
                manifoldConstraint.Solver = null;
            }
            else
            {
                throw new InvalidOperationException("Cannot remove SolverUpdateable from SolverGroup; it doesn't belong to this SolverGroup.");
            }
        }