From 35a433041208de7a55e053a306e91d6e68452f29 Mon Sep 17 00:00:00 2001 From: ? Date: Wed, 27 Feb 2019 14:13:04 +0100 Subject: [PATCH] 3d:: 1/2/3 perspectives in noshmup --- graph.cpp | 1 + hypgraph.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/graph.cpp b/graph.cpp index b66ec456..4b409dbd 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5665,6 +5665,7 @@ purehookset hooks_drawmap; transmatrix cview() { sphereflip = Id; + if(DIM == 3 && !shmup::on && vid.yshift) return cpush(2, vid.yshift) * View; if(DIM == 3) return View; if(sphereflipped()) sphereflip[DIM][DIM] = -1; return ypush(vid.yshift) * sphereflip * View; diff --git a/hypgraph.cpp b/hypgraph.cpp index 2ff0b1ac..4648fcd0 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -1059,7 +1059,9 @@ void centerpc(ld aspd) { 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); if(R < 1e-9) { // either already centered or direction unknown