GodotVR / godot_openvr_fps

Repository for the OpenVR starter tutorial
MIT License
42 stars 10 forks source link

VR tutorial cleanup and code refactor #3

Closed TwistedTwigleg closed 4 years ago

TwistedTwigleg commented 5 years ago

This PR contains a number of changes I made to the project after getting it working with Godot 3.1.

Most of the changes are just code refactors that make the code a little cleaner and easier to understand. I also fixed a few bugs in the project and added some (minor) additional features.

Changes:

I think the list above contains most, if not all, of the changes. I made most of the initial changes late at night, so I may have missed a few. Also, some of the changes are made by Godot when opening the TSCN files.

If there are other small additional things anyone can think of, please let me know either by commenting in this PR and/or by making a GitHub issue. I'll update this post as additional changes are made

TwistedTwigleg commented 5 years ago

Okay! Now all that is left is updating the tutorial on the Godot documentation repository. Once that is done and this PR is merged, the VR starter tutorial is fully ready and updated for Godot 3.1. I haven't kept up as much with the development of Godot 3.2, but I think the VR tutorial should be compatible so long as nothing major has changed.

Right now I'm leaving the PR in case I bugs are found and/or I need to make minor changes as I update the tutorial.

BastiaanOlij commented 4 years ago

Sorry for the late reply, finally got some time to play around with this. It all works on my index for the most part :)

Understandably with the Vive you have a grab action and drop action, but with both the index knuckles and oculus touch controllers I would add an option so you need to keep the button pressed to hold an object.

I also found that I had to have my hands on an object to grab it instead of being in range. A more physical interaction but not always handy if you lack full roomscale tracking.

But looks like all your changes work fine. I need to play more and start seeing what I can tweak/improve :)

I'm going to see if I can make this work on the quest this week :)

BastiaanOlij commented 4 years ago

ps, I'm happy to merge this and will do separate PRs as we improve things, that way we can match the PRs with any changes in documentation.

TwistedTwigleg commented 4 years ago

No problem, thanks for looking through it! As for the changes, I agree that keeping the button held for grabbing would be a good idea for controllers that have more natural grabbing buttons.

For the Windows Mixed Reality controllers, which is what I use, in my opinion having grabbing where you do not need to hold the button makes it easier. I don't know for the other VR controllers out there, but I think it would probably be best to make the default grab behavior more like a toggle, where you can change it (somehow) to be where objects are only held when the grab button is held.

As far as having to have your hands on an object to grab it, that is the default grab mode. You can change the grab mode to use a Raycast by pressing the menu button on the VR controller, which makes it easier to grab objects when you lack full roomscale tracking. That said, the Raycast is rather short, so that still might be an issue.

Thanks again for looking through it! I'll merge this PR in and when the project is good to go, I'll update the PR for the Godot documentation to reflect any changes made to the VR project.