This page is not complete.
requestReferenceSpace() method of the
XRSession interface returns a
Promise that resolves with either an instance of
XRReferenceSpace or of
XRBoundedReferenceSpace which contains information about the current session tracking behavior.
var promise = XRSession.requestReferenceSpace(type);
- Specifies the desired type of
XRReferenceSpace. Valid values are:
"viewer": Creates an
XRReferenceSpacetracking space with a native origin that tracks the position and orientation of the viewer. Every
XRSessionobject supports this type.
"local": Creates an
XRReferenceSpacetracking space with a native origin that tracks the approximate location of the viewer's head at the time of creation where the user is expected to move very little or not at all.. The exact position and orientation are based on the conventions of the underlying platform.
"local-floor": Creates an
XRReferenceSpacetracking space with a native origin at the floor where the user is expected to move very little or not at all. For this type, the y axis will be 0 at floor level. The position and orientation of the x and z axes will be based on the conventions of the the unerlying platform. If the floor level isn't known, it will be estimated. If the floor level isn't known, it will be estimated with rounded values to prevent fingerprinting.
"bounded-floor": Creates an
XRBoundedReferenceSpacetracking space with a native origin at the floor where the user is expected to move within a pre-established boundary, which may be retrieved with
"unbounded": Creates an
XRReferenceSpacetracking space where the user is expected to move freely around their environment, pontentially even long distances from their starting point. Because tracking is optimized for stability around the user's current position, the native orign may drift.
- thrown when the requested reference space type is not supported.
|WebXR Device API
The definition of 'requestReferenceSpace' in that specification.
|Working Draft||Initial definition.|
|Chrome No support No||Edge No support No||Firefox No support No||IE No support No||Opera No support No||Safari No support No||WebView Android No support No||Chrome Android No support No||Firefox Android No support No||Opera Android No support No||Safari iOS No support No||Samsung Internet Android No support No|
- No support
- No support