Switch between poke and pointer interaction in lobby

This commit is contained in:
Patrick Nicolas
2025-11-13 21:48:10 +01:00
parent a9907e0810
commit 3e8a78002e
7 changed files with 115 additions and 55 deletions
+13 -6
View File
@@ -397,15 +397,22 @@ static void set_clipping_planes(entt::registry & scene, entt::entity entity, std
}
}
void input_profile::apply(entt::registry & scene, XrSpace world_space, XrTime predicted_display_time, bool hide_left, bool hide_right, std::span<glm::vec4> pointer_limits)
void input_profile::apply(
entt::registry & scene,
XrSpace world_space,
XrTime predicted_display_time,
bool hide_left_controller,
bool hide_left_ray,
bool hide_right_controller,
bool hide_right_ray,
std::span<glm::vec4> pointer_limits)
{
for (auto && [entity, node, space]: scene.view<components::node, bound_space>().each())
{
if ((space.space == xr::spaces::grip_left or space.space == xr::spaces::aim_left) and hide_left)
{
node.visible = false;
}
else if ((space.space == xr::spaces::grip_right or space.space == xr::spaces::aim_right) and hide_right)
if ((space.space == xr::spaces::grip_left and hide_left_controller) or
(space.space == xr::spaces::aim_left and hide_left_ray) or
(space.space == xr::spaces::grip_right and hide_right_controller) or
(space.space == xr::spaces::aim_right and hide_right_ray))
{
node.visible = false;
}