From a836384f195851f61a1d8a3a7b18f3abe335b0b0 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 7 Feb 2021 18:35:44 +0100 Subject: [PATCH] vr:: compute_vr_direction function --- vr.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vr.cpp b/vr.cpp index 64c82e44..da77fd26 100644 --- a/vr.cpp +++ b/vr.cpp @@ -591,13 +591,17 @@ ld vr_distance(const shiftpoint& h, int id, ld& dist) { EX hyperpoint vr_direction; +EX void compute_vr_direction(int id) { + E4; + transmatrix T = (hsm == eHeadset::none ? hmd_at : hmd_ref_at) * vrdata.pose_matrix[id] * sm; + vrhr::be_33(T); + vr_direction = T * point31(0, 0, -0.01); + } + EX void compute_point(int id, shiftpoint& res, cell*& c, ld& dist) { if(WDIM == 3) { - E4; - transmatrix T = (hsm == eHeadset::none ? hmd_at : hmd_ref_at) * vrdata.pose_matrix[id] * sm; - vrhr::be_33(T); - vr_direction = T * point31(0, 0, -0.01); + compute_vr_direction(id); movedir md = vectodir(vr_direction); cellwalker xc = cwt + md.d + wstep; forward_cell = xc.at;