HeadTracker class
Head tracking input via device gyroscope with calibration and background Isolate.
Constructors
-
HeadTracker({required RotationTarget target, double sensitivity = 0.03, double predictionMs = 15.0, bool? useIsolate, Stream<
GyroscopeEvent> ? gyroscopeStreamOverride, Stream<AccelerometerEvent> ? accelerometerStreamOverride}) -
HeadTracker.forCamera(dynamic camera, {double sensitivity = 0.03, double predictionMs = 15.0, bool? useIsolate, 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
- isGyroscopeActive ↔ bool
-
getter/setter pair
- predictionMs ↔ double
-
Latency prediction compensation in milliseconds.
getter/setter pair
- 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
- useIsolate → bool
-
Whether to use background Isolate for sensor fusion (default: !kIsWeb)
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