NeoSpark314 / godot_oculus_quest_toolkit

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

Fade hands when tracking confidence is lost #63

Closed goatchurchprime closed 3 years ago

goatchurchprime commented 3 years ago

This concerns https://github.com/NeoSpark314/godot_oculus_quest_toolkit/issues/62

This stops the rubbery feel of the hand tracking when they get in the way of each other and they jump about. Give it a try.

Fading is important to show exactly what is happening. If the hand instantly disappears you don't know if it has hopped to somewhere you're not looking.

I had problems reading the materials because handmeshnode.get_surface_material(0) wasn't working from this glb file.

(I may have messed up with git as well, but I'm trying to do it with branches, which is supposed to be a better way, though I can't explain the duplicate unnecessary commits here that don't do anything)

NeoSpark314 commented 3 years ago

This is nice. I just played around with the branch and it looks great. Any specific changes you want to make to this PR before we merge it?

goatchurchprime commented 3 years ago

You could merge it and hack it about afterwards.

I'd like to remove the parameters from _update_hand_model() that are class members anyway.

Can you find a better way to access the material in those hands meshes than that hack I used?

NeoSpark314 commented 3 years ago

It works nicely; I think we can merge; I can have a look into the material access; I remember I had a similar situation some time ago; I will dig through my code. I can also do the cleanup then.

Firepal commented 3 years ago

The GLTF importer generates materials onto its appropriate "surface" in an ArrayMesh resource, not the MeshInstance material slot. You can get the hand model's Mesh resource and call surface_get_material(0) to get the hand's material.

Assuming handmeshnode in the code is a MeshInstance node, this would be handmeshnode.mesh.surface_get_material(0)