aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2014-05-27 10:13:43 -0700
committerDiva Canto2014-05-27 10:13:43 -0700
commit987c56984d8b64d2163d6f8a54c85aea6bc59036 (patch)
treee18bed774e2c5bd7122c78d0d9006006ed08ba25
parentFixes a bug where map search results pertaining to varregions would only sen... (diff)
parentBulletSim: add locking of PhysObjects while processing simulation (diff)
downloadopensim-SC-987c56984d8b64d2163d6f8a54c85aea6bc59036.zip
opensim-SC-987c56984d8b64d2163d6f8a54c85aea6bc59036.tar.gz
opensim-SC-987c56984d8b64d2163d6f8a54c85aea6bc59036.tar.bz2
opensim-SC-987c56984d8b64d2163d6f8a54c85aea6bc59036.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs34
1 files changed, 20 insertions, 14 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 9fa55ce..23bada9 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -639,15 +639,18 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
639 { 639 {
640 if (collidersCount > 0) 640 if (collidersCount > 0)
641 { 641 {
642 for (int ii = 0; ii < collidersCount; ii++) 642 lock (PhysObjects)
643 { 643 {
644 uint cA = m_collisionArray[ii].aID; 644 for (int ii = 0; ii < collidersCount; ii++)
645 uint cB = m_collisionArray[ii].bID; 645 {
646 Vector3 point = m_collisionArray[ii].point; 646 uint cA = m_collisionArray[ii].aID;
647 Vector3 normal = m_collisionArray[ii].normal; 647 uint cB = m_collisionArray[ii].bID;
648 float penetration = m_collisionArray[ii].penetration; 648 Vector3 point = m_collisionArray[ii].point;
649 SendCollision(cA, cB, point, normal, penetration); 649 Vector3 normal = m_collisionArray[ii].normal;
650 SendCollision(cB, cA, point, -normal, penetration); 650 float penetration = m_collisionArray[ii].penetration;
651 SendCollision(cA, cB, point, normal, penetration);
652 SendCollision(cB, cA, point, -normal, penetration);
653 }
651 } 654 }
652 } 655 }
653 } 656 }
@@ -658,14 +661,17 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
658 { 661 {
659 if (updatedEntityCount > 0) 662 if (updatedEntityCount > 0)
660 { 663 {
661 for (int ii = 0; ii < updatedEntityCount; ii++) 664 lock (PhysObjects)
662 { 665 {
663 EntityProperties entprop = m_updateArray[ii]; 666 for (int ii = 0; ii < updatedEntityCount; ii++)
664 BSPhysObject pobj;
665 if (PhysObjects.TryGetValue(entprop.ID, out pobj))
666 { 667 {
667 if (pobj.IsInitialized) 668 EntityProperties entprop = m_updateArray[ii];
668 pobj.UpdateProperties(entprop); 669 BSPhysObject pobj;
670 if (PhysObjects.TryGetValue(entprop.ID, out pobj))
671 {
672 if (pobj.IsInitialized)
673 pobj.UpdateProperties(entprop);
674 }
669 } 675 }
670 } 676 }
671 } 677 }