mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
fixed CAP_VR guards
This commit is contained in:
parent
79bf71ce78
commit
f5ac66513c
@ -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;
|
||||
|
9
rug.cpp
9
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<int> 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user