大网数据广告活动
Web 标准与前端开发

XRSpace

· 52CE 我爱测

The **`XRSpace`** interface of the WebXR Device 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 exp

WebXR Device API

The XRSpace interface of the WebXR Device 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.

[!NOTE] The 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, XRBoundedReferenceSpace, and XRJointSpace.

Interfaces based on XRSpace

Below is a list of interfaces based on the XRSpace interface.

  • XRBoundedReferenceSpace
    • : 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.
  • XRReferenceSpace
    • : 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.
  • XRJointSpace
    • : Represents the space of an XRHand joint.

Instance properties

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

Instance methods

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

Specifications

Browser compatibility

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。