WebXRWorker class
This class represents an abstraction of the WebXR Device API and is
internally used by {@link WebGLRenderer}. WebXRManager
also provides a public
interface that allows users to enable/disable XR and perform XR related
tasks like for instance retrieving controllers.
@augments EventDispatcher @hideconstructor /
- Inheritance
-
- Object
- WebXRManager
- WebXRWorker
Constructors
- WebXRWorker.new(WebGLRenderer renderer, RenderingContext gl)
Properties
- animation → WebGLAnimation
-
final
- attributes ↔ Map
-
latefinal
- cameraAutoUpdate ↔ bool
-
getter/setter pairinherited
- cameraL → PerspectiveCamera
-
final
- cameraLPos → Vector3
-
final
- cameraR → PerspectiveCamera
-
final
- cameraRPos → Vector3
-
final
-
cameras
↔ List<
Camera?> -
latefinal
- cameraXR → ArrayCamera
-
final
-
controllerInputSources
→ List<
XRInputSource?> -
final
-
controllers
→ List<
WebXRController?> -
final
- currentPixelRatio ↔ double?
-
getter/setter pair
- currentSize → Vector2
-
final
- customReferenceSpace ↔ XRReferenceSpace?
-
getter/setter pair
- depthSensing → WebXRDepthSensing
-
final
- enabled ↔ bool
-
getter/setter pairinherited
- foveation ↔ double
-
getter/setter pair
- framebufferScaleFactor ↔ double
-
getter/setter pair
- gl ↔ RenderingContext
-
getter/setter pairinherited
- glBaseLayer ↔ XRWebGLLayer?
-
getter/setter pair
- glBinding ↔ XRWebGLBinding?
-
getter/setter pair
- glFramebuffer ↔ Framebuffer?
-
getter/setter pair
- glProjLayer ↔ XRProjetionLayer?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialRenderTarget ↔ RenderTarget?
-
getter/setter pair
- isPresenting ↔ bool
-
getter/setter pairinherited
- newRenderTarget ↔ RenderTarget?
-
getter/setter pair
- onAnimationFrameCallback ↔ dynamic
-
getter/setter pair
- onXRSessionEnd ↔ Function?
-
getter/setter pairinherited
- onXRSessionStart ↔ Function?
-
getter/setter pairinherited
- pose ↔ XRViewerPose?
-
getter/setter pair
- referenceSpace ↔ XRReferenceSpace?
-
getter/setter pair
- referenceSpaceType ↔ String
-
getter/setter pair
- renderer → WebGLRenderer
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- session ↔ XRSession?
-
getter/setter pair
- xrFrame ↔ XRFrame?
-
getter/setter pair
Methods
-
addEventListener(
String type, Function listener) → void -
type
- The type of event to listen to.inherited -
clearListeners(
) → void -
Remove all Listeners.
inherited
-
dispatchEvent(
Event event) → void -
event
- The event that gets fired.inherited -
dispose(
) → void -
inherited
-
getBaseLayer(
) → dynamic - Returns the current base layer.
-
getBinding(
) → XRWebGLBinding? - Returns the current XR binding.
-
getCamera(
) → ArrayCamera -
Returns an instance of {@link ArrayCamera} which represents the XR camera
of the active XR session. For each view it holds a separate camera object.
override
-
getController(
int index) → WebXRController? -
Returns a group representing the
target ray
space of the XR controller. Use this space for visualizing 3D objects that support the user in pointing tasks like UI interaction. -
getControllerGrip(
int index) → WebXRController? -
Returns a group representing the
grip
space of the XR controller. Use this space for visualizing 3D objects that support the user in pointing tasks like UI interaction. -
getDepthSensingMesh(
) → Mesh? -
Returns the depth sensing mesh.
override
-
getDepthTexture(
) → Texture? - Returns the current depth texture computed via depth sensing.
-
getEnvironmentBlendMode(
) → String? -
Returns the environment blend mode from the current XR session.
override
-
getFoveation(
) → double? - Returns the amount of foveation used by the XR compositor for the projection layer.
-
getFrame(
) → XRFrame? - Returns the current XR frame.
-
getFramebufferScaleFactor(
) → double - Returns the framebuffer scale factor.
-
getHand(
int index) → WebXRController? -
Returns a group representing the
hand
space of the XR controller. Use this space for visualizing 3D objects that support the user in pointing tasks like UI interaction. -
getReferenceSpace(
) → dynamic - Returns the XR reference space.
-
getSession(
) → XRSession? - Returns the current XR session.
-
hasDepthSensing(
) → bool -
Returns
true
if depth sensing is supported.override -
hasEventListener(
String type, Function listener) → bool -
type
- The type of event to listen to.inherited -
init(
) → void -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAnimationFrame(
double time, XRFrame frame) → void -
onInputSourcesChange(
Event event) → void -
onSessionEnd(
) → void -
onSessionEvent(
Event event) → void -
removeEventListener(
String type, Function listener) → void -
type - The type of the listener that gets removed.
inherited
-
setAnimationLoop(
dynamic callback) → void -
override
-
setFoveation(
double value) → void - Sets the foveation value.
-
setFramebufferScaleFactor(
double value) → void - Sets the framebuffer scale factor.
-
setProjectionFromUnion(
Camera camera, Camera cameraL, Camera cameraR) → void - Assumes 2 cameras that are parallel and share an X-axis, and that the cameras' projection and world matrices have already been set. And that near and far planes are identical for both cameras. Visualization of this technique: https://computergraphics.stackexchange.com/a/4765
-
setReferenceSpace(
XRReferenceSpace? space) → void - Sets a custom XR reference space.
-
setReferenceSpaceType(
String value) → void - Returns the reference space type.
-
setSession(
XRSession? value) → Future< void> -
After a XR session has been requested usually with one of the
*Button
modules, it is injected into the renderer with this method. This method triggers the start of the actual XR rendering. -
toString(
) → String -
A string representation of this object.
inherited
-
updateCamera(
Camera camera) → void -
Updates the state of the XR camera. Use this method on app level if you
set cameraAutoUpdate
to
false`. The method requires the non-XR camera of the scene as a parameter. The passed in camera's transformation is automatically adjusted to the position of the XR camera when calling this method.override -
updateUserCamera(
Camera camera, ArrayCamera cameraXR, Object3D? parent) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited