From 04ed5519a5ad265794a0768a6a3c9e4e0fdf1a6c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 16 Apr 2012 17:14:31 +0100 Subject: chODE bug fix --- OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Physics') diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs index 1f1ba95..c53ccec 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs @@ -921,6 +921,8 @@ namespace OpenSim.Region.Physics.OdePlugin m_haveTaintMomentum = true; _parent_scene.AddPhysicsActorTaint(this); } + else + m_log.Warn("[PHYSICS] !isFinite momentum"); } @@ -1337,7 +1339,6 @@ namespace OpenSim.Region.Physics.OdePlugin { lock (m_syncRoot) { - if (m_tainted_isPhysical != m_isPhysical) { if (m_tainted_isPhysical) @@ -1379,9 +1380,9 @@ namespace OpenSim.Region.Physics.OdePlugin { d.GeomDestroy(Shell); } - catch (System.AccessViolationException) + catch (Exception e) { - m_log.Error("[PHYSICS]: PrimGeom dead"); + m_log.ErrorFormat("[PHYSICS]: Failed to destroy character shell {0}",e.Message); } // Remove any old entries //string tShell; @@ -1428,10 +1429,10 @@ namespace OpenSim.Region.Physics.OdePlugin { d.BodySetPosition(Body, m_taintPosition.X, m_taintPosition.Y, m_taintPosition.Z); - _position.X = m_taintPosition.X; - _position.Y = m_taintPosition.Y; - _position.Z = m_taintPosition.Z; } + _position.X = m_taintPosition.X; + _position.Y = m_taintPosition.Y; + _position.Z = m_taintPosition.Z; } if (m_haveTaintMomentum) @@ -1440,7 +1441,8 @@ namespace OpenSim.Region.Physics.OdePlugin _velocity = m_taintMomentum; _target_velocity = m_taintMomentum; m_pidControllerActive = true; - d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z); + if (Body != IntPtr.Zero) + d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z); } } } -- cgit v1.1