Class ThreeRayPointerDriver

Hierarchy

Constructors

Properties

hints: Map<number, PointerHint>

The PointerHint | hints for each pointer. The keys are pointer IDs, while the values are that pointer's hint.

See PointerDriver#getPointerHint

raycaster: Raycaster = ...
sources: Set<RayPointerSource>

The sources which this is assigned to

states: Map<Root, PointerDriverState>

The current state for each registered and enabled root. Contains whether each root is pressing, hovering, which pointer is bound to it and its event queue

Methods

  • Add a source. Assigns itself to the given source.

    Parameters

    Returns void

  • Parameters

    • origin: [number, number, number]
    • direction: [number, number, number]

    Returns [null | ThreeRoot, number, number]

  • Get a pointer's PointerHint | hint.

    Returns

    Returns the given pointer ID's hint. If the pointer ID is not registered, PointerHint.None is returned.

    Parameters

    • pointer: number

      The registered pointer ID

    Returns PointerHint

  • Receive a ray from a RayPointerSource.

    Parameters

    • pointer: number

      The source's pointer ID, given when setting the source's sink

    • pressing: null | number

      Is the pointer pressed? If null, then the last pressing state will be used. A bitmask where each set bit represents a different button being pressed

    • origin: [number, number, number]

      The world position where the ray is starting

    • direction: [number, number, number]

      A normalised vector representing the ray's direction. Not a euler rotation nor a quaternion

    • shift: boolean

      Is shift being pressed?

    • ctrl: boolean

      Is control being pressed?

    • alt: boolean

      Is alt being pressed?

    Returns void

  • Queue up a Leave event to any root with the given pointer assigned. Event will only be queued if the root was being hovered. Pointer will also be unassigned from root.

    Parameters

    • pointer: number

      The registered pointer ID

    Returns void

  • Queue up a Leave event to a given root. Event will only be queued if the root was being hovered.

    Parameters

    • root: Root
    • pointer: number

      The registered pointer ID

    Returns void

  • Queue up a pointer event to a given root. The type of PointerEvent is decided automatically based on the root's state and whether its pressing or not.

    Parameters

    • root: Root
    • pointer: number

      The registered pointer ID

    • xNorm: number

      The normalised (non-integer range from 0 to 1) X coordinate of the pointer event. 0 is the left edge of the root, while 1 is the right edge of the root.

    • yNorm: number

      The normalised (non-integer range from 0 to 1) Y coordinate of the pointer event. 0 is the top edge of the root, while 1 is the bottom edge of the root.

    • pressing: null | number

      Is the pointer pressed? If null, then the last pressing state will be used. A bitmask where each set bit represents a different button being pressed

    • shift: boolean

      Is shift being pressed?

    • ctrl: boolean

      Is control being pressed?

    • alt: boolean

      Is alt being pressed?

      If null, the last pressing state is used, meaning that the pressing state has not changed. Useful if getting pointer movement in an event based environment where you only know when a pointer press occurs, but not if the pointer is pressed or not

    Returns void

  • Dispatches a leave event for the disabled root and deletes the state of the disabled root from PointerDriver#states.

    Parameters

    Returns void

  • Creates a state for the enabled root in PointerDriver#states.

    Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Register a new pointer.

    Returns

    Returns PointerDriver#nextPointerID and increments it

    Parameters

    • Optional dragToScroll: boolean

      If true, then dragging will result in PointerWheel events if no widget captures the events.

    Returns number

  • Parameters

    Returns boolean

  • Unregister a pointer.

    If a root has this pointer bound to it, the pointer is unbound from the root, a Leave event is queued to the root and the hovering and pressing state of the root is set to false.

    Parameters

    • pointer: number

    Returns void

  • Dispatches all queued events (found in PointerDriver#states) for the root and clears its event queue

    Parameters

    Returns void

  • Queue up a mouse wheel event in a given 2D direction. Event will only be queued if the root was being hovered.

    Parameters

    • root: Root
    • pointer: number

      The registered pointer ID

    • xNorm: number

      The normalised (non-integer range from 0 to 1) X coordinate of the pointer event. 0 is the left edge of the root, while 1 is the right edge of the root.

    • yNorm: number

      The normalised (non-integer range from 0 to 1) Y coordinate of the pointer event. 0 is the top edge of the root, while 1 is the bottom edge of the root.

    • deltaX: number

      How much was scrolled horizontally, in pixels

    • deltaY: number

      How much was scrolled vertically, in pixels

    • deltaZ: number

      How much was scrolled in the Z axis, in pixels. Rarely used

    • deltaMode: PointerWheelMode

      How the delta values should be interpreted

    • shift: boolean

      Is shift being pressed?

    • ctrl: boolean

      Is control being pressed?

    • alt: boolean

      Is alt being pressed?

    Returns void

Generated using TypeDoc