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

fake:: removed debug

This commit is contained in:
Zeno Rogue 2020-05-16 11:16:36 +02:00
parent 0cb4914ac9
commit a401f8a555

View File

@ -254,15 +254,12 @@ EX ld compute_around(bool setup) {
h2 = gpushxto0(u) * h2; h2 = gpushxto0(u) * h2;
u = gpushxto0(u) * u; u = gpushxto0(u) * u;
println(hlog, "h = ", hdist0(h), " ucgi = ", format("%p", &ucgi), " @ ", hyperbolic, " / ", sphere, " h2 = ", h2);
ld x = hypot(h2[1], h2[2]); ld x = hypot(h2[1], h2[2]);
ld y = h2[0]; ld y = h2[0];
return 360 / (90 + atan(y/x) / degree); return 360 / (90 + atan(y/x) / degree);
} }
EX void generate() { EX void generate() {
println(hlog, "Generating fake");
FPIU( cgi.require_basics() ); FPIU( cgi.require_basics() );
auto &ucgi = *underlying_cgip; auto &ucgi = *underlying_cgip;
@ -300,8 +297,6 @@ EX void compute_scale() {
ld good = compute_euclidean(); ld good = compute_euclidean();
println(hlog, "good = ", good);
if(around < 0) around = good; if(around < 0) around = good;
if(abs(good - around) < 1e-6) good = around; if(abs(good - around) < 1e-6) good = around;
@ -324,7 +319,6 @@ EX void compute_scale() {
} }
ld around_ideal = 1/(1/2. - 1./get_middle()); ld around_ideal = 1/(1/2. - 1./get_middle());
println(hlog, "around_ideal = ", around_ideal);
if(euclid) scale = 1; if(euclid) scale = 1;
else if(abs(around_ideal - around) < 1e-6) { else if(abs(around_ideal - around) < 1e-6) {
@ -336,15 +330,12 @@ EX void compute_scale() {
hyperpoint h = h0; hyperpoint h = h0;
auto h1 = h / h[WDIM] * scale; auto h1 = h / h[WDIM] * scale;
h1[WDIM] = 1; h1[WDIM] = 1;
println(hlog, "material = ", material(h1));
} }
else { else {
ld minscale = 0, maxscale = 10; ld minscale = 0, maxscale = 10;
for(int it=0; it<100; it++) { for(int it=0; it<100; it++) {
scale = (minscale + maxscale) / 2; scale = (minscale + maxscale) / 2;
ld ar = compute_around(false); ld ar = compute_around(false);
println(hlog, "scale = ", scale, " ar = ", ar);
if(sphere) { if(sphere) {
if(ar < around) maxscale = scale; if(ar < around) maxscale = scale;
else minscale = scale; else minscale = scale;