Comments (3)
This is a rather annoying problem in the core that we've only discovered recently and still aren't sure why it is happening. The positions of the camera and controller are updated behind the scenes inside their own process functions. Behind the scenes Godot maintains both the local transform of the object (relative to its parent) and the global position of the object (used for rendering).
If the position of the ARVROrigin is changed during _process
but before the controller positions are updated, it seems to be using the old global position of the origin point to determine the new global position of the controller.
I never ran into this myself because I do all repositioning of the ARVROrigin node as a response to controller inputs which are handled in scripts on the controllers and the repositioning is thus applied after the tracking updates the position of the controllers and this delay does not happen and as a result this issue remained undiscovered for years as people based their projects on my code :).
Have a look at https://github.com/GodotVR/godot-xr-tools or the demo project on the OpenVR repo to see how that is put together.
If you do have a reason to have movement logic more central, say you're controlling your character with a gamepad, the easy workaround is just to implement that logic on a node added after the controllers, so:
ARVROrigin
- ARVRCamera
- ARVRController left
- ARVRController right
- ControlNode <-- implement _process here
Your other solution of doing it in _physics_process
is also sound but yes, you have to ensure the update rate of physics is equal or higher than the refresh rate of your HMD. This is good practice anyway especially if your character is attached to a physics controlled entity like driving a car, or you'll get visible stuttering as the cars position isn't updated every rendered frame.
The head tracking is updated right before rendering but this isn't actually a problem because that does work correctly in relation to the origin point, here there is only a problem if you have child node on the ARVRCamera as they are not updated along side it.
This is all solved in Godot 4 where all tracking updates now happen before _physics_process
and _process
even run but this is not a change easily back ported to Godot 3.
The world_scale
issue is also different, here the problem is that there isn't yet a mechanism for directly applying the new tracking transforms as a result to changing the scale. Still working on that one.
from godot_oculus_mobile.
Thanks for the in-depth response. This makes much more sense now.
The workaround is easily applicable to my use-case. Feel free to close this issue as wont-fix
.
Since it was a known issue, is it documented elsewhere? I was surprised to not find anything about it, although I stumbled over it so early.
from godot_oculus_mobile.
There are issues on the main godot issue tracker for this but mostly it just comes up in discussions on Discord from time to time.
Most people either have physics control the player position (driving sims, flight sims), or have the logic on the controllers, so the problem doesn't eventuate. It actually wasn't until a few months back someone was able to provide me with a good example and suddenly the lightbulb went on.
It's a weird issue because it sounds like the way Godot updates the global transforms internally has an issue, I haven't had time yet to really dive into that part of the code yet but I'm guessing it doesn't update the global transforms immediately when you change an objects transform because it can be a very costly exercise when there are many transform updates in a larger tree of objects.
from godot_oculus_mobile.
Related Issues (20)
- The controller positions do not handle world_scale correctly HOT 4
- Using GLES3 causes rendering issues with Blend Keys
- Integrate oculus audio spatializer HOT 11
- Build procedure error HOT 2
- Add use of pointer_pose into the demo HOT 1
- Add Oculus Quest 2 support
- Add support for the Oculus platform keyboard HOT 12
- Mobile Vulkan for Oculus Quest 2 ? HOT 2
- 64bit Android binaries for Oculus Quest ? HOT 3
- VR framework for Godot ? HOT 3
- Head transformation may be invalid
- Cannot download asset from AssetLib HOT 4
- GearVR oculus update required HOT 2
- Controller positions mishandle worldscale in versions since v3.0.1 HOT 2
- Just a friendly reminder that the version in the asset store is still 3.0.1 HOT 8
- ovr_display.get_supported_display_refresh_rates() returns only 60hz and 72hz on Oculus Quest 2 HOT 3
- Export APK works fine, but unable to run in Godot IDE: "No library set for this platform" HOT 1
- Add support for Passthrough API HOT 3
- Meta Quest 2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot_oculus_mobile.