Class GizmoUtility

The GizmoUtility provides helper functions for viewport gizmos that use the drawGizmo decorators as well as InteractiveGizmo subclasses. It also provides access to settings that are reused for different gizmo implementations.

Constructors

Accessors

Methods

  • Creates a context menu for the available gizmos.

    Parameters

    • sceneGizmos: SceneGizmos

      Scene gizmos to create the context menu from.

    Returns UIContextMenu

    Context menu for the available gizmos.

  • Returns a scale that can be applied to a handle in order to keep it at constant size regardless of distance from the provided camera.

    Parameters

    • camera: Camera

      Camera through which the handle is being viewed.

    • position: Immutable<Vector3>

      center of the handle.

    Returns number

    Uniform scale to apply to the handle.

  • Snaps an angle value to the specified increments.

    Parameters

    • value: rsx.Degree

      Value to snap.

    • snapAmount: rsx.Degree

      Increment to which to snap the value to.

    Returns rsx.Degree

    Value snapped to the provided increments.

  • Snaps a value to the specified increments.

    Parameters

    • value: number

      Value to snap.

    • snapAmount: number

      Increment to which to snap the value to.

    Returns number

    Value snapped to the provided increments.

  • Snaps a vector to the specified increments.

    Parameters

    • value: Immutable<Vector3>

      Vector to snap.

    • snapAmount: number

      Increment to which to snap the value to.

    Returns Vector3

    Value snapped to the provided increments.

  • Syncs the active gizmo states from the settings.

    Parameters

    • sceneGizmos: SceneGizmos

      Scene gizmos to sync the active gizmo states to.

    Returns void