NeoSpark314 / godot_oculus_quest_toolkit

An easy to use VR toolkit for Oculus Quest development using the Godot game engine
MIT License
372 stars 39 forks source link

Freeze and fade hands when tracking confidence is lost #62

Open goatchurchprime opened 3 years ago

goatchurchprime commented 3 years ago

This is the feature exhibited in the System area of the Quest when you have hand-tracking.

Any time the confidence is below 1 the hand stops moving and fades away nicely.

Although you can use hands with confidence between 0 and 1 there's a tendency for them to dance around and not give a very good experience.

By taking the view of the hands away when the tracking is less than excellent the player can easily be trained to keep their hands apart and visible to the cameras, and thus operate the hand controls much more reliably and with less frustration. This is a good thing.

I implemented this feature in my app here: https://github.com/goatchurchprime/tunnelvr/blob/master/HandScript.gd#L153

One thing that makes it more complicated in the OQ_toolkit than in my system is that the hand meshes are under the transform nodes of the ARVRControllers instead of being in a separate node under the ARVROrigin. This means that the to keep them stationary during the fade-out (much less distracting to see than when they jump about), we're going to have to undo the controller transform.

You had to do exactly this on this line with the vr.ovrBaseAPI.get_pointer_pose(), which is given relative to the Origin, not the Controller. https://github.com/NeoSpark314/godot_oculus_quest_toolkit/blob/master/OQ_Toolkit/OQ_ARVRController/scripts/Feature_UIRayCast.gd#L31 I took this as a cue that the pointer didn't belong under the Controller node and was something independent.

It would also be nice to get the transparent glass effect you get with the hands in the System area of the Quest, but that's something much more complicated than simply assigning a translucent material.