Abstract
Protected
hintsThe hints for each pointer. The keys are pointer IDs, while the values are that pointer's hint.
See getPointerHint
Protected
Readonly
sourcesThe sources which this is assigned to
Protected
statesThe 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
Add a source. Assigns itself to the given source.
Abstract
castCast a ray in the world and get which root was intersected and where.
Returns a 3-tuple containing, in this order, the intersected root or null if none intersected, the normalised x axis of the intersection and the normalised y axis of the intersection. If no root was intersected, use bogus values for x and y
The world position where the ray is starting
A normalised vector representing the ray's direction. Not a euler rotation nor a quaternion
Get a pointer's hint.
Returns the given pointer ID's hint. If the pointer ID is not registered, None is returned.
The registered pointer ID
Receive a ray from a RayPointerSource.
The source's pointer ID, given when setting the source's sink
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
The world position where the ray is starting
A normalised vector representing the ray's direction. Not a euler rotation nor a quaternion
Is shift being pressed?
Is control being pressed?
Is alt being pressed?
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.
The registered pointer ID
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.
The registered pointer ID
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.
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.
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
Is shift being pressed?
Is control being pressed?
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
Hook called by requestFocus and clearFocus
Protected
setThe registered pointer ID
The new pointer hint
Queue up a mouse wheel event in a given 2D direction. Event will only be queued if the root was being hovered.
The registered pointer ID
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.
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.
How much was scrolled horizontally, in pixels
How much was scrolled vertically, in pixels
How much was scrolled in the Z axis, in pixels. Rarely used
How the delta values should be interpreted
Is shift being pressed?
Is control being pressed?
Is alt being pressed?
Generated using TypeDoc
A PointerDriver which gets pointer events from raycasts in a 3D engine's world. This is an abstract class and must be implemented. For an example, see canvas-ui-three's ThreeRayPointerDriver implementation.