This page is not complete.
requestReferenceSpace() method of the
XRSession interface returns a
promise that resolves with
an instance of either
XRBoundedReferenceSpace as appropriate given the type of reference
refSpacePromise = xrSession.requestReferenceSpace(referenceSpaceType);
DOMStringspecifying the type of reference space for which an instance is to be returned. The string must be one of those found in the
The reference space returned by
XRSession.requestReferenceSpace() is either
XRBoundedReferenceSpace. The "Interface" column in the table below indicates which of the two types is returned for each reference space type constant..
The types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them.
||Similar to the
A tracking space whose native origin is located near the viewer's position at the time the session was created. The exact position depends on the underlying platform and implementation. The user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case.
For devices with six degrees of freedom (6DoF) tracking, the
||Similar to the
||A tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. The viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need.||
||A tracking space whose native origin tracks the viewer's position and orientation. This is used for environments in which the user can physically move around, and is supported by all instances of
Rather than throwing true exceptions,
requestReferenceSpace() rejects the
returned promise with a
DOMException whose name is found in the list
- The requested reference space is not supported.
WebXR Device API
The definition of 'requestReferenceSpace()' in that specification.
|Working Draft||Initial definition.|
BCD tables only load in the browser