spatial-controls - v6.2.0
    Preparing search index...

    Class RotationControls

    3D rotation controls.

    This class emits events of type EVENT_UPDATE when the quaternion is changed.

    Hierarchy

    Implements

    Index

    Constructors

    Properties

    settings: Settings

    The control settings.

    Accessors

    • get enabled(): boolean

      Indicates whether the controls are enabled.

      Event listeners will be registered or unregistered depending on this flag.

      Returns boolean

    • set enabled(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    Methods

    • Returns the projected view direction.

      The projected direction will be reached if there are no further rotation adjustments. If damping is disabled, the vector will be equal to the direction returned by getViewDirection.

      Parameters

      • view: Vector3

        A vector to store the direction in.

      Returns Vector3

      The normalized view direction.

    • Locks or unlocks the pointer.

      Parameters

      • locked: boolean = true

        Whether the pointer should be locked.

      Returns void

    • Enables or disables the rotation mode.

      Parameters

      • enabled: boolean

        Whether the rotation mode should be activated.

      Returns void

    • Synchronizes the internal state with external changes.

      Parameters

      • previousPosition: Vector3

        The previous position.

      • previousQuaternion: Quaternion

        The previous quaternion.

      • previousTarget: Vector3

        The previous target.

      Returns void

    Events

    EVENT_UPDATE: "update"

    Triggers when the quaternion is changed.