aframevr / aframevr/aframe

Add properties to hand-tracking-controls pinch events to be able to use pinch gesture to move objects

Open
#4,690 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

Description: When using pinching to move objects, knowing which hand is pinching and what the orientation of the hand is in is useful so that the grabbed object can track the appropriate hand's position and rotation changes.

In my custom version of hand-tracking-controls, I have added in two additional properties to the existing event details for each pinch event:

  • hand: a reference to the hand element that initiated the pinch gesture
  • wristOrientation: a THREE.Quaternion version of the the XRHand.WRIST pose transform.orientation property, which seems to be a good proxy for the orientation of the hand as a whole

I could see an argument for using the strings 'left' or 'right' instead of the hand element for the hand parameter. I could see an argument for using the orientation of the index finger or thumb (or some combination of the two) as an orientation for the hand (I haven't tried any but the wrist). What's useful for moving an object is a consistent relative reference frame over time, though, so the specific choice of orientation matters less for this use-case.

Question: If the wrist pose is null, should an event be fired? I currently don't fire if the pose is null.

I can provide a PR once finalized.

  • A-Frame Version: master
  • Platform / Device: Quest
  • Reproducible Code Snippet or URL: Can put together a PR w/ example once decided on

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating hand-tracking-controls and its existing pinch event details, then review the unresolved choices around the hand reference, wrist orientation, and null wrist poses. Done means the event API and null-pose behavior are decided, the requested properties are exposed consistently, and the proposed example or tests demonstrate using pinch gestures to move objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, three.js
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.