1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 01:20:37 +00:00

use_atan configurable for RotatedHyperboles

This commit is contained in:
Zeno Rogue 2018-12-24 01:10:55 +01:00
parent c56287ae38
commit 39ce061fa7
4 changed files with 12 additions and 2 deletions

View File

@ -342,6 +342,7 @@ void initConfig() {
addsaver(conformal::formula, "formula"); addsaver(conformal::formula, "formula");
addsaverenum(conformal::basic_model, "basic model"); addsaverenum(conformal::basic_model, "basic model");
addsaver(conformal::use_atan, "use_atan");
addsaver(vid.consider_shader_projection, "shader-projection", true); addsaver(vid.consider_shader_projection, "shader-projection", true);

View File

@ -389,6 +389,7 @@ namespace conformal {
ld spiral_angle = 70, spiral_x = 10, spiral_y = 7; ld spiral_angle = 70, spiral_x = 10, spiral_y = 7;
int spiral_id = 7; int spiral_id = 7;
bool use_atan = false;
cld spiral_multiplier; cld spiral_multiplier;
ld right_spiral_multiplier = 1; ld right_spiral_multiplier = 1;
@ -741,6 +742,11 @@ namespace conformal {
}); });
} }
if(pmodel == mdRotatedHyperboles) {
dialog::addBoolItem(XLAT("use atan to make it finite"), use_atan, 'x');
dialog::add_action([] () { use_atan = !use_atan; });
}
if(pmodel == mdBall) { if(pmodel == mdBall) {
dialog::addSelItem(XLAT("projection in ball model"), fts3(vid.ballproj), 'x'); dialog::addSelItem(XLAT("projection in ball model"), fts3(vid.ballproj), 'x');
dialog::add_action([] () { dialog::add_action([] () {

View File

@ -1321,6 +1321,7 @@ namespace conformal {
extern vector<cell*> movehistory; extern vector<cell*> movehistory;
extern set<cell*> inmovehistory, inkillhistory, infindhistory; extern set<cell*> inmovehistory, inkillhistory, infindhistory;
extern bool includeHistory; extern bool includeHistory;
extern bool use_atan;
extern ld rotation; extern ld rotation;
extern int do_rotate; extern int do_rotate;
extern ld model_orientation; extern ld model_orientation;

View File

@ -539,8 +539,10 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
ret[1] = cosh(x) * factor; ret[1] = cosh(x) * factor;
ret[2] = 0; ret[2] = 0;
if(conformal::use_atan) {
ret[0] = atan(ret[0]); ret[0] = atan(ret[0]);
ret[1] = atan(ret[1]); ret[1] = atan(ret[1]);
}
break; break;
} }