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:
authorPeter Kim <pk15950@gmail.com>2021-10-26 07:33:02 +0300
committerPeter Kim <pk15950@gmail.com>2021-10-26 07:34:58 +0300
commit3434a991ec5befef19c5484bfc70a3a333e42c34 (patch)
tree7eeda80bc172707e4b70c2b81aef8081dfcfc558 /source/blender/windowmanager/WM_api.h
parente463d2c16f72e976ed1c886aca3f8efe396978fb (diff)
XR Controller Support Step 5: Navigation
Adds navigation transforms (pose, scale) to the XR session state that will be applied to the viewer/controller poses. By manipulating these values, a viewer can move through the VR viewport without the need to physically walk through it. Add-ons can access these transforms via Python (XrSessionState.navigation_location/rotation/scale) to use with custom operators. Also adds 3 new VR navigation operators that will be exposed to users as default actions in the VR Scene Inspection add-on. While all three of these operators have custom properties that can greatly influence their behaviors, for now these properties will not be accessible by users from the UI. However, other add-ons can still set these custom properties if they desire. 1). Raycast-based teleport Moves the user to a location pointed at on a mesh object. The result can optionally be constrained to specific axes, for example to achieve "elevation snapping" behavior by constraining to the Z-axis. In addition, one can specify an interpolation factor and offset. Credit to KISKA for the elevation snapping concept. 2). "Grab" navigation Moves the user through the viewport by pressing inputs on one or two held controllers and applying deltas to the navigation matrix based on the displacement of these controllers. When inputs on both controllers are pressed at the same time (bimanual interaction), the user can scale themselves relative to the scene based on the distance between the controllers. Also supports locks for location, rotation, and scale. 3). Fly navigation Navigates the viewport by pressing a button and moving/turning relative to navigation space or the VR viewer or controller. Via the operator's properties, one can select from a variety of these modes as well as specify the min/max speed and whether to lock elevation. Reviewed By: Severin Differential Revision: https://developer.blender.org/D11501
Diffstat (limited to 'source/blender/windowmanager/WM_api.h')
-rw-r--r--source/blender/windowmanager/WM_api.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 2988aacc4d3..2d5100eec7c 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -1027,6 +1027,13 @@ bool WM_xr_session_state_controller_aim_location_get(const wmXrData *xr,
bool WM_xr_session_state_controller_aim_rotation_get(const wmXrData *xr,
unsigned int subaction_idx,
float r_rotation[4]);
+bool WM_xr_session_state_nav_location_get(const wmXrData *xr, float r_location[3]);
+void WM_xr_session_state_nav_location_set(wmXrData *xr, const float location[3]);
+bool WM_xr_session_state_nav_rotation_get(const wmXrData *xr, float r_rotation[4]);
+void WM_xr_session_state_nav_rotation_set(wmXrData *xr, const float rotation[4]);
+bool WM_xr_session_state_nav_scale_get(const wmXrData *xr, float *r_scale);
+void WM_xr_session_state_nav_scale_set(wmXrData *xr, float scale);
+void WM_xr_session_state_navigation_reset(struct wmXrSessionState *state);
struct ARegionType *WM_xr_surface_controller_region_type_get(void);