feat(client): add per-posture player height offset setting (#1121)

This commit is contained in:
moi952
2026-09-29 23:21:55 +02:00
committed by GitHub
parent a083901bdc
commit 85f6cb0bd9
8 changed files with 149 additions and 9 deletions
+8 -1
View File
@@ -946,7 +946,14 @@ void scenes::lobby::render(const XrFrameState & frame_state)
renderdoc_begin(*vk_instance);
#endif
XrSpace world_space = application::space(xr::spaces::world);
// Locating everything against this instead of the raw world space lets the configured
// player height offset be previewed here, the same shift a stream would apply.
if (float offset = application::get_config().get_height_offset(); not height_offset_space or offset != applied_height_offset)
{
applied_height_offset = offset;
height_offset_space = session.create_reference_space(XR_REFERENCE_SPACE_TYPE_STAGE, {{0, 0, 0, 1}, {0, -offset, 0}});
}
XrSpace world_space = height_offset_space;
auto [flags, views] = session.locate_views(viewconfig, frame_state.predictedDisplayTime, world_space);
// assert(views.size() == swapchains_lobby.size());
assert(views.size() == 2); // FIXME