HeadTracker class

Head tracking input via device gyroscope with calibration.

Constructors

HeadTracker({required RotationTarget target, double sensitivity = 0.03, Stream<GyroscopeEvent>? gyroscopeStreamOverride, Stream<AccelerometerEvent>? accelerometerStreamOverride})
HeadTracker.forCamera(dynamic camera, {double sensitivity = 0.03, Stream<GyroscopeEvent>? gyroscopeStreamOverride, Stream<AccelerometerEvent>? accelerometerStreamOverride})
For backwards compatibility with VRCamera.
factory

Properties

accelerometerStreamOverride Stream<AccelerometerEvent>?
final
gyroscopeStreamOverride Stream<GyroscopeEvent>?
final
hashCode int
The hash code for this object.
no setterinherited
isActive bool
Whether gyroscope is available and active.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sensitivity double
Sensitivity multiplier for gyroscope input.
getter/setter pair
target RotationTarget
final

Methods

applyTouchDelta(double dx, double dy, {double touchSensitivity = 0.005}) → void
Applies touch/pan input as rotation (fallback when no gyroscope).
calibrate() → void
Calibrates gyroscope by averaging drift over 1 second.
dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() → void
Starts gyroscope tracking. Calls calibrate automatically.
stop() → void
Stops gyroscope tracking.
toString() String
A string representation of this object.
inherited

Operators

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