TypologySienna Chen
InputLightweight

XR controllers

Headset controllers and hands as input.

The handheld controllers and tracked hands inside a VR headset: point, grab, press, feel a buzz. Every interaction needs a version for controllers and one for bare hands. Impossible to test without the headset.

Breaks when
needs hardware to test at all
Also called
XRControllerModel, hand input, immersive input

Prompts

Point and select in VR
Three.js WebXR: for each controller, a ray (Line) from renderer.xr.getController(i), a raycast on selectstart against interactive meshes, hover highlight while the ray touches, and a 40 ms haptic pulse (gamepad.hapticActuators[0].pulse(0.6, 40)) on hit. Show the controller models via XRControllerModelFactory. Desktop fallback: the mouse acts as the right controller.
Grab and throw
Grab an object with squeezestart when the grip is within 0.08 m of it (parent the object to the grip), release on squeezeend with the velocity estimated from the last 5 frames, then hand it to Rapier as a dynamic body. Explain reparenting while preserving world transforms (attach vs add).
Hands without controllers
Support WebXR hand tracking with OculusHandModel and pinch detection (index tip to thumb tip under 0.02 m) as the select event, with the same interactive surface as the controller path. Show a UI panel in space (HTML rendered to a texture) that both inputs can press.

Related

Resources · 2