diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 4f61342..a88f8a9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1617,6 +1617,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
1617 | } | 1617 | } |
1618 | 1618 | ||
1619 | /// <summary> | 1619 | /// <summary> |
1620 | /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. | ||
1621 | /// </summary> | ||
1622 | /// <param name="height">Height to hover. Height of zero disables hover.</param> | ||
1623 | /// <param name="hoverType">Determines what the height is relative to </param> | ||
1624 | /// <param name="tau">Number of seconds over which to reach target</param> | ||
1625 | public void SetHoverHeight(float height, PIDHoverType hoverType, float tau) | ||
1626 | { | ||
1627 | SceneObjectPart rootpart = m_rootPart; | ||
1628 | if (rootpart != null) | ||
1629 | { | ||
1630 | if (rootpart.PhysActor != null) | ||
1631 | { | ||
1632 | if (height != 0f) | ||
1633 | { | ||
1634 | rootpart.PhysActor.PIDHoverHeight = height; | ||
1635 | rootpart.PhysActor.PIDHoverType = hoverType; | ||
1636 | rootpart.PhysActor.PIDTau = tau; | ||
1637 | rootpart.PhysActor.PIDHoverActive = true; | ||
1638 | } | ||
1639 | else | ||
1640 | { | ||
1641 | rootpart.PhysActor.PIDHoverActive = false; | ||
1642 | } | ||
1643 | } | ||
1644 | } | ||
1645 | } | ||
1646 | |||
1647 | |||
1648 | |||
1649 | |||
1650 | /// <summary> | ||
1620 | /// Set the owner of the root part. | 1651 | /// Set the owner of the root part. |
1621 | /// </summary> | 1652 | /// </summary> |
1622 | /// <param name="part"></param> | 1653 | /// <param name="part"></param> |