public override void SetHover(PIDHoverFlag hoverType, float height, float tau, float damping) { lock (_properties) { _properties.HoverType = hoverType; _properties.HoverHeight = height; _properties.HoverTau = tau; _properties.HoverDamping = damping; } _scene.QueueCommand(new Commands.WakeUpCmd(this)); }
/// <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, PIDHoverFlag hoverType, float tau) { m_parentGroup.SetHoverHeight(height, hoverType, tau); }
/// <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, PIDHoverFlag hoverType, float tau) { SceneObjectPart rootpart = m_rootPart; if (rootpart != null) { PhysicsActor physActor = rootpart.PhysActor; if (physActor != null) { if (height != 0f) { physActor.SetHover(hoverType, height, tau, 1.0f); } else { physActor.ClearHover(); } } } }