XR · function

chooseLayer

Build the layer this session and these sources allow.

Explained in XR.

function chooseLayer(session: XrSession, sources: LayerSources): XrLayer
import { chooseLayer } from '@driftengine/xr';

Parameters

ParameterTypeDescription
sessionXrSession
sourcesLayerSources

In depth

Never throws. It is called at the moment a session starts, which is a moment a consumer is showing a user something, and AGENTS.md's rule about not throwing in a frame loop is the same rule one step earlier: a session that cannot draw should say so and leave the page alive.