Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers .

XRSpace interface of the WebXR 设备 API is an abstract interface providing a common basis for every class which represents a virtual coordinate system within the virtual world, in which its origin corresponds to a physical location. Spatial data in WebXR is always expressed relative to an object based upon one of the descendant interfaces of XRSpace , at the time at which a given XRFrame takes place.

Numeric values such as pose positions are thus coordinates in the corresponding XRSpace , relative to that space's origin.

注意: XRSpace interface is never used directly; instead, all spaces are created using one of the interfaces based on XRSpace . At this time, those are XRReferenceSpace and XRBoundedReferenceSpace .

Interfaces based on XRSpace

Below is a list of interfaces based on the XRSpace 接口。

Represents a reference space which may move within a region of space whose borders are defined by an array of points laid out in clockwise order along the floor to define the passable region of the space. The origin of an XRBoundedReferenceSpace is always at floor level, with its X and Z coordinates typically defaulting to a location near the room's center.
Represents a reference space which is typically expected to remain static for the duration of the XRSession . While objects may move within the space, the space itself remains fixed in place. There are exceptions to this static nature; most commonly, an XRReferenceSpace may move in order to adjust based on reconfiguration of the user's headset or other motion-sensitive device.


XRSpace interface defines no properties of its own; however, it does inherit the properties of its parent interface, EventTarget .


XRSpace interface provides no methods of its own. However, it inherits the methods of EventTarget , its parent interface.


规范 状态 Comment
WebXR 设备 API
The definition of 'XRSpace' in that specification.
工作草案 初始定义。


更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
XRSpace Chrome 79 Edge 79 Firefox No IE No Opera No Safari No WebView Android No Chrome Android 79 Firefox Android No Opera Android No Safari iOS No Samsung Internet Android 11.2