XRPose

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 in secure contexts (HTTPS), in some or all supporting browsers.

XRPose is a WebXR API interface representing a position and orientation in the 3D space, relative to the XRSpace within which it resides. The XRSpace—which is either an XRReferenceSpace or an XRBoundedReferenceSpace—defines the coordinate system used for the pose and, in the case of an XRViewerPose, its underlying views.

To obtain the XRPose for the XRSpace used as the local coordinate system of an object, call XRFrame.getPose(), specifying that local XRSpace and the space to which you wish to convert:

js
thePose = xrFrame.getPose(localSpace, baseSpace);

The pose for a viewer (or camera) is represented by the XRViewerPose subclass of XRPose. This is obtained using XRFrame.getViewerPose() instead of getPose(), specifying a reference space which has been adjusted to position and orient the node to provide the desired viewing position and angle:

js
viewerPose = xrFrame.getViewerPose(adjReferenceSpace);

Here, adjReferenceSpace is a reference space which has been updated using the base frame of reference for the frame and any adjustments needed to position the viewer based on movement or rotation which is being supplied from a source other than the XR device, such as keyboard or mouse inputs.

See the article Movement, orientation, and motion for further details and an example with thorough explanations of what's going on.

Instance properties

XRPose.angularVelocity Read only

A DOMPointReadOnly describing the angular velocity in radians per second relative to the base XRSpace.

XRPose.emulatedPosition Read only

A Boolean value which is false if the position and orientation given by transform is obtained directly from a full six degree of freedom (6DoF) XR device (that is, a device which tracks not only the pitch, yaw, and roll of the head but also the forward, backward, and side-to-side motion of the viewer). If any component of the transform is computed or created artificially (such as by using mouse or keyboard controls to move through space), this value is instead true, indicating that the transform is in part emulated in software.

XRPose.linearVelocity Read only

A DOMPointReadOnly describing the linear velocity in meters per second relative to the base XRSpace.

XRPose.transform Read only

A XRRigidTransform which provides the position and orientation of the pose relative to the base XRSpace.

Specifications

Specification
WebXR Device API
# xrpose-interface

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
XRPose
Chrome – Full support
Chrome 79 (Release date: 2019-12-10)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 66 (Release date: 2020-01-07)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 79 (Release date: 2019-12-17)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 11.2 (Release date: 2020-03-22)
footnote Full support
WebView Android – No support
WebView Android
footnote
footnote See bug 40652382
WebView on iOS – No support
WebView on iOS
footnote No support
angularVelocity
Chrome – No support
Chrome
footnote
footnote See bug 40762775
Edge – No support
Edge
footnote
footnote See bug 40762775
Firefox – No support
Firefox
footnote No support
Opera – No support
Opera
footnote
footnote See bug 40762775
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote
footnote See bug 40762775
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote
footnote See bug 40762775
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote
footnote See bug 40762775
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
emulatedPosition
Chrome – Full support
Chrome 79 (Release date: 2019-12-10)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 66 (Release date: 2020-01-07)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 79 (Release date: 2019-12-17)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 11.2 (Release date: 2020-03-22)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
linearVelocity
Chrome – No support
Chrome
footnote
footnote See bug 40762775
Edge – No support
Edge
footnote
footnote See bug 40762775
Firefox – No support
Firefox
footnote No support
Opera – No support
Opera
footnote
footnote See bug 40762775
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote
footnote See bug 40762775
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote
footnote See bug 40762775
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote
footnote See bug 40762775
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
transform
Chrome – Full support
Chrome 79 (Release date: 2019-12-10)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 66 (Release date: 2020-01-07)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 79 (Release date: 2019-12-17)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 11.2 (Release date: 2020-03-22)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

See also