From e6efcd7a02059da6ba28ff3c5139785c316df582 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 14 Aug 2022 15:44:49 +0100 Subject: [PATCH] u/hand: Take xrt_hand enum instead of bool --- src/xrt/auxiliary/util/u_hand_simulation.c | 8 ++++---- src/xrt/auxiliary/util/u_hand_simulation.h | 4 ++-- src/xrt/drivers/remote/r_device.c | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/xrt/auxiliary/util/u_hand_simulation.c b/src/xrt/auxiliary/util/u_hand_simulation.c index 4ec2f6dcb..35aacd225 100644 --- a/src/xrt/auxiliary/util/u_hand_simulation.c +++ b/src/xrt/auxiliary/util/u_hand_simulation.c @@ -391,12 +391,12 @@ u_hand_sim_simulate(struct u_hand_sim_hand *hand_ptr, struct xrt_hand_joint_set void u_hand_sim_simulate_for_valve_index_knuckles(const struct u_hand_tracking_curl_values *values, - bool is_right, + enum xrt_hand xhand, const struct xrt_space_relation *root_pose, struct xrt_hand_joint_set *out_set) { struct u_hand_sim_hand hand; - hand.is_right = is_right; + hand.is_right = xhand == XRT_HAND_RIGHT; hand_sim_hand_init(&hand); hand.wrist_pose.pose.position.x = 0.f; @@ -450,12 +450,12 @@ u_hand_sim_apply_generic_finger_transform(const struct u_hand_tracking_finger_va void u_hand_sim_simulate_generic(const struct u_hand_tracking_values *values, - bool is_right, + enum xrt_hand xhand, const struct xrt_space_relation *root_pose, struct xrt_hand_joint_set *out_set) { struct u_hand_sim_hand hand; - hand.is_right = is_right; + hand.is_right = xhand == XRT_HAND_RIGHT; hand_sim_hand_init(&hand); hand.wrist_pose.pose.position.x = 0.f; diff --git a/src/xrt/auxiliary/util/u_hand_simulation.h b/src/xrt/auxiliary/util/u_hand_simulation.h index 0a3d14569..b09e7ebdf 100644 --- a/src/xrt/auxiliary/util/u_hand_simulation.h +++ b/src/xrt/auxiliary/util/u_hand_simulation.h @@ -71,13 +71,13 @@ u_hand_sim_simulate(struct u_hand_sim_hand *hand, struct xrt_hand_joint_set *out void u_hand_sim_simulate_for_valve_index_knuckles(const struct u_hand_tracking_curl_values *values, - bool is_right, + enum xrt_hand xhand, const struct xrt_space_relation *root_pose, struct xrt_hand_joint_set *out_set); void u_hand_sim_simulate_generic(const struct u_hand_tracking_values *values, - bool is_right, + enum xrt_hand xhand, const struct xrt_space_relation *root_pose, struct xrt_hand_joint_set *out_set); diff --git a/src/xrt/drivers/remote/r_device.c b/src/xrt/drivers/remote/r_device.c index 7757e1001..dbc8333b6 100644 --- a/src/xrt/drivers/remote/r_device.c +++ b/src/xrt/drivers/remote/r_device.c @@ -162,8 +162,7 @@ r_device_get_hand_tracking(struct xrt_device *xdev, // Simulate the hand. enum xrt_hand hand = rd->is_left ? XRT_HAND_LEFT : XRT_HAND_RIGHT; - bool is_right = hand == XRT_HAND_RIGHT; - u_hand_sim_simulate_for_valve_index_knuckles(&values, is_right, &relation, out_value); + u_hand_sim_simulate_for_valve_index_knuckles(&values, hand, &relation, out_value); out_value->is_active = latest->hand_tracking_active;