Add properties to hand-tracking-controls pinch events to be able to use pinch gesture to move objects
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 gesturewristOrientation: aTHREE.Quaternionversion of the theXRHand.WRISTposetransform.orientationproperty, 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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