1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

improved geometry2 and displaydir functions for syntetic

This commit is contained in:
Zeno Rogue 2018-08-18 17:40:02 +02:00
parent dcee5d6d58
commit 5c90e6bcec
2 changed files with 11 additions and 5 deletions

View File

@ -355,8 +355,8 @@ hyperpoint get_corner_position(cell *c, int cid, ld cf) {
return mid_at_actual(vertices[cid], 3/cf);
}
if(syntetic) {
int id = synt::id_of(c->master);
return spin(M_PI / c->type * (2*cid+0)) * xpush(synt::circumradius[id/2] * 3 / cf) * C0;
auto& t = synt::get_triangle(c->master, cid);
return spin(-t.first) * xpush(t.second * 3 / cf) * C0;
}
if(nonbitrunc) {
return ddspin(c,cid,S6) * xpush0(hcrossf * 3 / cf);
@ -415,9 +415,10 @@ hyperpoint nearcorner(cell *c, int i) {
return mid_at(C0, nc, .94);
}
if(syntetic) {
auto& t = synt::get_triangle(c->master, i);
int id = synt::id_of(c->master);
auto& t1 = synt::triangles[id][i];
return spin(-t1.first) * xpush(t1.second) * C0;
int id1 = synt::get_adj(synt::get_adj(c->master, i), 2).first;
return spin(-t.first - M_PI / c->type) * xpush(synt::inradius[id/2] + synt::inradius[id1/2]) * C0;
}
if(binarytiling) {
ld yx = log(2) / 2;

View File

@ -235,7 +235,12 @@ void drawLightning(const transmatrix& V) {
}
int displaydir(cell *c, int d) {
if(irr::on) {
if(syntetic) {
auto& t1 = synt::get_triangle(c->master, d);
auto p = spin(-t1.first + M_PI / c->type) * xpush(t1.second) * C0;
return -int(atan2(p[1], p[0]) * S84 / 2 / M_PI + .5);
}
else if(irr::on) {
auto id = irr::cellindex[c];
auto& vs = irr::cells[id];
if(d < 0 || d >= c->type) return 0;