Configuration Interfaces
XRDeviceConfig
name: string
The name of the XR device.controllerConfig: XRControllerConfig | undefined
Configuration for the device's controllers. It isundefinedif no controllers are used.supportedSessionModes: XRSessionMode[]
Session modes the device supports (e.g.,inline,immersive-vr,immersive-ar).supportedFeatures: WebXRFeatures[]
Features supported by the device, such ashand-tracking,hit-test, etc.supportedFrameRates: number[]
Frame rates supported by the device for rendering.isSystemKeyboardSupported: boolean
Indicates if system keyboard input is supported.internalNominalFrameRate: number
The device's nominal internal frame rate.visibilityMask: XRVisibilityMask? Optional per-eye angular bounds used to obscure content outside a narrower headset field of view. Supplyleftandrighteye objects; each contains positiveangleLeft,angleRight,angleUp, andangleDownvalues in radians.
XRDeviceOptions
ipd: number
Interpupillary distance in meters, affecting stereo rendering.fovy: number
Field of view on the Y-axis in radians.stereoEnabled: boolean
Enables or disables stereo rendering.headsetPosition: Vector3
The initial position of the headset in 3D space.headsetQuaternion: Quaternion
The initial orientation of the headset.canvasContainer: HTMLDivElement
The HTML container for the rendering canvas.visibilityMask: XRVisibilityMask | null Overrides the selected device profile's mask. Passnullto disable it.visibilityMaskEnabled: boolean Controls whether a configured visibility mask starts enabled. It defaults totruewhen mask data exists and remainsfalsefor profiles without mask data.frameClearEnabled: boolean Whether immersive sessions clear the base layer at the start of every frame, as WebXR requires. Defaults totrue. Set it tofalseonly for apps that clear before they draw (three.js does by default) and that sometimes skip drawing on purpose; seeXRDevice.frameClearEnabled.shouldDrawEnvironment:(() => boolean) | nullCalled once per immersive-ar frame, after the app's frame callbacks; returningfalseskips that frame's synthetic environment draw. Defaults tonull(always drawn); seeXRDevice.shouldDrawEnvironment.
XRControllerConfig
profileId: string
Identifier for the controller profile.fallbackProfileIds: string[]
Identifiers for fallback controller profiles.layout: { [handedness in XRHandedness]?: { gamepad: GamepadConfig; gripOffsetMatrix?: mat4; numHapticActuators: number; } }
Maps handedness to controller configurations, including gamepad layout and optional grip offset.
HandPose
jointTransforms: { [joint in XRHandJoint]: { offsetMatrix: mat4; radius: number; } }
Pose data for each joint in the hand, including transformation matrix and joint radius.gripOffsetMatrix: mat4?
Optional matrix to offset the grip position.
XRHandInputConfig
profileId: string
Identifier for the hand input profile.fallbackProfileIds: string[]
Identifiers for fallback hand input profiles.poses: { default: HandPose; pinch: HandPose; [poseId: string]: HandPose; }
Contains hand pose configurations for default, pinch, and additional customizable poses.pinchThresholds: { press: number; release: number; }?
Pinch levels at which the hand selects and lets go, with0 < release < press <= 1. Defaults toDEFAULT_PINCH_THRESHOLDS(press: 0.9,release: 0.7).