mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-24 05:17:17 +00:00
changing the 3D parameters sometimes did not work correctly in non-hyperbolic geometry while it should.
This commit is contained in:
parent
4776784be3
commit
bbf32af738
14
geometry.cpp
14
geometry.cpp
@ -265,16 +265,16 @@ namespace geom3 {
|
|||||||
invalid = "";
|
invalid = "";
|
||||||
|
|
||||||
if(tc_alpha < tc_depth && tc_alpha < tc_camera)
|
if(tc_alpha < tc_depth && tc_alpha < tc_camera)
|
||||||
vid.alpha = tanh(depth) / tanh(camera);
|
vid.alpha = tan_auto(depth) / tan_auto(camera);
|
||||||
else if(tc_depth < tc_alpha && tc_depth < tc_camera) {
|
else if(tc_depth < tc_alpha && tc_depth < tc_camera) {
|
||||||
ld v = vid.alpha * tanh(camera);
|
ld v = vid.alpha * tan_auto(camera);
|
||||||
if(v<-1 || v>1) invalid = "cannot adjust depth", depth = camera;
|
if(hyperbolic && (v<1e-6-12 || v>1-1e-12)) invalid = "cannot adjust depth", depth = camera;
|
||||||
else depth = atanh(v);
|
else depth = atan_auto(v);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ld v = tanh(depth) / vid.alpha;
|
ld v = tan_auto(depth) / vid.alpha;
|
||||||
if(v<-1 || v>1) invalid = "cannot adjust camera", camera = depth;
|
if(hyperbolic && (v<1e-12-1 || v>1-1e-12)) invalid = "cannot adjust camera", camera = depth;
|
||||||
else camera = atanh(v);
|
else camera = atan_auto(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fabs(vid.alpha) < 1e-6) invalid = "does not work with perfect Klein";
|
if(fabs(vid.alpha) < 1e-6) invalid = "does not work with perfect Klein";
|
||||||
|
Loading…
Reference in New Issue
Block a user