aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-01-01 23:27:10 +0000
committerJustin Clark-Casey (justincc)2013-01-01 23:27:10 +0000
commite8a3cc701910130e1aafb2b757737517c1cd1627 (patch)
treef1fd4ed9cf2b8e80ea43d2a8028837874f1b193c /OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
parentClarify that AllowLightShareFunctions setting is false, which is the default ... (diff)
parentBulletSim: remove unused unmanaged memory reference functions from BSAPITempl... (diff)
downloadopensim-SC_OLD-e8a3cc701910130e1aafb2b757737517c1cd1627.zip
opensim-SC_OLD-e8a3cc701910130e1aafb2b757737517c1cd1627.tar.gz
opensim-SC_OLD-e8a3cc701910130e1aafb2b757737517c1cd1627.tar.bz2
opensim-SC_OLD-e8a3cc701910130e1aafb2b757737517c1cd1627.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs42
1 files changed, 19 insertions, 23 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
index 6b592e7..d0b2a56 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
@@ -48,12 +48,15 @@ public sealed class BSLinksetConstraints : BSLinkset
48 { 48 {
49 base.Refresh(requestor); 49 base.Refresh(requestor);
50 50
51 // Queue to happen after all the other taint processing 51 if (HasAnyChildren && IsRoot(requestor))
52 PhysicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate() 52 {
53 { 53 // Queue to happen after all the other taint processing
54 if (HasAnyChildren && IsRoot(requestor)) 54 PhysicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate()
55 RecomputeLinksetConstraints(); 55 {
56 }); 56 if (HasAnyChildren && IsRoot(requestor))
57 RecomputeLinksetConstraints();
58 });
59 }
57 } 60 }
58 61
59 // The object is going dynamic (physical). Do any setup necessary 62 // The object is going dynamic (physical). Do any setup necessary
@@ -95,7 +98,7 @@ public sealed class BSLinksetConstraints : BSLinkset
95 bool ret = false; 98 bool ret = false;
96 99
97 DetailLog("{0},BSLinksetConstraint.RemoveBodyDependencies,removeChildrenForRoot,rID={1},rBody={2}", 100 DetailLog("{0},BSLinksetConstraint.RemoveBodyDependencies,removeChildrenForRoot,rID={1},rBody={2}",
98 child.LocalID, LinksetRoot.LocalID, LinksetRoot.PhysBody.ptr.ToString("X")); 101 child.LocalID, LinksetRoot.LocalID, LinksetRoot.PhysBody.AddrString);
99 102
100 lock (m_linksetActivityLock) 103 lock (m_linksetActivityLock)
101 { 104 {
@@ -144,8 +147,8 @@ public sealed class BSLinksetConstraints : BSLinkset
144 147
145 DetailLog("{0},BSLinksetConstraints.RemoveChildFromLinkset,call,rID={1},rBody={2},cID={3},cBody={4}", 148 DetailLog("{0},BSLinksetConstraints.RemoveChildFromLinkset,call,rID={1},rBody={2},cID={3},cBody={4}",
146 childx.LocalID, 149 childx.LocalID,
147 rootx.LocalID, rootx.PhysBody.ptr.ToString("X"), 150 rootx.LocalID, rootx.PhysBody.AddrString,
148 childx.LocalID, childx.PhysBody.ptr.ToString("X")); 151 childx.LocalID, childx.PhysBody.AddrString);
149 152
150 PhysicsScene.TaintedObject("BSLinksetConstraints.RemoveChildFromLinkset", delegate() 153 PhysicsScene.TaintedObject("BSLinksetConstraints.RemoveChildFromLinkset", delegate()
151 { 154 {
@@ -184,8 +187,8 @@ public sealed class BSLinksetConstraints : BSLinkset
184 187
185 DetailLog("{0},BSLinksetConstraint.BuildConstraint,taint,root={1},rBody={2},child={3},cBody={4},rLoc={5},cLoc={6},midLoc={7}", 188 DetailLog("{0},BSLinksetConstraint.BuildConstraint,taint,root={1},rBody={2},child={3},cBody={4},rLoc={5},cLoc={6},midLoc={7}",
186 rootPrim.LocalID, 189 rootPrim.LocalID,
187 rootPrim.LocalID, rootPrim.PhysBody.ptr.ToString("X"), 190 rootPrim.LocalID, rootPrim.PhysBody.AddrString,
188 childPrim.LocalID, childPrim.PhysBody.ptr.ToString("X"), 191 childPrim.LocalID, childPrim.PhysBody.AddrString,
189 rootPrim.Position, childPrim.Position, midPoint); 192 rootPrim.Position, childPrim.Position, midPoint);
190 193
191 // create a constraint that allows no freedom of movement between the two objects 194 // create a constraint that allows no freedom of movement between the two objects
@@ -249,14 +252,14 @@ public sealed class BSLinksetConstraints : BSLinkset
249 bool ret = false; 252 bool ret = false;
250 DetailLog("{0},BSLinksetConstraint.PhysicallyUnlinkAChildFromRoot,taint,root={1},rBody={2},child={3},cBody={4}", 253 DetailLog("{0},BSLinksetConstraint.PhysicallyUnlinkAChildFromRoot,taint,root={1},rBody={2},child={3},cBody={4}",
251 rootPrim.LocalID, 254 rootPrim.LocalID,
252 rootPrim.LocalID, rootPrim.PhysBody.ptr.ToString("X"), 255 rootPrim.LocalID, rootPrim.PhysBody.AddrString,
253 childPrim.LocalID, childPrim.PhysBody.ptr.ToString("X")); 256 childPrim.LocalID, childPrim.PhysBody.AddrString);
254 257
255 // Find the constraint for this link and get rid of it from the overall collection and from my list 258 // Find the constraint for this link and get rid of it from the overall collection and from my list
256 if (PhysicsScene.Constraints.RemoveAndDestroyConstraint(rootPrim.PhysBody, childPrim.PhysBody)) 259 if (PhysicsScene.Constraints.RemoveAndDestroyConstraint(rootPrim.PhysBody, childPrim.PhysBody))
257 { 260 {
258 // Make the child refresh its location 261 // Make the child refresh its location
259 BulletSimAPI.PushUpdate2(childPrim.PhysBody.ptr); 262 PhysicsScene.PE.PushUpdate(childPrim.PhysBody);
260 ret = true; 263 ret = true;
261 } 264 }
262 265
@@ -283,11 +286,8 @@ public sealed class BSLinksetConstraints : BSLinkset
283 float linksetMass = LinksetMass; 286 float linksetMass = LinksetMass;
284 LinksetRoot.UpdatePhysicalMassProperties(linksetMass, true); 287 LinksetRoot.UpdatePhysicalMassProperties(linksetMass, true);
285 288
286 // DEBUG: see of inter-linkset collisions are causing problems
287 // BulletSimAPI.SetCollisionFilterMask2(LinksetRoot.BSBody.ptr,
288 // (uint)CollisionFilterGroups.LinksetFilter, (uint)CollisionFilterGroups.LinksetMask);
289 DetailLog("{0},BSLinksetConstraint.RecomputeLinksetConstraints,set,rBody={1},linksetMass={2}", 289 DetailLog("{0},BSLinksetConstraint.RecomputeLinksetConstraints,set,rBody={1},linksetMass={2}",
290 LinksetRoot.LocalID, LinksetRoot.PhysBody.ptr.ToString("X"), linksetMass); 290 LinksetRoot.LocalID, LinksetRoot.PhysBody.AddrString, linksetMass);
291 291
292 foreach (BSPhysObject child in m_children) 292 foreach (BSPhysObject child in m_children)
293 { 293 {
@@ -304,11 +304,7 @@ public sealed class BSLinksetConstraints : BSLinkset
304 } 304 }
305 constrain.RecomputeConstraintVariables(linksetMass); 305 constrain.RecomputeConstraintVariables(linksetMass);
306 306
307 // DEBUG: see of inter-linkset collisions are causing problems 307 // PhysicsScene.PE.DumpConstraint(PhysicsScene.World, constrain.Constraint); // DEBUG DEBUG
308 // BulletSimAPI.SetCollisionFilterMask2(child.BSBody.ptr,
309 // (uint)CollisionFilterGroups.LinksetFilter, (uint)CollisionFilterGroups.LinksetMask);
310
311 // BulletSimAPI.DumpConstraint2(PhysicsScene.World.ptr, constrain.Constraint.ptr); // DEBUG DEBUG
312 } 308 }
313 309
314 } 310 }