···11+OpenXR: For pose actions the any path (`XR_NULL_PATH`) needs to be special
22+cased, essentially turning into a separate action sub path, that is assigned
33+at binding time.
+40-6
src/xrt/state_trackers/oxr/oxr_input.c
···445445oxr_action_get_pose_input(struct oxr_logger *log,
446446 struct oxr_session *sess,
447447 uint32_t act_key,
448448- const struct oxr_sub_paths *sub_paths,
448448+ const struct oxr_sub_paths *sub_paths_ptr,
449449 struct oxr_action_input **out_input)
450450{
451451 struct oxr_action_attachment *act_attached = NULL;
···456456 return XR_SUCCESS;
457457 }
458458459459+ struct oxr_sub_paths sub_paths = *sub_paths_ptr;
460460+ if (sub_paths.any) {
461461+ sub_paths = act_attached->any_pose_sub_path;
462462+ }
463463+459464 // Priority of inputs.
460465#define GET_POSE_INPUT(X) \
461461- if (act_attached->X.current.active && \
462462- (sub_paths->X || sub_paths->any)) { \
466466+ if (act_attached->X.current.active && sub_paths.X) { \
463467 *out_input = act_attached->X.inputs; \
464468 return XR_SUCCESS; \
465469 }
···695699 }
696700 OXR_FOR_EACH_VALID_SUBACTION_PATH_DETAILED(BIND_SUBACTION)
697701#undef BIND_SUBACTION
702702+703703+704704+ /*!
705705+ * The any sub path is special cased for poses, it binds to one sub path
706706+ * and sticks with it.
707707+ */
708708+ if (act_ref->action_type == XR_ACTION_TYPE_POSE_INPUT) {
709709+710710+#define POSE_ANY(X) \
711711+ if (act_ref->sub_paths.X && act_attached->X.num_inputs > 0) { \
712712+ act_attached->any_pose_sub_path.X = true; \
713713+ oxr_slog(&slog, \
714714+ "\tFor: <any>\n\t\tBinding any pose to " #X ".\n"); \
715715+ } else
716716+ OXR_FOR_EACH_VALID_SUBACTION_PATH(POSE_ANY)
717717+#undef POSE_ANY
718718+719719+ {
720720+ oxr_slog(&slog,
721721+ "\tFor: <any>\n\t\tNo active sub paths for "
722722+ "the any pose!\n");
723723+ }
724724+ }
698725699726 oxr_slog(&slog, "\tDone");
700727···17311758 "Action has not been attached to this session");
17321759 }
1733176017611761+ // For poses on the any path we select a single path.
17621762+ if (sub_paths.any) {
17631763+ sub_paths = act_attached->any_pose_sub_path;
17641764+ }
17651765+17341766 data->isActive = XR_FALSE;
1735176717681768+ /*
17691769+ * The sub path any is used as a catch all here to see if any
17701770+ */
17361771#define COMPUTE_ACTIVE(X) \
17371737- if (sub_paths.X || sub_paths.any) { \
17721772+ if (sub_paths.X) { \
17381773 data->isActive |= act_attached->X.current.active; \
17391774 }
1740177517411776 OXR_FOR_EACH_VALID_SUBACTION_PATH(COMPUTE_ACTIVE)
17421777#undef COMPUTE_ACTIVE
17781778+17431779 return oxr_session_success_result(sess);
17441780}
17451781···17701806 xrt_device_set_output(xdev, output->name, &value);
17711807 }
17721808}
17731773-17741774-1775180917761810XrResult
17771811oxr_action_apply_haptic_feedback(struct oxr_logger *log,
+7
src/xrt/state_trackers/oxr/oxr_objects.h
···15681568 //! Unique key for the session hashmap.
15691569 uint32_t act_key;
1570157015711571+15721572+ /*!
15731573+ * For pose actions any sub paths are special treated, at bind time we
15741574+ * pick one sub path and stick to it as long as the action lives.
15751575+ */
15761576+ struct oxr_sub_paths any_pose_sub_path;
15771577+15711578 struct oxr_action_state any_state;
1572157915731580#define OXR_CACHE_MEMBER(X) struct oxr_action_cache X;