mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-23 15:36:59 +00:00
arcm:: improved graphics on dihedra and hosohedra
This commit is contained in:
parent
791603d4b0
commit
6edc257f28
@ -59,6 +59,8 @@ struct archimedean_tiling {
|
||||
int support_threecolor();
|
||||
int support_football();
|
||||
bool support_chessboard();
|
||||
|
||||
ld scale();
|
||||
};
|
||||
|
||||
archimedean_tiling current;
|
||||
@ -343,6 +345,13 @@ void archimedean_tiling::compute_geometry() {
|
||||
|
||||
}
|
||||
|
||||
ld archimedean_tiling::scale() {
|
||||
if(real_faces == 0 && N == 2) return M_PI / 2;
|
||||
if(real_faces == 2) return M_PI / 2;
|
||||
if(real_faces == 0) return 2 * M_PI / N;
|
||||
return edgelength;
|
||||
}
|
||||
|
||||
map<heptagon*, vector<pair<heptagon*, transmatrix> > > altmap;
|
||||
|
||||
map<heptagon*, pair<heptagon*, transmatrix>> archimedean_gmatrix;
|
||||
|
@ -398,7 +398,7 @@ hyperpoint get_corner_position(cell *c, int cid, ld cf) {
|
||||
auto &ac = arcm::current;
|
||||
if(arcm::id_of(c->master) >= ac.N*2) return C0;
|
||||
auto& t = ac.get_triangle(c->master, cid-1);
|
||||
return xspinpush0(-t.first, t.second * 3 / cf);
|
||||
return xspinpush0(-t.first, t.second * 3 / cf * (ac.real_faces == 0 ? 0.999 : 1));
|
||||
}
|
||||
if(nonbitrunc) {
|
||||
return ddspin(c,cid,M_PI/S7) * xpush0(hcrossf * 3 / cf);
|
||||
@ -430,7 +430,7 @@ hyperpoint nearcorner(cell *c, int i) {
|
||||
auto& t = ac.get_triangle(c->master, i-1);
|
||||
int id = arcm::id_of(c->master);
|
||||
int id1 = ac.get_adj(ac.get_adj(c->master, i-1), -2).first;
|
||||
return xspinpush0(-t.first - M_PI / c->type, ac.inradius[id/2] + ac.inradius[id1/2]);
|
||||
return xspinpush0(-t.first - M_PI / c->type, ac.inradius[id/2] + ac.inradius[id1/2] + (ac.real_faces == 0 ? 2 * M_PI / (ac.N == 2 ? 2.1 : ac.N) : 0));
|
||||
}
|
||||
if(binarytiling) {
|
||||
ld yx = log(2) / 2;
|
||||
|
@ -1385,7 +1385,7 @@ transmatrix ddi(int a, ld x) { return xspinpush(a * M_PI / S42, x); }
|
||||
|
||||
void drawTentacle(hpcshape &h, ld rad, ld var, ld divby) {
|
||||
double tlength = max(crossf, hexhexdist * gp::scale * irr::scale);
|
||||
if(archimedean) tlength = arcm::current.edgelength;
|
||||
if(archimedean) tlength = arcm::current.scale();
|
||||
int max = int(20 * pow(2, vid.linequality));
|
||||
for(ld i=0; i<=max; i++)
|
||||
hpcpush(ddi(S21, rad + var * sin(i * M_PI/divby)) * ddi(0, tlength * i/max) * C0);
|
||||
@ -1689,7 +1689,7 @@ void buildpolys() {
|
||||
}
|
||||
|
||||
if(archimedean) {
|
||||
triangleside = xcrossf = arcm::current.edgelength;
|
||||
triangleside = xcrossf = arcm::current.scale();
|
||||
goldbf = 1;
|
||||
scalef = xcrossf / hcrossf7;
|
||||
floorrad0 = floorrad1 = triangleside * .45;
|
||||
@ -2051,7 +2051,7 @@ void buildpolys() {
|
||||
if(a47 && !nonbitrunc) spzoom6 *= .85;
|
||||
|
||||
if(archimedean)
|
||||
shFullFloor.configure(arcm::current.edgelength/2, arcm::current.edgelength/2);
|
||||
shFullFloor.configure(arcm::current.scale()/2, arcm::current.scale()/2);
|
||||
else
|
||||
shFullFloor.configure(hexvdist, rhexf);
|
||||
shFloor.configure(floorrad0, floorrad1);
|
||||
|
Loading…
Reference in New Issue
Block a user