mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
rogueviz::hypcity:: spherical and Solv geometry
This commit is contained in:
parent
e5b87a1a36
commit
084fa5ea5e
@ -50,23 +50,25 @@ void prepare_tf() {
|
|||||||
low[i] = min(low[i], h[i]),
|
low[i] = min(low[i], h[i]),
|
||||||
high[i] = max(high[i], h[i]);
|
high[i] = max(high[i], h[i]);
|
||||||
|
|
||||||
if(hyperbolic) {
|
if(hyperbolic || sphere) {
|
||||||
|
|
||||||
hyperpoint hx;
|
hyperpoint hx;
|
||||||
hx[0] = h[0] * t * 2;
|
hx[0] = h[0] * t * 2;
|
||||||
hx[1] = h[1] * t * 2;
|
hx[1] = h[1] * t * 2;
|
||||||
hx[2] = 0;
|
hx[2] = 0;
|
||||||
hx[3] = 1;
|
hx[3] = 1;
|
||||||
hx = spin(45 * degree) * hx;
|
if(hyperbolic) hx = spin(45 * degree) * hx;
|
||||||
normalize(hx);
|
normalize(hx);
|
||||||
hx = zshift(hx, h[2]*(t*7));
|
hx = zshift(hx, h[2]*(t*(sphere ? 3 : 7)));
|
||||||
|
|
||||||
return {0, hx};
|
return {0, hx};
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nil) {
|
if(nil || sol) {
|
||||||
swap(h[1], h[2]);
|
if(nil) swap(h[1], h[2]);
|
||||||
h *= 0.5 / 0.378;
|
h *= 0.5 / 0.378;
|
||||||
|
if(sol) h *= vid.binary_width;
|
||||||
|
if(nil) h *= nilv::nilwidth;
|
||||||
h[3] = 1;
|
h[3] = 1;
|
||||||
return {0, h};
|
return {0, h};
|
||||||
}
|
}
|
||||||
@ -83,6 +85,11 @@ bool draw_city_at(cell *c, const shiftmatrix& V) {
|
|||||||
if(co[1]) return false;
|
if(co[1]) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sol) {
|
||||||
|
auto co = c->master->distance;
|
||||||
|
if(co) return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(c == cwt.at || true)
|
if(c == cwt.at || true)
|
||||||
city.render(V);
|
city.render(V);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user