mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-01 21:10:35 +00:00
cellrelmatrix and cellgfxdist implemented efficiently for euwrap geometries
This commit is contained in:
parent
f522dbe46a
commit
c993e80a18
@ -363,6 +363,10 @@ void virtualRebaseSimple(heptagon*& base, transmatrix& at) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
double cellgfxdist(cell *c, int i) {
|
double cellgfxdist(cell *c, int i) {
|
||||||
|
if(euclid) {
|
||||||
|
if(c->type == 8 && (i&1)) return eurad * sqrt(2);
|
||||||
|
return eurad;
|
||||||
|
}
|
||||||
if(NONSTDVAR || archimedean) return hdist0(tC0(calc_relative_matrix(c->move(i), c, i)));
|
if(NONSTDVAR || archimedean) return hdist0(tC0(calc_relative_matrix(c->move(i), c, i)));
|
||||||
return !BITRUNCATED ? tessf : (c->type == 6 && (i&1)) ? hexhexdist : crossf;
|
return !BITRUNCATED ? tessf : (c->type == 6 && (i&1)) ? hexhexdist : crossf;
|
||||||
}
|
}
|
||||||
@ -370,7 +374,10 @@ double cellgfxdist(cell *c, int i) {
|
|||||||
transmatrix cellrelmatrix(cell *c, int i) {
|
transmatrix cellrelmatrix(cell *c, int i) {
|
||||||
if(NONSTDVAR || archimedean) return calc_relative_matrix(c->move(i), c, i);
|
if(NONSTDVAR || archimedean) return calc_relative_matrix(c->move(i), c, i);
|
||||||
double d = cellgfxdist(c, i);
|
double d = cellgfxdist(c, i);
|
||||||
return ddspin(c, i) * xpush(d) * iddspin(c->move(i), c->c.spin(i), euclid ? 0 : M_PI);
|
transmatrix T = ddspin(c, i) * xpush(d);
|
||||||
|
if(c->c.mirror(i)) T = T * Mirror;
|
||||||
|
T = T * iddspin(c->move(i), c->c.spin(i), M_PI);
|
||||||
|
return T;
|
||||||
}
|
}
|
||||||
|
|
||||||
double randd() { return (rand() + .5) / (RAND_MAX + 1.); }
|
double randd() { return (rand() + .5) / (RAND_MAX + 1.); }
|
||||||
|
Loading…
Reference in New Issue
Block a user