VREngine class
Main VR engine. Manages the game loop, scene, camera, and rendering.
final engine = VREngine();
engine.scene.add(myMesh);
engine.start();
// In your widget:
CustomPaint(painter: engine.stereoPainter)
- Inheritance
-
- Object
- ChangeNotifier
- VREngine
Properties
- cameraRig → CameraRig
-
final
- culledCount → int
-
no setter
- desktopInput ↔ DesktopInputDriver?
-
getter/setter pair
- fps → double
-
no setter
- frameCount → int
-
no setter
- frameTimeMs → double
-
no setter
- gazePointer ↔ GazePointer?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- headTracker ↔ HeadTracker?
-
getter/setter pair
- inertialTapDetector ↔ InertialTapDetector?
-
getter/setter pair
- isRunning → bool
-
no setter
- monoPainter → VREnginePainter
-
Creates a CustomPainter that renders monoscopically.
no setter
- onUpdate ↔ void Function(double dt)?
-
Callback fired each frame after update.
getter/setter pair
- renderedCount → int
-
no setter
- renderPass ↔ RenderPass
-
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scene → Scene
-
final
- stereoPainter → VREnginePainter
-
Creates a CustomPainter that renders stereoscopically.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
disableDesktopInput(
) → void - Disables desktop input.
-
disableGazePointer(
) → void - Disables the gaze pointer.
-
disableHeadTracking(
) → void - Disables head tracking.
-
disableInertialTap(
) → void - Disables inertial tap detector.
-
dispose(
) → void -
Discards any resources used by the object.
override
-
enableDesktopInput(
{double lookSensitivity = 0.0035, double moveSpeed = 3.0, double sprintMultiplier = 2.5}) → DesktopInputDriver - Enables desktop input (mouse-look, WASD locomotion, mouse-picking). Returns the driver so the widget layer can forward pointer/key events (see DesktopInputRegion).
-
enableGazePointer(
{double dwellDuration = 2.0}) → void - Enables gaze-based interaction pointer (look-to-select).
-
enableHeadTracking(
{double sensitivity = 1.0}) → void -
Enables gyroscope head tracking.
sensitivity1.0 (default) = true 1:1 tracking, ideal for VR. -
enableInertialTap(
{VoidCallback? onSingleTap, VoidCallback? onDoubleTap}) → void - Enables zero-latency temple/visor physical tap detection.
-
handleTap(
) → void - Exposes screen tap event (e.g. Cardboard viewer button click) and propagates it to the gazed interactive target.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
start(
) → void - Starts the game loop, synchronized to the display's vsync when a SchedulerBinding is available (less jitter → less VR motion sickness than a fixed 16ms timer). Falls back to a ~60fps timer in headless environments (tests, isolates without a binding).
-
stop(
) → void - Stops the game loop.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited