From 1c735faceeabc0e2888bdf9b1087a3fa7a9ae094 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 27 Apr 2012 09:23:20 +0100 Subject: test --- .../Region/Physics/UbitOdePlugin/ODECharacter.cs | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index 342b7b3..36440b1 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs @@ -379,24 +379,21 @@ namespace OpenSim.Region.Physics.OdePlugin get { return _position; } set { - if (Body == IntPtr.Zero || Shell == IntPtr.Zero) + if (value.IsFinite()) { - if (value.IsFinite()) + if (value.Z > 9999999f) { - if (value.Z > 9999999f) - { - value.Z = _parent_scene.GetTerrainHeightAtXY(127, 127) + 5; - } - if (value.Z < -100f) - { - value.Z = _parent_scene.GetTerrainHeightAtXY(127, 127) + 5; - } - AddChange(changes.Position, value); + value.Z = _parent_scene.GetTerrainHeightAtXY(127, 127) + 5; } - else + if (value.Z < -100f) { - m_log.Warn("[PHYSICS]: Got a NaN Position from Scene on a Character"); + value.Z = _parent_scene.GetTerrainHeightAtXY(127, 127) + 5; } + AddChange(changes.Position, value); + } + else + { + m_log.Warn("[PHYSICS]: Got a NaN Position from Scene on a Character"); } } } @@ -1248,6 +1245,7 @@ namespace OpenSim.Region.Physics.OdePlugin d.BodySetPosition(Body, newPos.X, newPos.Y, newPos.Z); _position = newPos; m_pidControllerActive = true; + m_log.DebugFormat("[ode character new position] {0}", newPos); } private void changeOrientation(Quaternion newOri) -- cgit v1.1