From a135e51d232143556e8154ccffeaf4860e02e33d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 2 May 2012 22:08:09 +0100 Subject: Improved sitted avatars crossings ( plus tests on vehicles) --- OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Physics') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs index 7b232c1..9fefc4e 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs @@ -793,10 +793,7 @@ namespace OpenSim.Region.Physics.OdePlugin float perr; // default to global but don't go underground - if (t < m_VhoverHeight) - perr = m_VhoverHeight - pos.Z; - else - perr = t - pos.Z; ; + perr = m_VhoverHeight - pos.Z; if ((m_flags & VehicleFlag.HOVER_GLOBAL_HEIGHT) == 0) { @@ -817,9 +814,13 @@ namespace OpenSim.Region.Physics.OdePlugin perr += w; } } + else if (t > m_VhoverHeight) + perr = t - pos.Z; ; + if ((m_flags & VehicleFlag.HOVER_UP_ONLY) == 0 || perr > 0) { - force.Z += (perr / m_VhoverTimescale / m_VhoverTimescale - curVel.Z * m_VhoverEfficiency) / m_timestep; + // force.Z += (perr / m_VhoverTimescale / m_VhoverTimescale - curVel.Z * m_VhoverEfficiency) / m_timestep; + force.Z += (perr / m_VhoverTimescale - curVel.Z * m_VhoverEfficiency);// * m_invtimestep); force.Z += _pParentScene.gravityz * (1f - m_VehicleBuoyancy); } else // no buoyancy -- cgit v1.1