RSX Code Reference
    Preparing search index...

    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.

    Index
    defaultViewportWidth: number

    The default viewport width. Viewport-size dependent gizmo scaling is relative to this width.

    • 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 and the size of the viewport.

      Parameters

      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