1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 22:39:53 +00:00

3d:: 1/2/3 perspectives in noshmup

This commit is contained in:
? 2019-02-27 14:13:04 +01:00 committed by Zeno Rogue
parent c0b4ffc343
commit 35a4330412
2 changed files with 4 additions and 1 deletions

View File

@ -5665,6 +5665,7 @@ purehookset hooks_drawmap;
transmatrix cview() { transmatrix cview() {
sphereflip = Id; sphereflip = Id;
if(DIM == 3 && !shmup::on && vid.yshift) return cpush(2, vid.yshift) * View;
if(DIM == 3) return View; if(DIM == 3) return View;
if(sphereflipped()) sphereflip[DIM][DIM] = -1; if(sphereflipped()) sphereflip[DIM][DIM] = -1;
return ypush(vid.yshift) * sphereflip * View; return ypush(vid.yshift) * sphereflip * View;

View File

@ -1059,7 +1059,9 @@ void centerpc(ld aspd) {
ors::unrotate(cwtV); ors::unrotate(View); ors::unrotate(cwtV); ors::unrotate(View);
hyperpoint H = ypush(-vid.yshift) * sphereflip * tC0(cwtV); hyperpoint H = tC0(cwtV);
if(DIM == 2) H = ypush(-vid.yshift) * sphereflip * H;
if(DIM == 3 && !shmup::on && vid.yshift) H = cpush(2, -vid.yshift) * H;
ld R = zero_d(H, DIM) ? 0 : hdist0(H); ld R = zero_d(H, DIM) ? 0 : hdist0(H);
if(R < 1e-9) { if(R < 1e-9) {
// either already centered or direction unknown // either already centered or direction unknown