aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
diff options
context:
space:
mode:
authorRobert Adams2013-02-17 20:07:04 -0800
committerRobert Adams2013-02-17 20:13:49 -0800
commit1d7276235ace0ed6b7701efa36a7fd7f1b552bab (patch)
treeb7880a0e97da37a2852ad4643ea6ae03ae386018 /OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
parentBulletSim: rework parameter setting for different types of values (diff)
downloadopensim-SC_OLD-1d7276235ace0ed6b7701efa36a7fd7f1b552bab.zip
opensim-SC_OLD-1d7276235ace0ed6b7701efa36a7fd7f1b552bab.tar.gz
opensim-SC_OLD-1d7276235ace0ed6b7701efa36a7fd7f1b552bab.tar.bz2
opensim-SC_OLD-1d7276235ace0ed6b7701efa36a7fd7f1b552bab.tar.xz
BulletSim: add calls for creating all the different Bullet constraint types.
Updated the DLLs and SOs and code for BulletXNA to create the types. All the detailed control calls are not all in place yet.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
index 2aeff25..5c8d94e 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
@@ -117,8 +117,7 @@ public sealed class BSConstraintCollection : IDisposable
117 if (this.TryGetConstraint(body1, body2, out constrain)) 117 if (this.TryGetConstraint(body1, body2, out constrain))
118 { 118 {
119 // remove the constraint from our collection 119 // remove the constraint from our collection
120 RemoveAndDestroyConstraint(constrain); 120 ret = RemoveAndDestroyConstraint(constrain);
121 ret = true;
122 } 121 }
123 } 122 }
124 123
@@ -126,17 +125,19 @@ public sealed class BSConstraintCollection : IDisposable
126 } 125 }
127 126
128 // The constraint MUST exist in the collection 127 // The constraint MUST exist in the collection
128 // Could be called if the constraint was previously removed.
129 // Return 'true' if the constraint was actually removed and disposed.
129 public bool RemoveAndDestroyConstraint(BSConstraint constrain) 130 public bool RemoveAndDestroyConstraint(BSConstraint constrain)
130 { 131 {
132 bool removed = false;
131 lock (m_constraints) 133 lock (m_constraints)
132 { 134 {
133 // remove the constraint from our collection 135 // remove the constraint from our collection
134 m_constraints.Remove(constrain); 136 removed = m_constraints.Remove(constrain);
135 } 137 }
136 // tell the engine that all its structures need to be freed 138 // Dispose() is safe to call multiple times
137 constrain.Dispose(); 139 constrain.Dispose();
138 // we destroyed something 140 return removed;
139 return true;
140 } 141 }
141 142
142 // Remove all constraints that reference the passed body. 143 // Remove all constraints that reference the passed body.