Constraint based simulation of soft and rigid bodies