playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.31k stars 1.32k forks source link

WebXR direct hand input #6191

Open Maksims opened 3 months ago

Maksims commented 3 months ago

Currently, the engine supports WebXR input interactions with UI using a ray provided by input sources. With hands - it is possible to implement direct touch using the tip of a finger (or multiple fingers).

There are some UX considerations, as even different platforms implement direct touch slightly differently.

IRobot1 commented 3 months ago

The usual approach is to attach a collision object to the tip of the fingers. See xr-hand for fingers and tips

Maksims commented 3 months ago

The usual approach is to attach a collision object to the tip of the fingers. See xr-hand for fingers and tips

Using collision would not be a generic solution, as it would require a physics included. Also UI does not have physics information. It should be analytical, using rays like input source ray does, with slight modifications.