1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

2D3D:: fixed Y/Z orientation

This commit is contained in:
Zeno Rogue 2019-05-09 19:45:20 +02:00
parent fb6a0829a2
commit f652e6139c
3 changed files with 11 additions and 0 deletions

View File

@ -171,6 +171,7 @@ void initConfig() {
addsaver(vid.yshift, "Y shift", 0); addsaver(vid.yshift, "Y shift", 0);
addsaver(vid.use_wall_radar, "wallradar", true); addsaver(vid.use_wall_radar, "wallradar", true);
addsaver(vid.fixed_facing, "fixed facing", 0); addsaver(vid.fixed_facing, "fixed facing", 0);
addsaver(vid.fixed_yz, "fixed YZ", true);
addsaver(vid.camera_angle, "camera angle", 0); addsaver(vid.camera_angle, "camera angle", 0);
addsaver(vid.ballproj, "ballproj", 1); addsaver(vid.ballproj, "ballproj", 1);
addsaver(vid.monmode, "monster display mode", DEFAULT_MONMODE); addsaver(vid.monmode, "monster display mode", DEFAULT_MONMODE);
@ -1275,6 +1276,10 @@ void show3D() {
} }
}); });
} }
if(WDIM == 2 && GDIM == 3)
dialog::addBoolItem_action("fixed Y/Z rotation", vid.fixed_yz, 'Z');
if(true) { if(true) {
dialog::addBreak(50); dialog::addBreak(50);
dialog::addSelItem(XLAT("projection"), current_proj_name(), 'M'); dialog::addSelItem(XLAT("projection"), current_proj_name(), 'M');

View File

@ -1095,6 +1095,7 @@ struct videopar {
int radarsize; // radar for 3D geometries int radarsize; // radar for 3D geometries
int aurastr, aurasmoothen; int aurastr, aurasmoothen;
bool fixed_facing; bool fixed_facing;
bool fixed_yz;
bool use_wall_radar; bool use_wall_radar;
int linequality; int linequality;

View File

@ -1075,6 +1075,11 @@ void spinEdge(ld aspd) {
if(downspin > aspd) downspin = aspd; if(downspin > aspd) downspin = aspd;
if(downspin < -aspd) downspin = -aspd; if(downspin < -aspd) downspin = -aspd;
View = spin(downspin) * View; View = spin(downspin) * View;
if(WDIM == 2 && GDIM == 3 && vid.fixed_yz && View[0][2]) {
ld d12 = atan2(View[0][2], View[1][2]);
View = cspin(1, 0, d12) * View;
}
} }
void centerpc(ld aspd) { void centerpc(ld aspd) {