Oooops don't hover underground but do hover

avinationmerge
UbitUmarov 2012-04-27 23:18:54 +01:00
parent f5cb403e7e
commit e48fa38ff5
1 changed files with 27 additions and 26 deletions

View File

@ -773,11 +773,13 @@ namespace OpenSim.Region.Physics.OdePlugin
d.Vector3 pos = d.BodyGetPosition(Body);
float t = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y);
float perr;
if (t < m_VhoverHeight) // don't go underground
{
// default to global
float perr = m_VhoverHeight - pos.Z; ;
// default to global but don't go underground
if (t < m_VhoverHeight)
perr = m_VhoverHeight - pos.Z;
else
perr = t - pos.Z; ;
if ((m_flags & VehicleFlag.HOVER_GLOBAL_HEIGHT) == 0)
{
@ -806,7 +808,6 @@ namespace OpenSim.Region.Physics.OdePlugin
else // no buoyancy
force.Z += _pParentScene.gravityz;
}
}
else
{
// default gravity and Buoyancy