diff --git a/control.cpp b/control.cpp index 2f3dc050..a5404d83 100644 --- a/control.cpp +++ b/control.cpp @@ -87,7 +87,9 @@ EX movedir vectodir(hyperpoint P) { for(int i=0; itype; i++) { transmatrix T; if(compute_relamatrix((cwt+i).peek(), cwt.at, i, T)) { - dirdist[i] = quickdist(U * T * C0, Centered * P); + ld d1 = geo_dist(U * T * C0, Centered * P, iTable); + ld d2 = geo_dist(U * T * C0, Centered * C0, iTable); + dirdist[i] = d1 - d2; } //xspinpush0(-i * 2 * M_PI /cwt.at->type, .5), P); } @@ -238,7 +240,7 @@ EX void checkjoy() { if(sq < joyvalue1) { joydir.d = -1; return; } } - joydir = vectodir(hpxy(jx, jy)); + joydir = vectodir(tangent_length(point2(jx, jy), 0.01)); } EX void checkpanjoy(double t) { @@ -1074,7 +1076,7 @@ EX bool handleCompass() { if(h < rad) { if(h < rad*SKIPFAC) movepcto(MD_WAIT); else { - hyperpoint param = hpxy(dx * 1. / rad, dy * 1. / rad); + hyperpoint param = tangent_length(point2(dx, dy), .01); movedir md = vectodir(param); diff --git a/graph.cpp b/graph.cpp index e6a700e5..4ac380e1 100644 --- a/graph.cpp +++ b/graph.cpp @@ -7246,9 +7246,10 @@ EX void precise_mouseover() { if(WDIM == 3) { mouseover2 = mouseover = viewcenter(); ld best = HUGE_VAL; - hyperpoint h = direct_exp(lp_iapply(ztangent(1)), 100); + hyperpoint h = direct_exp(lp_iapply(ztangent(0.01)), 100); forCellEx(c1, mouseover2) { - ld dist = hdist(tC0(ggmatrix(c1)), h); + hyperpoint h1 = tC0(ggmatrix(c1)); + ld dist = geo_dist(h1, h, iTable) - geo_dist(C0, h1, iTable); if(dist < best) mouseover = c1, best = dist; } return; diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 6372fb3b..77f468e1 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -1118,6 +1118,6 @@ hyperpoint lp_apply(const hyperpoint h) { return nisot::local_perspective_used() ? nisot::local_perspective * h : h; } -EX hyperpoint smalltangent() { return xtangent((sphere || hybri) ?.5 : 1); } +EX hyperpoint smalltangent() { return xtangent(.1); } }