mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-22 23:17:04 +00:00
hrmap_standard now can be 3D maps
This commit is contained in:
parent
a1fbfb2946
commit
aed8df0d04
6
cell.cpp
6
cell.cpp
@ -70,7 +70,11 @@ struct hrmap {
|
|||||||
virtual double spacedist(cell *c, int i) { return hdist0(tC0(adj(c, i))); }
|
virtual double spacedist(cell *c, int i) { return hdist0(tC0(adj(c, i))); }
|
||||||
};
|
};
|
||||||
|
|
||||||
/** hrmaps which are based on regular non-Euclidean 2D tilings, possibly quotient */
|
/** hrmaps which are based on regular non-Euclidean 2D tilings, possibly quotient
|
||||||
|
* Operators can be applied to these maps.
|
||||||
|
* Liskov substitution warning: maps which produce both tiling like above and 3D tilings
|
||||||
|
* (e.g. Euclidean and Crystal) also inherit from hrmap_standard
|
||||||
|
**/
|
||||||
struct hrmap_standard : hrmap {
|
struct hrmap_standard : hrmap {
|
||||||
void draw() override;
|
void draw() override;
|
||||||
transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override;
|
transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override;
|
||||||
|
@ -358,7 +358,9 @@ transmatrix hrmap_standard::adj(cell *c, int i) {
|
|||||||
else
|
else
|
||||||
println(hlog, "gpadj not found");
|
println(hlog, "gpadj not found");
|
||||||
}
|
}
|
||||||
if(NONSTDVAR) return calc_relative_matrix(c->cmove(i), c, C0);
|
if(NONSTDVAR || WDIM == 3) {
|
||||||
|
return calc_relative_matrix(c->cmove(i), c, C0);
|
||||||
|
}
|
||||||
double d = cellgfxdist(c, i);
|
double d = cellgfxdist(c, i);
|
||||||
transmatrix T = ddspin(c, i) * xpush(d);
|
transmatrix T = ddspin(c, i) * xpush(d);
|
||||||
if(c->c.mirror(i)) T = T * Mirror;
|
if(c->c.mirror(i)) T = T * Mirror;
|
||||||
|
Loading…
Reference in New Issue
Block a user