Skip to main content

Interface: InputSourceSnapshot

Defined in: source.ts:34

One live input source, engine-normalised and sampled once per update. Fields the provider cannot supply are simply absent - consumers gate on InputCapabilities, not on per-frame presence checks.

Ownership: a snapshot, and every tuple inside it, belongs to whoever sample() handed it to. A provider builds fresh objects on each call and never writes to a snapshot it has already returned, so a consumer may keep one across frames - the interaction runtime's velocity tracker keeps last frame's grip pose, a drag keeps its press-time ray - without copying. A provider that pools objects must therefore copy on hand-over rather than refill in place. The conformance suite checks this rule.

Properties

PropertyTypeDescriptionDefined in
angularVelocity?Vec3TupleGrip angular velocity as a rotation axis scaled by radians per second. Present on the same terms as InputSourceSnapshot.linearVelocity.source.ts:62
gripPose?PoseTupleGrip/palm pose.source.ts:49
handednessHandedness-source.ts:45
hapticsAvailable?booleanHaptics available on this source.source.ts:70
idstringStable per session (e.g. "left-hand", "right-controller", "mouse"). Opaque to consumers. The format is NOT part of this contract, so never parse it - reading a side out of it with something like id.startsWith("left") breaks the moment a provider changes its naming. Read InputSourceSnapshot.handedness for the side instead.source.ts:43
indexTip?Vec3TupleIndex fingertip world position (poke, hand-driven behaviours).source.ts:51
kindInputSourceKind-source.ts:44
linearVelocity?Vec3TupleGrip linear velocity in metres per second, world space. Present when the provider supplies it natively or a consumer derived it from consecutive gripPose samples (see velocityBetween).source.ts:57
nativeGrabbing?booleanTrue while the engine reports this source natively grabbing something.source.ts:68
ray?RayTuplePointing ray (targetRaySpace, hand ray, gaze ray or projected 2D pointer).source.ts:47
selectnumberPrimary select action 0..1 (trigger, pinch strength, mouse button).source.ts:64
squeezenumberSecondary squeeze action 0..1 (grip button).source.ts:66