1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-05 03:47:58 +00:00

embeddings:: implemented the cylinderHE embedding

This commit is contained in:
Zeno Rogue
2023-01-27 11:16:34 +01:00
parent 9e2059e72b
commit d7fe4af1e9
3 changed files with 42 additions and 1 deletions

View File

@@ -241,6 +241,8 @@ void horo_distance::become(hyperpoint h1) {
a = 0, b = hdist(h1, C0);
else if(cgi.emb->is_euc_in_product())
a = 0, b = hdist(h1, C0);
else if(cgi.emb->is_cylinder())
a = 0, b = hdist(h1, tile_center());
else
a = 0, b = intval(h1, tile_center());
}
@@ -253,6 +255,8 @@ horo_distance::horo_distance(shiftpoint h1, const shiftmatrix& T) {
if(sn::in() || mhybrid || nil || sl2) become(inverse_shift(T, h1));
else if(cgi.emb->is_euc_in_product())
a = 0, b = hdist(h1.h, unshift(T * tile_center(), h1.shift));
else if(cgi.emb->is_cylinder())
a = 0, b = hdist(h1.h, unshift(T * tile_center(), h1.shift));
else
a = 0, b = intval(h1.h, unshift(T * tile_center(), h1.shift));
}