mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-06 11:32:49 +00:00
edge subdivision now works better in quotient spaces
This commit is contained in:
parent
a004afda21
commit
286ef689a7
15
rogueviz.cpp
15
rogueviz.cpp
@ -148,9 +148,12 @@ void notimpl() {
|
|||||||
printf("Not implemented\n"); exit(1);
|
printf("Not implemented\n"); exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
hyperpoint where(int i) {
|
hyperpoint where(int i, cell *base) {
|
||||||
auto m = vdata[i].m;
|
auto m = vdata[i].m;
|
||||||
if(m->base == currentmap->gamestart()) return tC0(m->at);
|
if(m->base == base) return tC0(m->at);
|
||||||
|
else if(quotient || elliptic || torus) {
|
||||||
|
return shmup::calc_relative_matrix(m->base, base, NOHINT) * tC0(m->at);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// notimpl(); // actually probably that's a buug
|
// notimpl(); // actually probably that's a buug
|
||||||
return inverse(shmup::ggmatrix(currentmap->gamestart())) * (shmup::ggmatrix(m->base) * tC0(m->at));
|
return inverse(shmup::ggmatrix(currentmap->gamestart())) * (shmup::ggmatrix(m->base) * tC0(m->at));
|
||||||
@ -158,8 +161,10 @@ hyperpoint where(int i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void addedge(int i, int j, edgeinfo *ei) {
|
void addedge(int i, int j, edgeinfo *ei) {
|
||||||
hyperpoint hi = where(i);
|
cell *base =
|
||||||
hyperpoint hj = where(j);
|
(quotient || elliptic || torus) ? vdata[i].m->base : currentmap->gamestart();
|
||||||
|
hyperpoint hi = where(i, base);
|
||||||
|
hyperpoint hj = where(j, base);
|
||||||
double d = hdist(hi, hj);
|
double d = hdist(hi, hj);
|
||||||
if(d >= 4) {
|
if(d >= 4) {
|
||||||
// printf("splitting %lf\n", d);
|
// printf("splitting %lf\n", d);
|
||||||
@ -170,7 +175,7 @@ void addedge(int i, int j, edgeinfo *ei) {
|
|||||||
vd.cp = colorpair(0x400000FF);
|
vd.cp = colorpair(0x400000FF);
|
||||||
vd.virt = ei;
|
vd.virt = ei;
|
||||||
|
|
||||||
createViz(id, currentmap->gamestart(), rgpushxto0(h));
|
createViz(id, base, rgpushxto0(h));
|
||||||
|
|
||||||
addedge(i, id, ei);
|
addedge(i, id, ei);
|
||||||
addedge(id, j, ei);
|
addedge(id, j, ei);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user