Add ray from controller

This commit is contained in:
Guillaume Meunier
2024-11-01 14:13:58 +01:00
parent e1ce484c27
commit d96f7f07a1
13 changed files with 535 additions and 25 deletions
+48
View File
@@ -199,3 +199,51 @@ const char * permission_name(feature f)
}
__builtin_unreachable();
}
std::string controller_name()
{
#ifndef __ANDROID__
const char * controller = std::getenv("WIVRN_CONTROLLER");
if (controller && strcmp(controller, ""))
return controller;
#endif
switch (guess_model())
{
case model::oculus_quest:
return "oculus-touch-v2";
case model::oculus_quest_2:
return "oculus-touch-v3";
case model::meta_quest_pro:
return "meta-quest-touch-pro";
case model::meta_quest_3:
return "meta-quest-touch-plus";
case model::pico_neo_3:
return "pico-neo3";
case model::pico_4:
return "pico-4";
case model::htc_vive_focus_3:
case model::htc_vive_xr_elite:
return "htc-vive-focus-3";
case model::lynx_r1:
case model::unknown:
return "generic-trigger-squeeze";
}
__builtin_unreachable();
}
std::string controller_ray_model_name()
{
switch (guess_model())
{
case model::htc_vive_focus_3:
case model::htc_vive_xr_elite:
// XR Elite's runtime always assume alpha is unpremultiplied in the composition layers
// Assume it's the same for all HTC headsets
return "ray-htc.gltf";
default:
return "ray.gltf";
}
}