diff options
author | Peter Kim <pk15950@gmail.com> | 2021-07-23 08:41:31 +0300 |
---|---|---|
committer | Peter Kim <pk15950@gmail.com> | 2021-07-23 08:54:56 +0300 |
commit | 36c0649d32aa458061df45bf280f989e1f8527db (patch) | |
tree | f9cd0631d985099edabd36a800d8b81db9e35a8e /source/blender/windowmanager/xr/intern/wm_xr_draw.c | |
parent | 66548007a804a9f74a6d93065ed3c1194ce3f211 (diff) |
XR: Reference Space Improvements
Improves control over the XR reference space by using the stage ref
space (user-defined tracking bounds) instead of local ref space
(position at application launch), if available. Also adds an
"absolute tracking" session option to skip applying eye offsets that
are normally added for placing users exactly at landmarks.
By enabling absolute tracking, users can define the tracking origin
in a way that is not linked to the headset position. Instead, the
tracking values given by the XR runtime are left unadjusted and a
user can manually calibrate an "origin" landmark object to adjust to
their real world space.
Can be useful for applications that use external tracking systems
and those that primarily only need to use controllers and not the
headset (e.g. motion capture).
The absolute tracking option requires an update to the VR
Scene Inspection addon to be accessible by regular users.
Reviewed By: Julian Eisel
Differential Revision: http://developer.blender.org/D10946
Diffstat (limited to 'source/blender/windowmanager/xr/intern/wm_xr_draw.c')
-rw-r--r-- | source/blender/windowmanager/xr/intern/wm_xr_draw.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/windowmanager/xr/intern/wm_xr_draw.c b/source/blender/windowmanager/xr/intern/wm_xr_draw.c index 1f722855696..bef88505488 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_draw.c +++ b/source/blender/windowmanager/xr/intern/wm_xr_draw.c @@ -61,10 +61,12 @@ static void wm_xr_draw_matrices_create(const wmXrDrawData *draw_data, copy_qt_qt(eye_pose.orientation_quat, draw_view->eye_pose.orientation_quat); copy_v3_v3(eye_pose.position, draw_view->eye_pose.position); - sub_v3_v3(eye_pose.position, draw_data->eye_position_ofs); if ((session_settings->flag & XR_SESSION_USE_POSITION_TRACKING) == 0) { sub_v3_v3(eye_pose.position, draw_view->local_pose.position); } + if ((session_settings->flag & XR_SESSION_USE_ABSOLUTE_TRACKING) == 0) { + sub_v3_v3(eye_pose.position, draw_data->eye_position_ofs); + } perspective_m4_fov(r_proj_mat, draw_view->fov.angle_left, |