aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
diff options
context:
space:
mode:
authorRobert Adams2014-07-17 21:41:39 -0700
committerRobert Adams2014-07-17 21:41:39 -0700
commit1daec26ba0355f0c7d77c790a52546db6435968a (patch)
treeffef11d501c00ed1f17d845d779126a9c551c403 /OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
parentfix all instances of "non-existant" to "non-existent" (spelling mistakes) tha... (diff)
downloadopensim-SC-1daec26ba0355f0c7d77c790a52546db6435968a.zip
opensim-SC-1daec26ba0355f0c7d77c790a52546db6435968a.tar.gz
opensim-SC-1daec26ba0355f0c7d77c790a52546db6435968a.tar.bz2
opensim-SC-1daec26ba0355f0c7d77c790a52546db6435968a.tar.xz
BulletSim: rearrange code to prevent using null pointers when a
child mesh is not available when building a linkset.
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
index 5217452..5a9e9ff 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
@@ -385,6 +385,16 @@ public sealed class BSLinksetCompound : BSLinkset
385 m_physicsScene.PE.AddChildShapeToCompoundShape(linksetShape.physShapeInfo, childShape.physShapeInfo, offsetPos, offsetRot); 385 m_physicsScene.PE.AddChildShapeToCompoundShape(linksetShape.physShapeInfo, childShape.physShapeInfo, offsetPos, offsetRot);
386 DetailLog("{0},BSLinksetCompound.RecomputeLinksetCompound,addChild,indx={1},cShape={2},offPos={3},offRot={4}", 386 DetailLog("{0},BSLinksetCompound.RecomputeLinksetCompound,addChild,indx={1},cShape={2},offPos={3},offRot={4}",
387 LinksetRoot.LocalID, cPrim.LinksetChildIndex, childShape, offsetPos, offsetRot); 387 LinksetRoot.LocalID, cPrim.LinksetChildIndex, childShape, offsetPos, offsetRot);
388
389 // Since we are borrowing the shape of the child, disable the origional child body
390 if (!IsRoot(cPrim))
391 {
392 m_physicsScene.PE.AddToCollisionFlags(cPrim.PhysBody, CollisionFlags.CF_NO_CONTACT_RESPONSE);
393 m_physicsScene.PE.ForceActivationState(cPrim.PhysBody, ActivationState.DISABLE_SIMULATION);
394 // We don't want collisions from the old linkset children.
395 m_physicsScene.PE.RemoveFromCollisionFlags(cPrim.PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
396 cPrim.PhysBody.collisionType = CollisionType.LinksetChild;
397 }
388 } 398 }
389 else 399 else
390 { 400 {
@@ -404,20 +414,9 @@ public sealed class BSLinksetCompound : BSLinkset
404 m_physicsScene.Logger.WarnFormat("{0} Linkset rebuild warning. If this happens more than one or two times, please report in Mantis 7191", LogHeader); 414 m_physicsScene.Logger.WarnFormat("{0} Linkset rebuild warning. If this happens more than one or two times, please report in Mantis 7191", LogHeader);
405 m_physicsScene.Logger.WarnFormat("{0} pName={1}, childIdx={2}, shape={3}", 415 m_physicsScene.Logger.WarnFormat("{0} pName={1}, childIdx={2}, shape={3}",
406 LogHeader, LinksetRoot.Name, cPrim.LinksetChildIndex, childShape); 416 LogHeader, LinksetRoot.Name, cPrim.LinksetChildIndex, childShape);
407 return false; // 'false' says to move onto the next child in the list
408 } 417 }
409 } 418 }
410 419
411 // Since we are borrowing the shape of the child, disable the origional child body
412 if (!IsRoot(cPrim))
413 {
414 m_physicsScene.PE.AddToCollisionFlags(cPrim.PhysBody, CollisionFlags.CF_NO_CONTACT_RESPONSE);
415 m_physicsScene.PE.ForceActivationState(cPrim.PhysBody, ActivationState.DISABLE_SIMULATION);
416 // We don't want collisions from the old linkset children.
417 m_physicsScene.PE.RemoveFromCollisionFlags(cPrim.PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
418 cPrim.PhysBody.collisionType = CollisionType.LinksetChild;
419 }
420
421 return false; // 'false' says to move onto the next child in the list 420 return false; // 'false' says to move onto the next child in the list
422 }); 421 });
423 422