XRReferenceSpaceEvent

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

WebXR 设备 API interface XRReferenceSpaceEvent represents an event sent to an XRReferenceSpace . Currently, the only event  that uses this type is the reset 事件。

构造函数

XRReferenceSpaceEvent()
返回新 XRReferenceSpaceEvent with the specified type and configured using the values in the given XRReferenceSpaceEventInit dictionary.

特性

In addition to inheriting the properties available on the parent interface, Event , XRReferenceSpaceEvent objects include the following properties:

referenceSpace 只读
An XRReferenceSpace indicating the reference space that generated the event.
transform 只读
An XRRigidTransform object indicating the position and orientation of the specified referenceSpace 's native origin after the event, defined relative to the coordinate system before the event.

方法

While XRReferenceSpaceEvent does not define any methods, it inherits the methods of its parent interface, Event .

Event types

reset
reset event is sent to a reference space when its native origin is changed due to a discontinuity, recalibration, or device reset. This is an opportunity for your app to update any stored transforms, position/orientation information, or the like—or to dump any cached values based on the reference's space's origin so you can recompute them as needed.

规范

规范 状态 Comment
WebXR 设备 API
The definition of 'XRReferenceSpaceEvent' 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
XRReferenceSpaceEvent 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
XRReferenceSpaceEvent() 构造函数 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
referenceSpace 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
transform 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

图例

完整支持
完整支持
不支持
不支持