1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-07-06 19:42:50 +00:00

3D:: conformal::rotation is now used to get the initial rotation right in 3D

This commit is contained in:
Zeno Rogue 2019-06-13 17:03:32 +02:00
parent 9eae663fe3
commit d7d5f02a05
2 changed files with 5 additions and 3 deletions

View File

@ -391,6 +391,7 @@ void switch_always3() {
if(rug::rugged) rug::close(); if(rug::rugged) rug::close();
if(dual::split(switch_fpp)) return; if(dual::split(switch_fpp)) return;
check_cgi(); cgi.require_basics(); check_cgi(); cgi.require_basics();
View = inverse(conformal::rotmatrix()) * View;
if(!vid.always3) { if(!vid.always3) {
vid.always3 = true; vid.always3 = true;
ld ms = min<ld>(cgi.scalefactor, 1); ld ms = min<ld>(cgi.scalefactor, 1);
@ -422,6 +423,7 @@ void switch_always3() {
swapmatrix(View); swapmatrix(View);
callhooks(hooks_swapdim); callhooks(hooks_swapdim);
} }
View = conformal::rotmatrix() * View;
#endif #endif
} }

View File

@ -1289,13 +1289,13 @@ void ballgeometry() {
void resetview() { void resetview() {
DEBBI(DF_GRAPH, ("reset view")); DEBBI(DF_GRAPH, ("reset view"));
View = Id; View = conformal::rotmatrix();
// EUCLIDEAN // EUCLIDEAN
if(!masterless) if(!masterless)
viewctr.at = cwt.at->master, viewctr.at = cwt.at->master,
viewctr.spin = cwt.spin; viewctr.spin = cwt.spin;
else centerover = cwt; else centerover = cwt;
cwtV = Id; cwtV = View;
// SDL_LockSurface(s); // SDL_LockSurface(s);
// SDL_UnlockSurface(s); // SDL_UnlockSurface(s);
} }