d/remote: expose hand active state to remote gui

This commit is contained in:
Moses Turner 2022-01-18 14:33:11 -06:00
parent 51d321824f
commit 2188d8afc2
4 changed files with 7 additions and 0 deletions

View file

@ -145,6 +145,7 @@ r_device_get_hand_tracking(struct xrt_device *xdev,
xrt_device_get_tracked_pose(xdev, XRT_INPUT_SIMPLE_GRIP_POSE, requested_timestamp_ns, &relation);
u_hand_joints_set_out_data(&rd->hand_tracking, hand, &relation, &hand_on_handle_pose, out_value);
out_value->is_active = latest->hand_tracking_active;
// This is a lie
*out_timestamp_ns = requested_timestamp_ns;

View file

@ -172,11 +172,14 @@ r_create_devices(uint16_t port,
r->reset.hmd.pose.position.y = 1.6f;
r->reset.hmd.pose.orientation.w = 1.0f;
r->reset.left.active = true;
r->reset.left.hand_tracking_active = true;
r->reset.left.pose.position.x = -0.2f;
r->reset.left.pose.position.y = 1.3f;
r->reset.left.pose.position.z = -0.5f;
r->reset.left.pose.orientation.w = 1.0f;
r->reset.right.active = true;
r->reset.right.hand_tracking_active = true;
r->reset.right.pose.position.x = 0.2f;
r->reset.right.pose.position.y = 1.3f;
r->reset.right.pose.position.z = -0.5f;

View file

@ -49,6 +49,8 @@ struct r_remote_controller_data
float hand_curl[5];
bool hand_tracking_active;
bool active;
bool select;
bool menu;

View file

@ -228,6 +228,7 @@ render_cheat_menu(struct gui_remote *gr, struct gui_program *p)
#define CURL(prefix, name, index) igDragFloat(#prefix "." #name, &d->prefix.hand_curl[index], 0.01, 0.0, 1.0, "%f", 0);
#define HAND(prefix) \
do { \
igCheckbox("Hand tracking Active", &d->prefix.hand_tracking_active); \
CURL(prefix, little, 0); \
CURL(prefix, ring, 1); \
CURL(prefix, middle, 2); \