Merge pull request #68321 from BastiaanOlij/xrorigin_start_pos

Update XRServer with starting position of (new) current XROrigin3D
This commit is contained in:
Rémi Verschelde 2022-11-07 08:45:24 +01:00 committed by GitHub
commit c4f3b94abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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