GazePointer class

Gaze-based pointer for VR interaction (look to select). Fires a ray from the camera center forward direction.

Constructors

GazePointer({required CameraRig cameraRig, double dwellDuration = 2.0, void onDwellSelect(String nodeId)?, void onGazeEnter(String nodeId)?, void onGazeExit(String nodeId)?})

Properties

cameraRig CameraRig
final
dwellDuration double
Duration in seconds to dwell-select.
getter/setter pair
dwellProgress double
Current dwell progress (0 to 1).
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
onDwellSelect ↔ void Function(String nodeId)?
Callback when a target is selected via dwell.
getter/setter pair
onGazeEnter ↔ void Function(String nodeId)?
Callback when gaze enters a target.
getter/setter pair
onGazeExit ↔ void Function(String nodeId)?
Callback when gaze exits a target.
getter/setter pair
ray → Ray
The ray from camera center in forward direction.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
renderReticle(Canvas canvas, Size viewportSize) → void
Renders the reticle (crosshair) at screen center.
toString() String
A string representation of this object.
inherited
update(double dt, String? hitNodeId) → void
Call each frame with the currently gazed node ID (or null).

Operators

operator ==(Object other) bool
The equality operator.
inherited