aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
diff options
context:
space:
mode:
authorRobert Adams2012-08-10 16:35:00 -0700
committerRobert Adams2012-08-10 16:35:00 -0700
commit3ecd39068cf756fc9de2f8f30bc2a703be90d7dc (patch)
tree27dbc031a986f76215c3587ec647df14b6d63b75 /OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
parentBulletSim: actually update the DLLs and SOs (diff)
parentBulletSim: many, many detailed logging messages for physical linkset (diff)
downloadopensim-SC_OLD-3ecd39068cf756fc9de2f8f30bc2a703be90d7dc.zip
opensim-SC_OLD-3ecd39068cf756fc9de2f8f30bc2a703be90d7dc.tar.gz
opensim-SC_OLD-3ecd39068cf756fc9de2f8f30bc2a703be90d7dc.tar.bz2
opensim-SC_OLD-3ecd39068cf756fc9de2f8f30bc2a703be90d7dc.tar.xz
Merge branch 'bulletsim7'
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