1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 23:50:27 +00:00

vr:: compute_vr_direction function

This commit is contained in:
Zeno Rogue 2021-02-07 18:35:44 +01:00
parent 8ee918c7ee
commit a836384f19

10
vr.cpp
View File

@ -591,13 +591,17 @@ ld vr_distance(const shiftpoint& h, int id, ld& dist) {
EX hyperpoint vr_direction; EX hyperpoint vr_direction;
EX void compute_point(int id, shiftpoint& res, cell*& c, ld& dist) { EX void compute_vr_direction(int id) {
if(WDIM == 3) {
E4; E4;
transmatrix T = (hsm == eHeadset::none ? hmd_at : hmd_ref_at) * vrdata.pose_matrix[id] * sm; transmatrix T = (hsm == eHeadset::none ? hmd_at : hmd_ref_at) * vrdata.pose_matrix[id] * sm;
vrhr::be_33(T); vrhr::be_33(T);
vr_direction = T * point31(0, 0, -0.01); vr_direction = T * point31(0, 0, -0.01);
}
EX void compute_point(int id, shiftpoint& res, cell*& c, ld& dist) {
if(WDIM == 3) {
compute_vr_direction(id);
movedir md = vectodir(vr_direction); movedir md = vectodir(vr_direction);
cellwalker xc = cwt + md.d + wstep; cellwalker xc = cwt + md.d + wstep;
forward_cell = xc.at; forward_cell = xc.at;