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

Adds Quest 2 Controller Model #65

Closed hankedan000 closed 3 years ago

hankedan000 commented 3 years ago

I added a controller model for the Quest 2 controller.

Here's a demonstration video of the changes. As you can see in the video, I have a Quest 2 device and the controller models line up pretty well against the real world devices. https://user-images.githubusercontent.com/216870/113954794-88e75180-97e8-11eb-8df5-f3e8d9e3269e.mp4

The ARVR_Controller script will load the correct model based on the provide device type from the Oculus API.

You can also override the model by programatically changing the controller_model_type var on the ARVR_Controller. I've added a drop down to the demo scene that exercises this feature.

Since the controller_model_type is an exported variable, you can also set the model type from the editor too. I'm not sure if anyone would do that, but it's available! image

Note: I discovered that the Oculus API calls will default the device_type to Quest 1 unless you export from Godot using a "custom build" that adds the necessary metadata fields to the AndroidManifest.

NeoSpark314 commented 3 years ago

Nice work! Thanks also for the video. This really helps to assess the PR since I do not have a Quest 2 myself. Regarding the custom build. I will update the export template in the repository to contain a manifest that has quest 2 enabled. This should make it work hopefully out of the box again also for quest 2. Would be great if you can test it when I have done it. We also have a discord server to discuss toolkit stuff here: https://discord.gg/JtTpFk9852; if you want you can join

goatchurchprime commented 3 years ago

These GLTF models are more than 1000 times larger in bytes than the originals.
OculusQuestTouchController_Right.gltf is 3kb and OculusQuest2TouchController_Right.gltf is 5.3Mb
Is there a reason for this?

I'm using the reactive controllers and made them look a little like the Quest2 by simply inverting the OculusQuestTouchControllerTexture_Color.png image, which is a quick hack. For a while I've been mapping controller buttons to hand gestures, but there's a problem: noobs can never seem to find the two buttons (grip and trigger) on the controllers, so I've got to quickly test whether rendering the controllers in VR with the two buttons will help them.

NeoSpark314 commented 3 years ago

The Quest2 controller models seem to have the geometry embedded as base64 while the original models reference the .bin file for geometry which is still much smaller than the quest2 controller gltf but; I think this explains the size difference.

goatchurchprime commented 3 years ago

Also seems difficult to make a reactive version for the trigger because all the MeshInstances refer to the global origin, so you can't easily rotate it around its proper pivot point.