mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
Fixes Mantis #3260. Thank you kindly, MCortez for a patch that:
llSetHoverHeight() should not clamp the x/y position of an object the way MoveTo does, and it should recalculate the absolute height to hover at as an object moves to reflect the current ground/water height under it. Correctly implementing required adjusting the Physics interfaces and implementing at the physics plug-in level. The attached is a patch that correctly implements llSetHoverHeight() including updates to the ODE physics plug-in.
This commit is contained in:
@@ -1616,6 +1616,37 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds.
|
||||
/// </summary>
|
||||
/// <param name="height">Height to hover. Height of zero disables hover.</param>
|
||||
/// <param name="hoverType">Determines what the height is relative to </param>
|
||||
/// <param name="tau">Number of seconds over which to reach target</param>
|
||||
public void SetHoverHeight(float height, PIDHoverType hoverType, float tau)
|
||||
{
|
||||
SceneObjectPart rootpart = m_rootPart;
|
||||
if (rootpart != null)
|
||||
{
|
||||
if (rootpart.PhysActor != null)
|
||||
{
|
||||
if (height != 0f)
|
||||
{
|
||||
rootpart.PhysActor.PIDHoverHeight = height;
|
||||
rootpart.PhysActor.PIDHoverType = hoverType;
|
||||
rootpart.PhysActor.PIDTau = tau;
|
||||
rootpart.PhysActor.PIDHoverActive = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
rootpart.PhysActor.PIDHoverActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set the owner of the root part.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user