aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
diff options
context:
space:
mode:
authorDr Scofield2009-06-25 07:39:48 +0000
committerDr Scofield2009-06-25 07:39:48 +0000
commit652bcf91d50898181638a2668c9e2dcacfa33005 (patch)
treec1bdb97e6ef633d9b7605acbaa7eab6afd404f48 /OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
parentAllow "Take Copy" with copy only permissions if you own the object. Trans (diff)
downloadopensim-SC_OLD-652bcf91d50898181638a2668c9e2dcacfa33005.zip
opensim-SC_OLD-652bcf91d50898181638a2668c9e2dcacfa33005.tar.gz
opensim-SC_OLD-652bcf91d50898181638a2668c9e2dcacfa33005.tar.bz2
opensim-SC_OLD-652bcf91d50898181638a2668c9e2dcacfa33005.tar.xz
- fixes a "collection out of sync" exception in the ODE physics
engine, caused by an "avatar infinite position" occurring under heavy load. - fixes "value too small" exception in ChatModule
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 3f0d6c1..e5e7d07 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.Reflection; 30using System.Reflection;
30using OpenMetaverse; 31using OpenMetaverse;
31using Ode.NET; 32using Ode.NET;
@@ -785,7 +786,7 @@ namespace OpenSim.Region.Physics.OdePlugin
785 /// This is the avatar's movement control + PID Controller 786 /// This is the avatar's movement control + PID Controller
786 /// </summary> 787 /// </summary>
787 /// <param name="timeStep"></param> 788 /// <param name="timeStep"></param>
788 public void Move(float timeStep) 789 public void Move(float timeStep, List<OdeCharacter> defects)
789 { 790 {
790 // no lock; for now it's only called from within Simulate() 791 // no lock; for now it's only called from within Simulate()
791 792
@@ -803,11 +804,14 @@ namespace OpenSim.Region.Physics.OdePlugin
803 804
804 d.Vector3 localpos = d.BodyGetPosition(Body); 805 d.Vector3 localpos = d.BodyGetPosition(Body);
805 PhysicsVector localPos = new PhysicsVector(localpos.X, localpos.Y, localpos.Z); 806 PhysicsVector localPos = new PhysicsVector(localpos.X, localpos.Y, localpos.Z);
807
806 if (!PhysicsVector.isFinite(localPos)) 808 if (!PhysicsVector.isFinite(localPos))
807 { 809 {
808 810
809 m_log.Warn("[PHYSICS]: Avatar Position is non-finite!"); 811 m_log.Warn("[PHYSICS]: Avatar Position is non-finite!");
810 _parent_scene.RemoveCharacter(this); 812 defects.Add(this);
813 // _parent_scene.RemoveCharacter(this);
814
811 // destroy avatar capsule and related ODE data 815 // destroy avatar capsule and related ODE data
812 if (Amotor != IntPtr.Zero) 816 if (Amotor != IntPtr.Zero)
813 { 817 {
@@ -815,6 +819,7 @@ namespace OpenSim.Region.Physics.OdePlugin
815 d.JointDestroy(Amotor); 819 d.JointDestroy(Amotor);
816 Amotor = IntPtr.Zero; 820 Amotor = IntPtr.Zero;
817 } 821 }
822
818 //kill the Geometry 823 //kill the Geometry
819 _parent_scene.waitForSpaceUnlock(_parent_scene.space); 824 _parent_scene.waitForSpaceUnlock(_parent_scene.space);
820 825
@@ -958,7 +963,8 @@ namespace OpenSim.Region.Physics.OdePlugin
958 { 963 {
959 m_log.Warn("[PHYSICS]: Got a NaN force vector in Move()"); 964 m_log.Warn("[PHYSICS]: Got a NaN force vector in Move()");
960 m_log.Warn("[PHYSICS]: Avatar Position is non-finite!"); 965 m_log.Warn("[PHYSICS]: Avatar Position is non-finite!");
961 _parent_scene.RemoveCharacter(this); 966 defects.Add(this);
967 // _parent_scene.RemoveCharacter(this);
962 // destroy avatar capsule and related ODE data 968 // destroy avatar capsule and related ODE data
963 if (Amotor != IntPtr.Zero) 969 if (Amotor != IntPtr.Zero)
964 { 970 {