d/remote: Mark pose as invalid when deactivated

Previously the pose on the remote driver controllers would always have
the set pose and the valid-tracking flags set. Leaving the pose set
makes sense (you might want to track how your game behaves when a
controller looses tracking but still has a pose set, for example
tracking issues caused by occlusion) but it wasn't possible to test with
the pose marked as not being tracked.

Therefore this patch deactivates the tracking flags when the controller
is not marked as active.
This commit is contained in:
Campbell Suter 2022-06-01 17:35:08 +12:00
parent 68d3e117d8
commit 45703f0952

View file

@ -104,10 +104,15 @@ r_device_get_tracked_pose(struct xrt_device *xdev,
out_relation->pose = latest->pose;
out_relation->linear_velocity = latest->linear_velocity;
if (latest->active) {
out_relation->relation_flags = (enum xrt_space_relation_flags)(
XRT_SPACE_RELATION_ORIENTATION_VALID_BIT | XRT_SPACE_RELATION_POSITION_VALID_BIT |
XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT | XRT_SPACE_RELATION_POSITION_TRACKED_BIT |
XRT_SPACE_RELATION_LINEAR_VELOCITY_VALID_BIT | XRT_SPACE_RELATION_ANGULAR_VELOCITY_VALID_BIT);
} else {
out_relation->relation_flags = 0;
}
}
static void