API Reference

Class List

XrPlaneDetection

Plane Detection provides the ability to detect real world surfaces based on estimations of the underlying AR system.

// start session with plane detection enabled
app.xr.start(camera, pc.XRTYPE_VR, pc.XRSPACE_LOCALFLOOR, {
    planeDetection: true
});
app.xr.planeDetection.on('add', function (plane) {
    // new plane been added
});

Summary

Properties

available

True if Plane Detection is available.

planes

Array of XrPlane instances that contain individual plane information, or null if plane detection is not available.

supported

True if Plane Detection is supported.

Events

add

Fired when new XrPlane is added to the list.

available

Fired when plane detection becomes available.

remove

Fired when a XrPlane is removed from the list.

unavailable

Fired when plane detection becomes unavailable.

Details

Constructor

XrPlaneDetection(manager)

Plane Detection provides the ability to detect real world surfaces based on estimations of the underlying AR system.

// start session with plane detection enabled
app.xr.start(camera, pc.XRTYPE_VR, pc.XRSPACE_LOCALFLOOR, {
    planeDetection: true
});
app.xr.planeDetection.on('add', function (plane) {
    // new plane been added
});

Parameters

managerXrManager

WebXR Manager.

Properties

booleanavailable

True if Plane Detection is available. This property can be set to true only during a running session.

XrPlane[], nullplanes

Array of XrPlane instances that contain individual plane information, or null if plane detection is not available.

booleansupported

True if Plane Detection is supported.

Events

add

Fired when new XrPlane is added to the list.

app.xr.planeDetection.on('add', function (plane) {
    // new plane is added
});

Parameters

planeXrPlane

Plane that has been added.

available

Fired when plane detection becomes available.

remove

Fired when a XrPlane is removed from the list.

app.xr.planeDetection.on('remove', function (plane) {
    // new plane is removed
});

Parameters

planeXrPlane

Plane that has been removed.

unavailable

Fired when plane detection becomes unavailable.