mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 12:19:18 +00:00
fixed forward direction
This commit is contained in:
parent
d7f7f567f7
commit
f9552eb74e
@ -85,7 +85,6 @@ EX movedir vectodir(hyperpoint P) {
|
|||||||
transmatrix U = unshift(ggmatrix(cwt.at));
|
transmatrix U = unshift(ggmatrix(cwt.at));
|
||||||
if(embedded_plane && geom3::same_in_same()) U = current_display->radar_transform * U;
|
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));
|
P = direct_exp(lp_iapply(P));
|
||||||
|
|
||||||
hyperpoint H = sphereflip * tC0(U);
|
hyperpoint H = sphereflip * tC0(U);
|
||||||
@ -100,7 +99,7 @@ EX movedir vectodir(hyperpoint P) {
|
|||||||
for(int i=0; i<cwt.at->type; i++) {
|
for(int i=0; i<cwt.at->type; i++) {
|
||||||
transmatrix T = currentmap->adj(cwt.at, (cwt + i).spin);
|
transmatrix T = currentmap->adj(cwt.at, (cwt + i).spin);
|
||||||
ld d1 = geo_dist(U * T * TC0, Centered * P);
|
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;
|
dirdist[i] = d1 - d2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +123,7 @@ EX void remission() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EX hyperpoint move_destination_vec(int d) {
|
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 if(d&1) return cspin(0, 1, d > 4 ? 45._deg : -45._deg) * smalltangent();
|
||||||
else return cspin(0, 2, d * 45._deg) * smalltangent();
|
else return cspin(0, 2, d * 45._deg) * smalltangent();
|
||||||
}
|
}
|
||||||
|
@ -1797,7 +1797,7 @@ EX hyperpoint lp_apply(const hyperpoint h) {
|
|||||||
return nisot::local_perspective_used() ? NLP * h : 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) {
|
EX void cyclefix(ld& a, ld b) {
|
||||||
while(a > b + M_PI) a -= TAU;
|
while(a > b + M_PI) a -= TAU;
|
||||||
|
Loading…
Reference in New Issue
Block a user