The engine's one boundary to an XR runtime.
A runtime extends this — WebXrSession, OpenXrSession and the
test's FakeXrSession — and the engine drives it: start with what it
asks for, then each frame waitFrame for when it will be shown and
where everything will be, draw, and endFrame with the layers to
compose. Every member that is a feature (anchors, haptics, layers
beyond the projection) has a body that refuses it by name, so a session
written against 1.0 compiles against every 1.x, and a feature a minor
adds arrives the same way.
Each hook takes one object. A frame, a request, an end: each can gain fields in a minor, where a list of parameters could not.
- Implementers
Properties
-
capabilities
→ Set<
XrCapability> -
What the runtime can do, asked before start.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeName → String
-
Who the session is, as a refusal names it:
WebXR,OpenXR (Quest).no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → XrSessionState
-
Where the session is in its life.
no setter
-
states
→ Stream<
XrSessionState> -
state as it changes.
no setter
Methods
-
createSwapchain(
XrSwapchainRequest request) → XrSwapchain -
A swapchain of images the runtime shows, of the shape
requestasks: what the projection layer is drawn into. Refused by default, by a session that draws into Flutter's own surface (XrCapability.inline). -
end(
) → Future< void> - Ends the session; state becomes XrSessionState.ended.
-
endFrame(
XrFrameEnd end) → void -
Hands the runtime what was drawn for
end.frame, as layers. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
placeAnchor(
XrAnchorRequest request) → Future< XrAnchor> -
Fixes a point to the real world, as
requestasks. Refused by default (XrCapability.anchors). -
refusal(
XrCapability capability) → UnsupportedCapabilityException -
The refusal of
capabilityby this runtime. -
requireCapabilities(
XrSessionRequest request) → void -
Throws the refusal of the first of
request's mode and required capabilities this runtime lacks; what start calls first. -
restoreAnchor(
String id) → Future< XrAnchor?> -
The anchor kept under
idin an earlier session, where the runtime persists anchors; null when it does not know the id. Refused by default (XrCapability.anchors). -
start(
XrSessionRequest request) → Future< void> -
Starts the session as
requestasks. Throws anUnsupportedCapabilityExceptionnaming the first capability ofrequest.required(or its mode) the runtime does not have — see requireCapabilities. -
toString(
) → String -
A string representation of this object.
inherited
-
vibrate(
XrHaptic haptic) → void -
Plays
hapticon a controller. Refused by default (XrCapability.haptics). -
waitFrame(
) → Future< XrFrame> - Waits for the runtime's next frame and says what it will be: the runtime's pace, so it completes when the runtime is ready for the frame to be drawn.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited