From b637a11b58292cb6165317b317dc077a79ee6779 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Fri, 6 Mar 2009 23:01:35 +0000 Subject: 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. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ede007e..4efadc3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1748,6 +1748,23 @@ if (m_shape != null) { } } + /// + /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. + /// + /// Height to hover. Height of zero disables hover. + /// Determines what the height is relative to + /// Number of seconds over which to reach target + public void SetHoverHeight(float height, PIDHoverType hoverType, float tau) + { + m_parentGroup.SetHoverHeight(height, hoverType, tau); + } + + public void StopHover() + { + m_parentGroup.SetHoverHeight(0f, PIDHoverType.Ground, 0f); + } + + public virtual void OnGrab(Vector3 offsetPos, IClientAPI remoteClient) { } -- cgit v1.1