mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-18 23:10:26 +00:00
vr:: compute_vr_direction function
This commit is contained in:
parent
8ee918c7ee
commit
a836384f19
12
vr.cpp
12
vr.cpp
@ -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_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) {
|
EX void compute_point(int id, shiftpoint& res, cell*& c, ld& dist) {
|
||||||
|
|
||||||
if(WDIM == 3) {
|
if(WDIM == 3) {
|
||||||
E4;
|
compute_vr_direction(id);
|
||||||
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);
|
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user