From 08511b1c3de0338314940397083adaba4e9cf492 Mon Sep 17 00:00:00 2001 From: Peter Kim Date: Tue, 5 Oct 2021 15:55:57 +0900 Subject: XR: Add runtime window area for XR events This adds an offscreen View3D window area for the VR view in order to execute XR events/operators in the proper context. The area is created as runtime data before XR events are dispatched and set as the active area during XR event handling. Since the area is runtime-only, it will not be saved in files and since the area is offscreen, it will not interfere with regular window areas. The area is removed with the rest of the XR runtime data on exit, file read, or when stopping the VR session. Note: This also adds internal types (EVT_DATA_XR, EVT_XR_ACTION) and structs (wmXrActionData) for XR events. Reviewed By: Severin Differential Revision: https://developer.blender.org/D12472 --- source/blender/windowmanager/WM_types.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'source/blender/windowmanager/WM_types.h') diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 7f52bef3203..14a69d9c435 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -120,6 +120,7 @@ struct wmWindowManager; #include "BLI_compiler_attrs.h" #include "DNA_listBase.h" #include "DNA_vec_types.h" +#include "DNA_xr_types.h" #include "RNA_types.h" /* exported types for WM */ @@ -721,6 +722,36 @@ typedef struct wmXrActionState { }; int type; /* eXrActionType */ } wmXrActionState; + +typedef struct wmXrActionData { + /** Action set name. */ + char action_set[64]; + /** Action name. */ + char action[64]; + /** Type. */ + eXrActionType type; + /** State. Set appropriately based on type. */ + float state[2]; + /** State of the other subaction path for bimanual actions. */ + float state_other[2]; + + /** Input threshold for float/vector2f actions. */ + float float_threshold; + + /** Controller aim pose corresponding to the action's subaction path. */ + float controller_loc[3]; + float controller_rot[4]; + /** Controller aim pose of the other subaction path for bimanual actions. */ + float controller_loc_other[3]; + float controller_rot_other[4]; + + /** Operator. */ + struct wmOperatorType *ot; + struct IDProperty *op_properties; + + /** Whether bimanual interaction is occuring. */ + bool bimanual; +} wmXrActionData; #endif /** Timer flags. */ -- cgit v1.2.3