aframe icon indicating copy to clipboard operation
aframe copied to clipboard

pinch events return local position, not world position

Open Utopiah opened this issue 3 years ago • 2 comments

Description: The documentation says pinchstarted returns World coordinates but if one parents the camera and hands to a "rig", to e.g teleport, the event will return local coordinates, relative to the "rig" rather than world coordinates.

  • A-Frame Version: 1.3
  • Platform / Device: Quest 2
  • Reproducible Code Snippet or URL: https://fabien.benetou.fr/pub/home/future_of_text_demo/engine/

Utopiah avatar Dec 10 '22 17:12 Utopiah

How to test :

display event.detail.position from pinchstarted with and without a parent to hands, the result will be the same whereas it "should", at least according to my understand of the documentation, return different results if the parent entity has a position different from the origin.

Utopiah avatar Dec 10 '22 17:12 Utopiah

The position passed through the event is just the one reported through the hand tracking API and based on the reference space parameter

https://github.com/aframevr/aframe/blob/master/src/components/hand-tracking-controls.js#L246

It make sense to me to change probably the doc to mention they are in the local reference space of the player. But not 100% sure.

dmarcos avatar Dec 13 '22 16:12 dmarcos