mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
approx_distance in Sol
This commit is contained in:
parent
5d7ea94246
commit
875af54063
1
cell.cpp
1
cell.cpp
@ -880,6 +880,7 @@ int heptdistance(heptagon *h1, heptagon *h2) {
|
||||
#if CAP_CRYSTAL
|
||||
if(geometry == gCrystal) return crystal::space_distance(h1->c7, h2->c7);
|
||||
#endif
|
||||
if(sol) return solv::approx_distance(h1, h2);
|
||||
while(true) {
|
||||
if(h1 == h2) return d;
|
||||
for(int i=0; i<S7; i++) if(h1->move(i) == h2) return d + 1;
|
||||
|
11
sol.cpp
11
sol.cpp
@ -393,7 +393,16 @@ namespace solv {
|
||||
|
||||
return rspintox(inverse(back_Position) * back_goal);
|
||||
}
|
||||
|
||||
|
||||
int approx_distance(heptagon *h1, heptagon *h2) {
|
||||
auto m = (hrmap_sol*) currentmap;
|
||||
dynamicval<eGeometry> g(geometry, gBinary4);
|
||||
dynamicval<hrmap*> cm(currentmap, m->binary_map);
|
||||
int d1 = binary::celldistance3_approx(m->coords[h1].first, m->coords[h2].first);
|
||||
int d2 = binary::celldistance3_approx(m->coords[h1].second, m->coords[h2].second);
|
||||
return d1 + d2 - abs(h1->distance - h2->distance);
|
||||
}
|
||||
|
||||
string solshader =
|
||||
"uniform mediump sampler3D tInvExpTable;"
|
||||
"uniform mediump float PRECX, PRECY, PRECZ;"
|
||||
|
Loading…
Reference in New Issue
Block a user