mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-13 10:50:35 +00:00
3d:: line animation no longer rotates randomly
This commit is contained in:
parent
b5127b0006
commit
f8fe631eca
@ -360,9 +360,17 @@ namespace conformal {
|
|||||||
if(ph<0) ph = 0;
|
if(ph<0) ph = 0;
|
||||||
if(ph >= siz-1) ph = siz-2;
|
if(ph >= siz-1) ph = siz-2;
|
||||||
|
|
||||||
|
heptagon *old = viewctr.at;
|
||||||
|
|
||||||
viewctr.at = v[ph]->base->master;
|
viewctr.at = v[ph]->base->master;
|
||||||
viewctr.spin = 0;
|
viewctr.spin = 0;
|
||||||
|
|
||||||
|
ld angle = 0;
|
||||||
|
if(DIM == 3) {
|
||||||
|
hyperpoint h = spin(-rotation * degree) * cspin(0, 2, rotation_xz * degree) * View * hpxy3(1,2,3);
|
||||||
|
angle = atan2(h[1], h[2]);
|
||||||
|
}
|
||||||
|
|
||||||
View = inverse(master_relative(v[ph]->base) * v[ph]->at);
|
View = inverse(master_relative(v[ph]->base) * v[ph]->at);
|
||||||
|
|
||||||
hyperpoint now = v[ph]->at * C0;
|
hyperpoint now = v[ph]->at * C0;
|
||||||
@ -370,8 +378,18 @@ namespace conformal {
|
|||||||
hyperpoint next = calc_relative_matrix(v[ph+1]->base, v[ph]->base, C0) *
|
hyperpoint next = calc_relative_matrix(v[ph+1]->base, v[ph]->base, C0) *
|
||||||
v[ph+1]->at * C0;
|
v[ph+1]->at * C0;
|
||||||
|
|
||||||
View = spin(rotation * degree) * xpush(-(phase-ph) * hdist(now, next)) * View;
|
View = xpush(-(phase-ph) * hdist(now, next)) * View;
|
||||||
if(DIM == 3) View = cspin(0, 2, rotation_xz * degree) * View;
|
if(DIM == 2)
|
||||||
|
View = spin(rotation * degree) * View;
|
||||||
|
else {
|
||||||
|
if(celldistance(v[ph]->base, old->c7) <= 2) {
|
||||||
|
hyperpoint h1 = View * currentmap->relative_matrix(old, viewctr.at) * hpxy3(1,2,3);
|
||||||
|
ld angle1 = atan2(h1[1], h1[2]);
|
||||||
|
View = cspin(2, 1, angle1 - angle) * View;
|
||||||
|
}
|
||||||
|
View = cspin(0, 2, -rotation_xz * degree) * spin(rotation * degree) * View;
|
||||||
|
}
|
||||||
|
|
||||||
playermoved = false;
|
playermoved = false;
|
||||||
centerover.at = v[ph]->base;
|
centerover.at = v[ph]->base;
|
||||||
compute_graphical_distance();
|
compute_graphical_distance();
|
||||||
|
Loading…
Reference in New Issue
Block a user