XRReferenceSpaceEventInit.referenceSpace

Secure context

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

The XRReferenceSpaceEventInit property referenceSpace is used to establish the value of a newly-constructed XRReferenceSpaceEvent object when calling the XRReferenceSpaceEvent() constructor.

Syntax

let eventInitDict = {
  referenceSpace: xrReferenceSpace,
  transform: xrRigidTransform
});

Value

An XRReferenceSpace indicating the source of the event.

Examples

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
});

Specifications

Specification Status Comment
WebXR Device API
The definition of 'XRReferenceSpaceEventInit.referenceSpace' in that specification.
Working Draft Initial definition.

Browser compatibility

No compatibility data found for api.XRReferenceSpaceEventInit.referenceSpace.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.