[Bf-blender-cvs] [abe2669720] HMD_viewport: Use projection matrix from OpenHMD even if "Rotation from HMD" is disabled

Julian Eisel noreply at git.blender.org
Tue Mar 7 17:28:00 CET 2017


Commit: abe2669720b060a7fdecb07a91aa28afc1d9ad21
Author: Julian Eisel
Date:   Tue Mar 7 17:26:36 2017 +0100
Branches: HMD_viewport
https://developer.blender.org/rBabe2669720b060a7fdecb07a91aa28afc1d9ad21

Use projection matrix from OpenHMD even if "Rotation from HMD" is disabled

Was actually applying IPD wrongly, should be correct now.

===================================================================

M	source/blender/editors/space_view3d/view3d_draw.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 0d808cc23e..a3f589e4a6 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3697,14 +3697,12 @@ static void view3d_hmd_view_get_matrices(
 	}
 	else {
 		const float shiftx = WM_device_HMD_lens_horizontal_separation_get();
-		const float ipd = WM_device_HMD_IPD_get();
 
-		copy_m4_m4(r_modelviewmat, rv3d->viewmat);
-		copy_m4_m4(r_projectionmat, rv3d->winmat);
+		WM_device_HMD_projection_matrix_get(is_left, r_projectionmat);
 
+		copy_m4_m4(r_modelviewmat, rv3d->viewmat);
 		/* apply ipd and lens shift */
 		r_modelviewmat[3][0]  += (shiftx * 0.5f) * (is_left ? 1.0f : -1.0f);
-		r_projectionmat[3][0] += (ipd    * 0.5f) * (is_left ? 1.0f : -1.0f);
 	}
 }




More information about the Bf-blender-cvs mailing list