aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.69k stars 3.98k forks source link

Dynamic switch between controller and hand models? #5373

Closed floe closed 1 year ago

floe commented 1 year ago

Description:

I've noticed that on a Meta Quest, both with Wolvic and the built-in browser, I always get the controller models shown for any laser-controls, even if I'm using direct hand tracking. Is there a way to switch to hand models, or is that information not actually reported by the hand tracking API?

floe commented 1 year ago

(I know the Quest 1 is fairly old, but the same thing also happens on Quest 2.)

Splizard commented 1 year ago

On Quest 3, I get white spheres.

vincentfretin commented 1 year ago

You need an aframe master build to have the Quest 3 models.

laser-controls is only to show controllers. You need to use hand-tracking-controls component if you want to show hands. There is no dynamic switching between controllers and hands with the default aframe components as far as I am aware.

For dynamic switching, the handy-controls component from https://github.com/AdaRoseCannon/handy-work used in https://github.com/AdaRoseCannon/aframe-xr-boilerplate does it.

dmarcos commented 1 year ago

If you add both laser-controls and hand-tracking-controls to an entity it should switch to the one available. Let me know if that works for you

<a-entity laser-controls="hand: left" hand-tracking-controls="hand: left"></a-entity>

Links to master builds are on the commits. Copying below the latest for convenience.

https://cdn.jsdelivr.net/gh/aframevr/aframe@06449ac795892cd7bd7f189d0b94ed2bf9fe43a4/dist/aframe-master.min.js

dmarcos commented 1 year ago

We could also have a component that support both simultaneously but would have to find an interaction model that is common denominator. Gaze+click (Vision Pro approach) as in this demo I wrote could make sense:

https://glitch.com/~aframe-spatial-ui

Let me know what you think

floe commented 1 year ago

If you add both laser-controls and hand-tracking-controls to an entity it should switch to the one available. Let me know if that works for you

Tried the following in my code:

<a-entity laser-controls="hand: left"  hand-tracking-controls="hand: left"  raycaster="objects: #table2"></a-entity>
<a-entity laser-controls="hand: right" hand-tracking-controls="hand: right" raycaster="objects: #table2"></a-entity>

... but I still get only the controller models, even while hand tracking is active. Did try with both 1.4.2 and the master build you linked:

https://cdn.jsdelivr.net/gh/aframevr/aframe@06449ac795892cd7bd7f189d0b94ed2bf9fe43a4/dist/aframe-master.min.js

As mentioned, I'm mostly testing on Wolvic ATM, as the Oculus browser had some ugly WebRTC streaming bugs I couldn't work around. I'll be able to test with the newer browser on the Quest 2 in a few days.

dmarcos commented 1 year ago

Thanks for the patience. This should be now fixed on master. Builds can be found in the commit messages

Can you verify it works as expected in this demo? Thanks so much.