XRQuadLayer
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
TheXRQuadLayer interface of theWebXR Device API is a layer that takes up a flat rectangular space in the virtual environment. AnXRQuadLayer has no thickness. It is a two-dimensional object positioned and oriented in 3D space. The position of a quad refers to the center of the quad. Only the front of the layer is visible.
XRQuadLayer requires thelayers feature to be enabled for theXRSession. You can request it inXRSystem.requestSession().
To create a newXRQuadLayer, call either:
XRWebGLBinding.createQuadLayer()for a WebGL opaque texture quad layer, orXRMediaBinding.createQuadLayer()for an HTML<video>playback quad layer.
To present layers to the XR device, add them to thelayers render state usingXRSession.updateRenderState().
In this article
Instance properties
Inherits properties from its parent,XRCompositionLayer.
XRQuadLayer.heightExperimentalRepresents the height of the layer in meters.
XRQuadLayer.spaceExperimentalAn
XRSpacerepresenting the layer's spatial relationship with the user's physical environment.XRQuadLayer.transformExperimentalAn
XRRigidTransformrepresenting the offset and orientation relative tospace.XRQuadLayer.widthExperimentalRepresents the width of the layer in meters.
Instance methods
Inherits methods from its parents,XRCompositionLayer andEventTarget.
Events
redrawExperimentalSent to the
XRQuadLayerobject when the underlying resources of the layer are lost or when the XR Compositor can no longer reproject the layer. If this event is sent, authors should redraw the content of the layer in the next XR animation frame.
Specifications
| Specification |
|---|
| WebXR Layers API Level 1> # xrquadlayertype> |