aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs18
1 files changed, 6 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
index c88e645..3df2ddc 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
@@ -63,21 +63,13 @@ public class BSConstraintCollection : IDisposable
63 m_constraints.Clear(); 63 m_constraints.Clear();
64 } 64 }
65 65
66 public BSConstraint CreateConstraint(BulletSim world, BulletBody obj1, BulletBody obj2,
67 Vector3 frame1, Quaternion frame1rot,
68 Vector3 frame2, Quaternion frame2rot)
69 {
70 BSConstraint constrain = new BSConstraint(world, obj1, obj2, frame1, frame1rot, frame2, frame2rot);
71
72 this.AddConstraint(constrain);
73 return constrain;
74 }
75
76 public bool AddConstraint(BSConstraint cons) 66 public bool AddConstraint(BSConstraint cons)
77 { 67 {
78 // There is only one constraint between any bodies. Remove any old just to make sure. 68 // There is only one constraint between any bodies. Remove any old just to make sure.
79 RemoveAndDestroyConstraint(cons.Body1, cons.Body2); 69 RemoveAndDestroyConstraint(cons.Body1, cons.Body2);
80 70
71 m_world.scene.DetailLog("{0},BSConstraintCollection.AddConstraint,call,body1={1},body2={2}", BSScene.DetailLogZero, cons.Body1.ID, cons.Body2.ID);
72
81 m_constraints.Add(cons); 73 m_constraints.Add(cons);
82 74
83 return true; 75 return true;
@@ -118,6 +110,7 @@ public class BSConstraintCollection : IDisposable
118 110
119 if (this.TryGetConstraint(body1, body2, out constrain)) 111 if (this.TryGetConstraint(body1, body2, out constrain))
120 { 112 {
113 m_world.scene.DetailLog("{0},BSConstraintCollection.RemoveAndDestroyConstraint,taint,body1={1},body2={2}", BSScene.DetailLogZero, body1.ID, body2.ID);
121 // remove the constraint from our collection 114 // remove the constraint from our collection
122 m_constraints.Remove(constrain); 115 m_constraints.Remove(constrain);
123 // tell the engine that all its structures need to be freed 116 // tell the engine that all its structures need to be freed
@@ -158,10 +151,11 @@ public class BSConstraintCollection : IDisposable
158 151
159 public bool RecalculateAllConstraints() 152 public bool RecalculateAllConstraints()
160 { 153 {
161 foreach (BSConstraint constrain in m_constraints) 154 ForEachConstraint(delegate(BSConstraint constrain)
162 { 155 {
163 constrain.CalculateTransforms(); 156 constrain.CalculateTransforms();
164 } 157 return false;
158 });
165 return true; 159 return true;
166 } 160 }
167 161