From 77a7758cf50e14b3ed7309d0d36612d9987b987b Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 14 Aug 2012 16:25:59 -0700 Subject: BulletSim: Refactor BSConstraintCollection to add a new RemoveAndDestroyConstraint(BSConstraint xx) --- .../Physics/BulletSPlugin/BSConstraintCollection.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs index 3df2ddc..862b744 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs @@ -112,16 +112,24 @@ public class BSConstraintCollection : IDisposable { m_world.scene.DetailLog("{0},BSConstraintCollection.RemoveAndDestroyConstraint,taint,body1={1},body2={2}", BSScene.DetailLogZero, body1.ID, body2.ID); // remove the constraint from our collection - m_constraints.Remove(constrain); - // tell the engine that all its structures need to be freed - constrain.Dispose(); - // we destroyed something + RemoveAndDestroyConstraint(constrain); ret = true; } return ret; } + // The constraint MUST exist in the collection + public bool RemoveAndDestroyConstraint(BSConstraint constrain) + { + // remove the constraint from our collection + m_constraints.Remove(constrain); + // tell the engine that all its structures need to be freed + constrain.Dispose(); + // we destroyed something + return true; + } + // Remove all constraints that reference the passed body. // Return 'true' if any constraints were destroyed. public bool RemoveAndDestroyConstraint(BulletBody body1) -- cgit v1.1