From f4a1c5344b36269ed93ccad410c7a09a38c947d8 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Mon, 26 Apr 2021 15:35:51 -0500 Subject: [PATCH] d/android_sensors: Port to u_device_get_view_pose --- src/xrt/drivers/android/android_sensors.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/xrt/drivers/android/android_sensors.c b/src/xrt/drivers/android/android_sensors.c index 00159a809..d717dc3e8 100644 --- a/src/xrt/drivers/android/android_sensors.c +++ b/src/xrt/drivers/android/android_sensors.c @@ -174,25 +174,8 @@ android_device_get_view_pose(struct xrt_device *xdev, uint32_t view_index, struct xrt_pose *out_pose) { - struct xrt_pose pose = {{0.0f, 0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 0.0f}}; - bool adjust = view_index == 0; - - pose.position.x = eye_relation->x / 2.0f; - pose.position.y = eye_relation->y / 2.0f; - pose.position.z = eye_relation->z / 2.0f; - - // Adjust for left/right while also making sure there aren't any -0.f. - if (pose.position.x > 0.0f && adjust) { - pose.position.x = -pose.position.x; - } - if (pose.position.y > 0.0f && adjust) { - pose.position.y = -pose.position.y; - } - if (pose.position.z > 0.0f && adjust) { - pose.position.z = -pose.position.z; - } - - *out_pose = pose; + (void)xdev; + u_device_get_view_pose(eye_relation, view_index, out_pose); } /*