XRReferenceSpaceEventInit

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

XRReferenceSpaceEventInit dictionary is used when calling the XRReferenceSpaceEvent() constructor to provide the values for its properties. Since the properties are read-only, this is the only opportunity available to set their values.

You will not usually need to use this, since these events are created by the WebXR infrastructure.

特性

referenceSpace
XRReferenceSpace from which the event originated.
transform
An XRRigidTransform which maps the old coordinate system (from before the changes indicated by this event) to the new coordiante system.

Usage notes

All of this dictionary's properties must have valid values set on them before calling the XRReferenceSpaceEvent() 构造函数。

范例

This simple snippet calls the constructor to create a new reference space event of type reset .

let refSpaceEvent = new XRReferenceSpaceEvent("reset", {
      referenceSpace: myRefSpace,
      transform: myTransform
});
					

规范

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

浏览器兼容性

No compatibility data found. Please contribute data for "api.XRReferenceSpaceEventInit" (depth: 1) to the MDN 兼容性数据存储库 .