diff options
author | Bastiaan Olij <mux213@gmail.com> | 2022-11-06 22:16:25 +1100 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2022-11-06 22:19:44 +1100 |
commit | 23e0afec1ddd78bde2b528ea480e71664c1ef713 (patch) | |
tree | 0b52c62f61ae8a57af53fb2290448fb1f4c4179d /scene | |
parent | 9580769e9a8e9542e651859d61452a13cf1eb398 (diff) |
Update XRServer with starting position of (new) current XROrigin3D
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/xr_nodes.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/3d/xr_nodes.cpp b/scene/3d/xr_nodes.cpp index f5d30c584f..ca7d1dfc1d 100644 --- a/scene/3d/xr_nodes.cpp +++ b/scene/3d/xr_nodes.cpp @@ -644,6 +644,12 @@ void XROrigin3D::set_current(bool p_enabled) { origin_nodes[i]->set_current(false); } } + + // update XRServer with our current position + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL(xr_server); + + xr_server->set_world_origin(get_global_transform()); } else { bool found = false; // We no longer have a current origin so find the first one we can make current |