XRVisibilityMaskChangeEvent: XRVisibilityMaskChangeEvent() constructor

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

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The XRVisibilityMaskChangeEvent() constructor creates and returns a new XRVisibilityMaskChangeEvent object.

Syntax

js
new XRVisibilityMaskChangeEvent(type, options)

Parameters

type

A string containing the name of the event, which is always visibilitymaskchange.

options

An object that, in addition of the properties defined in Event(), can have the following properties:

eye

The eye the mask applies to.

index

The index of the current XRView in the XRViewerPose.views array.

indices

A Uint32Array of values specifying the index position of each coordinate pair (not individual array index) inside the vertices array that define the triangles used to draw the currently visible part of the scene displayed in the XRView.

session

The XRSession to which the event belongs.

vertices

A Float32Array of coordinates representing the set of possible coordinate values that may be used in a visibility mask. If this array is empty, the whole region of the XRView will be drawn.

Return value

A new XRVisibilityMaskChangeEvent object instance.

Examples

See the main XRVisibilityMaskChangeEvent page for an example.

Specifications

Specification
WebXR Device API
# dom-xrvisibilitymaskchangeevent-xrvisibilitymaskchangeevent

Browser compatibility