Add FB hand mesh support with GLB fallback (#934)
Use the XR_FB_HAND_TRACKING_MESH extension to render hand models when supported, and fall back to the bundled GLB hand models otherwise. This fixes incorrect hand model rendering on PFDM MR device, Have tested with PFDM MR V4.5.0 version.
This commit is contained in:
+19
-2
@@ -1176,8 +1176,25 @@ void scenes::lobby::on_focused()
|
||||
{
|
||||
left_hand = session.create_hand_tracker(XR_HAND_LEFT_EXT);
|
||||
right_hand = session.create_hand_tracker(XR_HAND_RIGHT_EXT);
|
||||
hand_model::add_hand(*this, XR_HAND_LEFT_EXT, "assets://left-hand.glb", layer_controllers);
|
||||
hand_model::add_hand(*this, XR_HAND_RIGHT_EXT, "assets://right-hand.glb", layer_controllers);
|
||||
|
||||
bool using_hand_mesh_fb = false;
|
||||
if (system.hand_mesh_fb_supported())
|
||||
{
|
||||
const auto * left_hand_mesh_fb = left_hand->mesh();
|
||||
const auto * right_hand_mesh_fb = right_hand->mesh();
|
||||
if (left_hand_mesh_fb and right_hand_mesh_fb)
|
||||
{
|
||||
hand_model::add_hand(*this, XR_HAND_LEFT_EXT, *left_hand_mesh_fb, layer_controllers);
|
||||
hand_model::add_hand(*this, XR_HAND_RIGHT_EXT, *right_hand_mesh_fb, layer_controllers);
|
||||
using_hand_mesh_fb = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!using_hand_mesh_fb)
|
||||
{
|
||||
hand_model::add_hand(*this, XR_HAND_LEFT_EXT, "assets://left-hand.glb", layer_controllers);
|
||||
hand_model::add_hand(*this, XR_HAND_RIGHT_EXT, "assets://right-hand.glb", layer_controllers);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector imgui_inputs{
|
||||
|
||||
Reference in New Issue
Block a user