1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-19 19:54:47 +00:00

virtualRebase tohex works in Goldberg geometries

This commit is contained in:
Zeno Rogue 2018-09-27 21:51:29 +02:00
parent 1ea9c929b6
commit 1b11f4e5e2

View File

@ -289,6 +289,23 @@ void virtualRebase(cell*& base, T& at, bool tohex, const U& check) {
newbase = c;
}
}
if(tohex && GOLDBERG) {
while(true) {
newbase = NULL;
forCellCM(c2, base) {
transmatrix V2 = calc_relative_matrix(base, c2, C0);
double newz = check(V2 * at) [2];
if(newz < currz) {
currz = newz;
bestV = V2;
newbase = c2;
}
}
if(!newbase) break;
base = newbase;
at = bestV * at;
}
}
if(newbase) {
base = newbase;
at = bestV * at;