···701701 * Transforms a relation given in pure global space into the oxr_space @p spc.
702702 * If @p apply_space_pose is true, the pose offset of @p spc will be included in @p out_relation.
703703 */
704704-bool
704704+XRT_CHECK_RESULT bool
705705oxr_space_pure_relation_in_space(struct oxr_logger *log,
706706 XrTime time,
707707 struct xrt_space_relation *relation,
···713713 * Transforms a pose given in pure global space into a relation in the oxr_space @p spc.
714714 * If @p apply_space_pose is true, the pose offset of @p spc will be included in @p out_relation.
715715 */
716716-bool
716716+XRT_CHECK_RESULT bool
717717oxr_space_pure_pose_in_space(struct oxr_logger *log,
718718 XrTime time,
719719 struct xrt_pose *pose,
···725725 * Transforms a relation in an given oxr_space @p spc into pure global space, taking the pose offset of @p spc into
726726 * account.
727727 */
728728-bool
728728+XRT_CHECK_RESULT bool
729729oxr_space_pure_relation_from_space(struct oxr_logger *log,
730730 XrTime time,
731731 struct xrt_space_relation *relation,
···736736 * Transforms a posen in a given oxr_space @p spc into a relation in "pure" global space, taking the pose offset of @p
737737 * spc into account.
738738 */
739739-bool
739739+XRT_CHECK_RESULT bool
740740oxr_space_pure_pose_from_space(struct oxr_logger *log,
741741 XrTime time,
742742 struct xrt_pose *pose,
···749749 *
750750 * @todo: This function currently assumes all reference spaces are associated with the HMD.
751751 */
752752-bool
752752+XRT_CHECK_RESULT bool
753753oxr_space_get_pure_relation(struct oxr_logger *log,
754754 struct oxr_space *spc,
755755 XrTime time,
···760760oxr_space_locate(
761761 struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, XrSpaceLocation *location);
762762763763-bool
763763+XRT_CHECK_RESULT bool
764764is_local_space_set_up(struct oxr_session *sess);
765765766766XrSpaceLocationFlags
767767xrt_to_xr_space_location_flags(enum xrt_space_relation_flags relation_flags);
768768769769-bool
769769+XRT_CHECK_RESULT bool
770770global_to_local_space(struct oxr_logger *log, struct oxr_session *sess, XrTime time, struct xrt_space_relation *rel);
771771772772/*
+25-10
src/xrt/state_trackers/oxr/oxr_session.c
···856856 m_relation_chain_resolve(&xrc, &pure_hand_relation);
857857858858 struct xrt_space_relation hand_pose_in_base_space;
859859- oxr_space_pure_relation_in_space(log, at_time, &pure_hand_relation, baseSpc, true, &hand_pose_in_base_space);
859859+ bool has_hand_pose_in_base_sapce = oxr_space_pure_relation_in_space( //
860860+ log, //
861861+ at_time, //
862862+ &pure_hand_relation, //
863863+ baseSpc, //
864864+ true, //
865865+ &hand_pose_in_base_space); //
860866867867+ // Can we not relate to this space or did we not get values?
868868+ if (!has_hand_pose_in_base_sapce || !value.is_active) {
869869+ locations->isActive = false;
870870+871871+ // Loop over all joints and zero flags.
872872+ for (uint32_t i = 0; i < locations->jointCount; i++) {
873873+ locations->jointLocations[i].locationFlags = XRT_SPACE_RELATION_BITMASK_NONE;
874874+ if (vel) {
875875+ XrHandJointVelocityEXT *v = &vel->jointVelocities[i];
876876+ v->velocityFlags = XRT_SPACE_RELATION_BITMASK_NONE;
877877+ }
878878+ }
879879+880880+ return XR_SUCCESS;
881881+ }
882882+883883+ // We know we are active.
884884+ locations->isActive = true;
861885862886 for (uint32_t i = 0; i < locations->jointCount; i++) {
863887 locations->jointLocations[i].locationFlags =
···892916 v->angularVelocity.x = result.angular_velocity.x;
893917 v->angularVelocity.y = result.angular_velocity.y;
894918 v->angularVelocity.z = result.angular_velocity.z;
895895- }
896896- }
897897-898898- if (value.is_active) {
899899- locations->isActive = true;
900900- } else {
901901- locations->isActive = false;
902902- for (uint32_t i = 0; i < locations->jointCount; i++) {
903903- locations->jointLocations[i].locationFlags = XRT_SPACE_RELATION_BITMASK_NONE;
904919 }
905920 }
906921
+16-9
src/xrt/state_trackers/oxr/oxr_space.c
···166166 * @todo: Until a proper reference space system is implemented, the xdev assigned to the head role should be used as @p
167167 * ref_xdev for consistency.
168168 */
169169-static bool
169169+XRT_CHECK_RESULT static bool
170170oxr_space_ref_get_pure_relation(struct oxr_logger *log,
171171 struct oxr_session *sess,
172172 XrReferenceSpaceType ref_type,
···215215{
216216 struct xrt_space_relation pure_space_relation;
217217 struct xrt_device *xdev;
218218- oxr_space_get_pure_relation(log, spc, time, &pure_space_relation, &xdev);
218218+ if (!oxr_space_get_pure_relation(log, spc, time, &pure_space_relation, &xdev)) {
219219+ return false;
220220+ }
219221220222 struct xrt_relation_chain xrc = {0};
221223···325327 * This returns only the relation between two directly-associated spaces without
326328 * the app given offset pose for baseSpc applied.
327329 */
328328-static XrResult
330330+XRT_CHECK_RESULT static bool
329331get_pure_space_relation(struct oxr_logger *log,
330332 struct oxr_space *spc,
331333 struct oxr_space *baseSpc,
···334336{
335337 struct xrt_space_relation space_pure_relation;
336338 struct xrt_device *space_xdev;
337337- oxr_space_get_pure_relation(log, spc, time, &space_pure_relation, &space_xdev);
339339+ if (!oxr_space_get_pure_relation(log, spc, time, &space_pure_relation, &space_xdev)) {
340340+ return false;
341341+ }
338342339343 struct xrt_space_relation base_space_pure_relation;
340344 struct xrt_device *base_space_xdev;
341341- oxr_space_get_pure_relation(log, baseSpc, time, &base_space_pure_relation, &base_space_xdev);
345345+ if (!oxr_space_get_pure_relation(log, baseSpc, time, &base_space_pure_relation, &base_space_xdev)) {
346346+ return false;
347347+ }
342348343349 struct xrt_relation_chain xrc = {0};
344350 m_relation_chain_push_relation(&xrc, &space_pure_relation);
345351 m_relation_chain_push_inverted_relation(&xrc, &base_space_pure_relation);
346352 m_relation_chain_resolve(&xrc, out_relation);
347353348348- return XR_SUCCESS;
354354+ return true;
349355}
350356351357static void
···420426421427 // Get the pure space relation.
422428 struct xrt_space_relation pure;
423423- XrResult ret = get_pure_space_relation(log, spc, baseSpc, time, &pure);
424424- if (ret != XR_SUCCESS) {
429429+ bool has_pure_relation = get_pure_space_relation(log, spc, baseSpc, time, &pure);
430430+ if (!has_pure_relation) {
425431 location->locationFlags = 0;
426426- return ret;
432432+ return XR_SUCCESS;
427433 }
434434+428435429436 // Combine space and base space poses with pure relation
430437 struct xrt_space_relation result;