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

Constructors

VREngine({Scene? scene, CameraRig? cameraRig})

Properties

cameraRig CameraRig
final
culledCount int
no setter
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
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
disableGazePointer() → void
Disables the gaze pointer.
disableHeadTracking() → void
Disables head tracking.
dispose() → void
Discards any resources used by the object.
override
enableGazePointer({double dwellDuration = 2.0}) → void
Enables gaze-based interaction pointer (look-to-select).
enableHeadTracking({double sensitivity = 0.03}) → void
Enables gyroscope head tracking.
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 at ~60fps.
stop() → void
Stops the game loop.
toString() String
A string representation of this object.
inherited

Operators

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