OptionalclientZSpatial input data
Readonlydevicethe device index: mouse and touch are always 0, otherwise e.g. index of the connected Gamepad or XRController
Readonlyintersectionsintersections that were generated from this event (or are associated with this event in any way)
true if this event is a click
true if this event is a double click
Readonlymetadatametadata can be used to associate additional information with the event
ReadonlymodeIs the pointer event created via a touch on screen or a spatial device like a XR controller or hand tracking?
ReadonlyoriginThe origin of the event contains a reference to the creator of this event.
This can be the Needle Engine input system or e.g. a XR controller.
Implement onPointerHits to receive the intersections of this event.
Readonlysourcethe browser event that triggered this event (if any)
ReadonlyspaceThe device space (this object is not necessarily rendered in the scene but you can access or copy the matrix)
E.g. you can access the input world space source position with space.worldPosition or world direction with space.worldForward
true if this event has a ray. If you access the ray property a ray will automatically created
Returns true if the input was emitted in 3D space (and not by e.g. clicking on a 2D screen). You can use mode if you need more information about the input source
Unique identifier for this input: a combination of the deviceIndex + button to uniquely identify the exact input (e.g. LeftController:Button0 = 0, RightController:Button1 = 11)
What type of input created this event: touch, mouse, xr controller, xr hand tracking...
A ray in worldspace for the event.
If the ray is undefined you can also use space.worldForward and space.worldPosition
The input that raised this event like pointerdown
true if the event is marked to be used (when use() has been called). Default: false
Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
Call to mark an event to be used
The Needle Engine Pointer Event is a custom event that extends the PointerEvent. It holds additional information like the device index, the origin of the event, the mode of the event (e.g. screen or spatial), the ray in world space, the space of the device, and more.