From f5ac66513c7f1cd3f34158e3776a9c6aaec6c056 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 31 Dec 2020 18:36:03 +0100 Subject: [PATCH] fixed CAP_VR guards --- drawing.cpp | 2 ++ rug.cpp | 9 ++++++++- vr.cpp | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drawing.cpp b/drawing.cpp index 17bf79e8..40c865f7 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -321,6 +321,7 @@ EX bool two_sided_model() { } EX int get_side(const hyperpoint& H) { + #if CAP_VR if(in_vr_sphere) { hyperpoint Hscr; applymodel(shiftless(H), Hscr); @@ -331,6 +332,7 @@ EX int get_side(const hyperpoint& H) { for(int i=0; i<3; i++) val += (vr_sphere_center[i] - actual[i]) * actual[i]; return val > 0 ? -1 : 1; } + #endif if(pmodel == mdDisk && sphere) { double curnorm = H[0]*H[0]+H[1]*H[1]+H[2]*H[2]; double horizon = curnorm / pconf.alpha; diff --git a/rug.cpp b/rug.cpp index d0351546..77bd2911 100644 --- a/rug.cpp +++ b/rug.cpp @@ -1333,19 +1333,22 @@ EX shiftpoint gethyper(ld x, ld y) { double my = (y - current_display->ycenter)/current_display->radius/pconf.stretch; bool vr = vrhr::active() && which_pointer; - transmatrix T = Id, U; + transmatrix U; if(1) { USING_NATIVE_GEOMETRY; U = ortho_inverse(NLP) * rugView; } + #if CAP_VR + transmatrix T = Id; if(vr) { mx = my = 0; E4; vrhr::gen_mv(); T = vrhr::model_to_controller(which_pointer); } + #endif calcparam(); @@ -1380,6 +1383,7 @@ EX shiftpoint gethyper(ld x, ld y) { if(!vr) { applymodel(shiftless(U * native), res); } + #if CAP_VR else { dynamicval vi(vrhr::state, 2); bool bad; @@ -1387,6 +1391,7 @@ EX shiftpoint gethyper(ld x, ld y) { if(bad) error = true; E4; res[3] = 1; res = T * res; } + #endif }; find(r0->native, p0); @@ -1417,7 +1422,9 @@ EX shiftpoint gethyper(ld x, ld y) { radar_distance = rz1; rx1 = r0->x1 + (r1->x1 - r0->x1) * tx + (r2->x1 - r0->x1) * ty; ry1 = r0->y1 + (r1->y1 - r0->y1) * tx + (r2->y1 - r0->y1) * ty; + #if CAP_VR if(vr) vrhr::pointer_distance = radar_distance; + #endif } found = true; } diff --git a/vr.cpp b/vr.cpp index b534c62a..aa7f6c9f 100644 --- a/vr.cpp +++ b/vr.cpp @@ -11,10 +11,12 @@ namespace hr { EX namespace vrhr { #if !CAP_VR +#if HDR inline bool active() { return false; } inline bool rendering() { return false; } inline bool rendering_eye() { return false; } #endif +#endif #if CAP_VR