Secure contextThis feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Draft This page is not complete.
A WebXR Device API XRFrame
object is passed into the requestAnimationFrame()
callback function and provides access to the information needed in order to render a single frame of animation for an XRSession
describing a VR or AR sccene. Events which communicate the tracking state of objects also provide an XRFrame
reference as part of their structure.
In addition to providing a reference to the XRSession
for which this frame is to be rendered, the getViewerPose()
method is provided to obtain the XRViewerPose
describing the viewer's position and orientation in space, and getPose()
can be used to create an XRPose
describing the relative position of one XRSpace
relative to another.
Properties
session
Read only- The
XRSession
that for which thisXRFrame
describes the tracking details for all objects. The information about a specific object can be obtained by calling one of the methods on the object.
Methods
getPose()
- Returns an
XRPose
object representing the spatial relationship between the two specifiedXRSpace
objects. getViewerPose()
- Returns an
XRViewerPose
describing the viewer's position and orientation in a givenXRReferenceSpace
.
Specifications
Specification | Status | Comment |
---|---|---|
WebXR Device APIThe definition of 'XRFrame' in that specification. | Working Draft | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
Full support 79 |
Edge
Full support 79 |
Firefox
No support No |
IE
No support No |
Opera
No support No |
Safari
No support No |
WebView Android
No support No |
Chrome Android
Full support 79 |
Firefox Android
No support No |
Opera Android
No support No |
Safari iOS
No support No |
Samsung Internet Android
Full support 11.2 |
Chrome
Full support 79 |
Edge
Full support 79 |
Firefox
No support No |
IE
No support No |
Opera
No support No |
Safari
No support No |
WebView Android
No support No |
Chrome Android
Full support 79 |
Firefox Android
No support No |
Opera Android
No support No |
Safari iOS
No support No |
Samsung Internet Android
Full support 11.2 | |
Chrome
Full support 79 |
Edge
Full support 79 |
Firefox
No support No |
IE
No support No |
Opera
No support No |
Safari
No support No |
WebView Android
No support No |
Chrome Android
Full support 79 |
Firefox Android
No support No |
Opera Android
No support No |
Safari iOS
No support No |
Samsung Internet Android
Full support 11.2 | |
Chrome
Full support 79 |
Edge
Full support 79 |
Firefox
No support No |
IE
No support No |
Opera
No support No |
Safari
No support No |
WebView Android
No support No |
Chrome Android
Full support 79 |
Firefox Android
No support No |
Opera Android
No support No |
Safari iOS
No support No |
Samsung Internet Android
Full support 11.2 |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
See also
XRFrame by Mozilla Contributors is licensed under CC-BY-SA 2.5.