aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs22
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs119
2 files changed, 75 insertions, 66 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 179160f..c5ffe98 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -1721,16 +1721,20 @@ namespace OpenSim.Region.Physics.OdePlugin
1721 1721
1722 if (l_position.X > 255.95f || l_position.X < 0f || l_position.Y > 255.95f || l_position.Y < 0f) 1722 if (l_position.X > 255.95f || l_position.X < 0f || l_position.Y > 255.95f || l_position.Y < 0f)
1723 { 1723 {
1724 base.RaiseOutOfBounds(_position); 1724 //base.RaiseOutOfBounds(l_position);
1725 1725
1726 //if (m_crossingfailures < 5) 1726 if (m_crossingfailures < 5)
1727 //{ 1727 {
1728 //base.RequestPhysicsterseUpdate(); 1728 _position = l_position;
1729 //} 1729 //_parent_scene.remActivePrim(this);
1730 //else 1730 base.RequestPhysicsterseUpdate();
1731 //{ 1731 return;
1732 //base.RaiseOutOfBounds(_position); 1732 }
1733 //} 1733 else
1734 {
1735 base.RaiseOutOfBounds(l_position);
1736 return;
1737 }
1734 } 1738 }
1735 1739
1736 if (l_position.Z < 0) 1740 if (l_position.Z < 0)
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index df3555f..16c6bb0 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -694,78 +694,80 @@ namespace OpenSim.Region.Physics.OdePlugin
694 694
695 // If the sim is running slow this frame, 695 // If the sim is running slow this frame,
696 // don't process collision for prim! 696 // don't process collision for prim!
697 if (timeStep < (m_SkipFramesAtms/3)) 697 //if (timeStep < (m_SkipFramesAtms/3))
698 //{
699 lock (_activeprims)
698 { 700 {
699 lock (_activeprims)
700 {
701 701
702 foreach (OdePrim chr in _activeprims) 702 foreach (OdePrim chr in _activeprims)
703 {
704 // This if may not need to be there.. it might be skipped anyway.
705 if (d.BodyIsEnabled(chr.Body) && (!chr.m_disabled))
703 { 706 {
704 // This if may not need to be there.. it might be skipped anyway.
705 if (d.BodyIsEnabled(chr.Body) && (!chr.m_disabled))
706 {
707 try
708 {
709 lock (chr)
710 {
711 if (space != (IntPtr)0 && chr.prim_geom != (IntPtr)0)
712 d.SpaceCollide2(space, chr.prim_geom, IntPtr.Zero, nearCallback);
713 }
714
715 }
716 catch (AccessViolationException)
717 {
718 m_log.Warn("[PHYSICS]: Unable to space collide");
719 }
720 //calculateSpaceForGeom(chr.Position)
721 //foreach (OdePrim ch2 in _prims)
722 /// should be a separate space -- lots of avatars will be N**2 slow
723 //{
724 //if (ch2.IsPhysical && d.BodyIsEnabled(ch2.Body))
725 //{
726 // Only test prim that are 0.03 meters away in one direction.
727 // This should be Optimized!
728
729 //if ((Math.Abs(ch2.Position.X - chr.Position.X) < 0.03) || (Math.Abs(ch2.Position.Y - chr.Position.Y) < 0.03) || (Math.Abs(ch2.Position.X - chr.Position.X) < 0.03))
730 //{
731 //d.SpaceCollide2(chr.prim_geom, ch2.prim_geom, IntPtr.Zero, nearCallback);
732 //}
733 //}
734 //}
735 }
736 try 707 try
737 { 708 {
738 lock (chr) 709 lock (chr)
739 { 710 {
740 if (LandGeom != (IntPtr)0 && chr.prim_geom != (IntPtr)0) 711 if (space != (IntPtr)0 && chr.prim_geom != (IntPtr)0 && chr.m_taintremove == false)
741 d.SpaceCollide2(LandGeom, chr.prim_geom, IntPtr.Zero, nearCallback); 712 d.SpaceCollide2(space, chr.prim_geom, IntPtr.Zero, nearCallback);
742 } 713 }
714
743 } 715 }
744 catch (AccessViolationException) 716 catch (AccessViolationException)
745 { 717 {
746 m_log.Warn("[PHYSICS]: Unable to space collide"); 718 m_log.Warn("[PHYSICS]: Unable to space collide");
747 } 719 }
720 //calculateSpaceForGeom(chr.Position)
721 //foreach (OdePrim ch2 in _prims)
722 /// should be a separate space -- lots of avatars will be N**2 slow
723 //{
724 //if (ch2.IsPhysical && d.BodyIsEnabled(ch2.Body))
725 //{
726 // Only test prim that are 0.03 meters away in one direction.
727 // This should be Optimized!
728
729 //if ((Math.Abs(ch2.Position.X - chr.Position.X) < 0.03) || (Math.Abs(ch2.Position.Y - chr.Position.Y) < 0.03) || (Math.Abs(ch2.Position.X - chr.Position.X) < 0.03))
730 //{
731 //d.SpaceCollide2(chr.prim_geom, ch2.prim_geom, IntPtr.Zero, nearCallback);
732 //}
733 //}
734 //}
748 } 735 }
736 //try
737 //{
738 //lock (chr)
739 //{
740 //if (LandGeom != (IntPtr)0 && chr.prim_geom != (IntPtr)0)
741 //d.SpaceCollide2(LandGeom, chr.prim_geom, IntPtr.Zero, nearCallback);
742 //}
743 //}
744 //catch (AccessViolationException)
745 // {
746 //m_log.Warn("[PHYSICS]: Unable to space collide");
747 //}
749 } 748 }
750 } 749 }
751 else 750 #region disabled code
752 { 751 //}
753 // Everything is going slow, so we're skipping object to object collisions 752 //else
754 // At least collide test against the ground. 753 //{
755 foreach (OdePrim chr in _activeprims) 754 // Everything is going slow, so we're skipping object to object collisions
756 { 755 // At least collide test against the ground.
757 // This if may not need to be there.. it might be skipped anyway. 756 //foreach (OdePrim chr in _activeprims)
758 if (d.BodyIsEnabled(chr.Body)) 757 //{
759 { 758 // This if may not need to be there.. it might be skipped anyway.
760 // Collide test the prims with the terrain.. since if you don't do this, 759 //if (d.BodyIsEnabled(chr.Body))
761 // next frame, all of the physical prim in the scene will awaken and explode upwards 760 //{
762 tmpSpace = calculateSpaceForGeom(chr.Position); 761 // Collide test the prims with the terrain.. since if you don't do this,
763 if (tmpSpace != (IntPtr) 0 && d.GeomIsSpace(tmpSpace)) 762 // next frame, all of the physical prim in the scene will awaken and explode upwards
764 d.SpaceCollide2(calculateSpaceForGeom(chr.Position), chr.prim_geom, IntPtr.Zero, nearCallback); 763 //tmpSpace = calculateSpaceForGeom(chr.Position);
765 d.SpaceCollide2(LandGeom, chr.prim_geom, IntPtr.Zero, nearCallback); 764 //if (tmpSpace != (IntPtr) 0 && d.GeomIsSpace(tmpSpace))
766 } 765 //d.SpaceCollide2(calculateSpaceForGeom(chr.Position), chr.prim_geom, IntPtr.Zero, nearCallback);
767 } 766 //d.SpaceCollide2(LandGeom, chr.prim_geom, IntPtr.Zero, nearCallback);
768 } 767 //}
768 //}
769 //}
770 #endregion
769 } 771 }
770 772
771 #endregion 773 #endregion
@@ -870,7 +872,10 @@ namespace OpenSim.Region.Physics.OdePlugin
870 872
871 public void remActivePrim(OdePrim deactivatePrim) 873 public void remActivePrim(OdePrim deactivatePrim)
872 { 874 {
873 _activeprims.Remove(deactivatePrim); 875 lock (_activeprims)
876 {
877 _activeprims.Remove(deactivatePrim);
878 }
874 } 879 }
875 880
876 public override void RemovePrim(PhysicsActor prim) 881 public override void RemovePrim(PhysicsActor prim)