When the runtime does not track the hands:
- Hide them in the lobby - Don't send tracking data in the stream
This commit is contained in:
@@ -88,26 +88,34 @@ static xrt_space_relation to_relation(const from_headset::hand_tracking::pose& p
|
||||
};
|
||||
}
|
||||
|
||||
static xrt_hand_joint_set convert_joints(const std::array<from_headset::hand_tracking::pose, XR_HAND_JOINT_COUNT_EXT>& input_joints)
|
||||
static xrt_hand_joint_set convert_joints(const std::optional<std::array<from_headset::hand_tracking::pose, XR_HAND_JOINT_COUNT_EXT>>& input_joints)
|
||||
{
|
||||
xrt_hand_joint_set output_joints;
|
||||
xrt_hand_joint_set output_joints{};
|
||||
|
||||
output_joints.is_active = true;
|
||||
output_joints.hand_pose = to_relation(input_joints[XRT_HAND_JOINT_WRIST]);
|
||||
|
||||
xrt_relation_chain rel_chain{};
|
||||
xrt_space_relation * joint_rel = m_relation_chain_reserve(&rel_chain);
|
||||
m_relation_chain_push_inverted_relation(&rel_chain, &output_joints.hand_pose);
|
||||
|
||||
for(int i = 0; i < XR_HAND_JOINT_COUNT_EXT; i++)
|
||||
if (input_joints)
|
||||
{
|
||||
xrt_hand_joint_value& res = output_joints.values.hand_joint_set_default[i];
|
||||
output_joints.is_active = true;
|
||||
output_joints.hand_pose = to_relation((*input_joints)[XRT_HAND_JOINT_WRIST]);
|
||||
|
||||
res.radius = input_joints[i].radius;
|
||||
*joint_rel = to_relation(input_joints[i]);
|
||||
xrt_relation_chain rel_chain{};
|
||||
xrt_space_relation * joint_rel = m_relation_chain_reserve(&rel_chain);
|
||||
m_relation_chain_push_inverted_relation(&rel_chain, &output_joints.hand_pose);
|
||||
|
||||
m_relation_chain_resolve(&rel_chain, &res.relation);
|
||||
for(int i = 0; i < XR_HAND_JOINT_COUNT_EXT; i++)
|
||||
{
|
||||
xrt_hand_joint_value& res = output_joints.values.hand_joint_set_default[i];
|
||||
|
||||
res.radius = (*input_joints)[i].radius;
|
||||
*joint_rel = to_relation((*input_joints)[i]);
|
||||
|
||||
m_relation_chain_resolve(&rel_chain, &res.relation);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
output_joints.is_active = false;
|
||||
}
|
||||
|
||||
return output_joints;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user