Interface and input

XR

44 symbols, imported from @driftengine/xr.

Explained in XR.

Classes

HandSkeleton
One hand's joints, allocated once and written into every frame.

Interfaces

ControllerState
One controller, as much of it as this engine reads.
EnterXrOptions
EyeView
One eye's matrices and where it draws.
LayerSources
What a caller offers. Whichever of the two it has; both is allowed and neither is not.
XrCompatibleContext
A context that can be asked to become XR compatible: what probeXrSupport looks for on the object it is handed.
XrFrame
XrGamepad
XrHand
XrInputSource
XrJointPose
A joint of a hand, keyed by the twenty-five names the specification fixes.
XrLayer
XrRigidTransform
A pose's transform. Only the matrix is read; the decomposed parts are the runtime's convenience.
XrRun
XrSession
XrSupport
XrSystem
XrView
One eye, or the single view an inline session offers.
XrViewerPose
XrViewport
Where in the layer's texture one eye draws.
XrWebGlLayer

Functions

aimCameraAtEye
Point a camera at one eye.
bestMode
The best mode this support answer allows, or null when none is worth asking for.
buttonPressed
Whether a named button is pressed, false where the device has no such button.
buttonValue
One named button's analogue value, or zero where the device has no such button.
chooseLayer
Build the layer this session and these sources allow.
controllerFor
The first source for a hand, or null. Two sources may share a handedness and rarely do.
enterXr
Ask for a session and set everything up behind it.
eyeViews
Turn a pose's views into eye views, into reused storage.
jointPosition
A joint's position, read out of the flat storage without allocating.
probeXrSupport
Ask, and try the step that lies.
readController
readControllers
Read every input source a session currently reports.
readHand
Read one hand into a skeleton.

Types

EnterXrResult
Handedness
Which hand, as WebXR reports it. none is a source with no handedness, like a gaze pointer.
HandJoint
LayerBackend
XrButton
XrMode
The session modes this package will ask for.

Constants

HAND_JOINTS
Every joint WebXR defines, in the order this engine indexes them.
JOINT_COUNT
JOINT_INDEX
The index of a named joint, so a consumer never counts.
XR_BUTTON
The buttons the WebXR gamepad profile fixes, in its order.