1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 09:30:35 +00:00

fixed spiral/hilbert tracks

This commit is contained in:
Zeno Rogue 2024-08-18 21:17:50 +02:00
parent 4e450d4330
commit 9d680953e2

View File

@ -613,7 +613,7 @@ struct complex_surface {
hyperpoint cur; hyperpoint cur;
map<pair<int, int>, surface_fun> blocks; map<pair<int, int>, surface_fun> blocks;
static transmatrix flatpush(hyperpoint h) { return rgpushxto0(point31(h[0], h[1], rot_plane(h))); } static transmatrix flatpush(hyperpoint h) { return rgpushxto0(point31(h[0], h[1], 0)); }
static transmatrix hpush(hyperpoint h) { h[1] = 0; h[2] = 0; return flatpush(h); } static transmatrix hpush(hyperpoint h) { h[1] = 0; h[2] = 0; return flatpush(h); }
static transmatrix vpush(hyperpoint h) { h[0] = 0; h[2] = 0; return flatpush(h); } static transmatrix vpush(hyperpoint h) { h[0] = 0; h[2] = 0; return flatpush(h); }
@ -751,7 +751,7 @@ struct complex_surface {
ld get(hyperpoint h) { ld get(hyperpoint h) {
int ax = int(floor(h[0] / 4)); int ax = int(floor(h[0] / 4));
int ay = int(floor(h[1] / 4)); int ay = int(floor(h[1] / 4));
if(blocks.count({ax, ay})) return blocks[{ax, ay}] (h); if(blocks.count({ax, ay})) return blocks[{ax, ay}] (h) + h[0] * h[1] / 2;
return 0; return 0;
} }