1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-14 04:37:10 +00:00

export some aux level-related functions

This commit is contained in:
Zeno Rogue
2025-09-09 13:34:29 +02:00
parent 52bc6411fa
commit ff8e4fae1d

View File

@@ -1000,17 +1000,17 @@ EX namespace geom3 {
return tanh(abslev) / tanh(vid.camera); return tanh(abslev) / tanh(vid.camera);
} }
ld projection_to_abslev(ld proj) { EX ld projection_to_abslev(ld proj) {
if(sphere || euclid) return proj-vid.camera; if(sphere || euclid) return proj-vid.camera;
// tanh(abslev) / tanh(camera) = proj // tanh(abslev) / tanh(camera) = proj
return atanh(proj * tanh(vid.camera)); return atanh(proj * tanh(vid.camera));
} }
ld lev_to_projection(ld lev) { EX ld lev_to_projection(ld lev) {
return abslev_to_projection(vid.depth - lev); return abslev_to_projection(vid.depth - lev);
} }
ld projection_to_factor(ld proj) { EX ld projection_to_factor(ld proj) {
return lev_to_projection(0) / proj; return lev_to_projection(0) / proj;
} }