Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShashank Shekhar <secondary.cmdr2@gmail.com>2022-05-07 05:39:17 +0300
committerPeter Kim <pk15950@gmail.com>2022-05-07 05:39:26 +0300
commit23be3294ff50b9a1f9eebfbde71b44252520c51f (patch)
tree1584ae44520814c4340344a53d7348b133f1db62 /source/blender/windowmanager/WM_types.h
parent98a04ed4524234b1840dc039c2f356db5ac57f26 (diff)
XR: Expose the OpenXR user paths in the event data for XR events
The use-case is to allow an event handler (in C or a plugin) to distinguish which hand produced the XR event. The alternative is to register separate actions for each hand (e.g. "trigger_left" and "trigger_right"), and duplicate the device bindings (Oculus, HTC Vive, etc) for each action. Other than the problem of code duplication, this isn't conceptually efficient since "trigger_left" and "trigger_right" both represent the same event "trigger", and the identity of the hand that produced that event is just a property of that event. Adds two string fields to the XrEventData called user_path and user_path_other. The user_path_other field will be populated if the event is a bimanual one (i.e. two-handed). This follows the pattern used by the rest of the XrEventData struct for bimanual events (e.g. state, state_other). Reviewed By: muxed-reality
Diffstat (limited to 'source/blender/windowmanager/WM_types.h')
-rw-r--r--source/blender/windowmanager/WM_types.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 3ee5c85c031..9e9f195c430 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -812,6 +812,10 @@ typedef struct wmXrActionData {
char action_set[64];
/** Action name. */
char action[64];
+ /** User path. E.g. "/user/hand/left" */
+ char user_path[64];
+ /** Other user path, for bimanual actions. E.g. "/user/hand/right" */
+ char user_path_other[64];
/** Type. */
eXrActionType type;
/** State. Set appropriately based on type. */