fixed forward direction

This commit is contained in:
Zeno Rogue 2022-12-13 23:51:28 +01:00
parent d7f7f567f7
commit f9552eb74e
2 changed files with 3 additions and 4 deletions

View File

@ -85,7 +85,6 @@ EX movedir vectodir(hyperpoint P) {
transmatrix U = unshift(ggmatrix(cwt.at));
if(embedded_plane && geom3::same_in_same()) U = current_display->radar_transform * U;
if(geom3::euc_in_nil()) P[2] = -P[2]; /* no idea why */
P = direct_exp(lp_iapply(P));
hyperpoint H = sphereflip * tC0(U);
@ -100,7 +99,7 @@ EX movedir vectodir(hyperpoint P) {
for(int i=0; i<cwt.at->type; i++) {
transmatrix T = currentmap->adj(cwt.at, (cwt + i).spin);
ld d1 = geo_dist(U * T * TC0, Centered * P);
ld d2 = geo_dist(U * T * TC0, Centered * TC0);
ld d2 = geo_dist(U * T * TC0, Centered * C0);
dirdist[i] = d1 - d2;
}
@ -124,7 +123,7 @@ EX void remission() {
}
EX hyperpoint move_destination_vec(int d) {
if(WDIM == 2) return spin(-d * 45._deg) * smalltangent();
if(WDIM == 2 && (!embedded_plane || geom3::same_in_same())) return spin(-d * 45._deg) * smalltangent();
else if(d&1) return cspin(0, 1, d > 4 ? 45._deg : -45._deg) * smalltangent();
else return cspin(0, 2, d * 45._deg) * smalltangent();
}

View File

@ -1797,7 +1797,7 @@ EX hyperpoint lp_apply(const hyperpoint h) {
return nisot::local_perspective_used() ? NLP * h : h;
}
EX hyperpoint smalltangent() { if(embedded_plane && msphere) return lxpush0(0.1); else return xtangent(.1); }
EX hyperpoint smalltangent() { return xtangent(.1); }
EX void cyclefix(ld& a, ld b) {
while(a > b + M_PI) a -= TAU;