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

Hyperboloid/Hemisphere models improved on sphere/Euclidean oto

This commit is contained in:
Zeno Rogue 2018-10-25 20:14:45 +02:00
parent d89882a30d
commit 77837e0810

View File

@ -187,7 +187,7 @@ bool two_sided_model() {
if(pmodel == mdHyperboloid) return !euclid; if(pmodel == mdHyperboloid) return !euclid;
// if(pmodel == mdHemisphere) return true; // if(pmodel == mdHemisphere) return true;
if(pmodel == mdDisk) return sphere; if(pmodel == mdDisk) return sphere;
if(pmodel == mdHemisphere) return !euclid; if(pmodel == mdHemisphere) return true;
return false; return false;
} }
@ -200,7 +200,9 @@ int get_side(const hyperpoint& H) {
} }
if(pmodel == mdHyperboloid && hyperbolic) if(pmodel == mdHyperboloid && hyperbolic)
return (conformal::sin_ball * H[2] > -conformal::cos_ball * H[1]) ? -1 : 1; return (conformal::sin_ball * H[2] > -conformal::cos_ball * H[1]) ? -1 : 1;
if(pmodel == mdHemisphere || pmodel == mdHyperboloid) { if(pmodel == mdHyperboloid && sphere)
return (conformal::sin_ball * H[2] > conformal::cos_ball * H[1]) ? -1 : 1;
if(pmodel == mdHemisphere) {
hyperpoint res; hyperpoint res;
applymodel(H, res); applymodel(H, res);
return res[2] < 0 ? -1 : 1; return res[2] < 0 ? -1 : 1;
@ -959,7 +961,7 @@ void dqi_poly::draw() {
if(around_center) return; if(around_center) return;
} }
if(((sphere && (spherespecial > 0 || equi)) || (pmodel == mdJoukowsky && hyperbolic) || (pmodel == mdDisk && hyperbolic && vid.alpha <= -1)) && !(poly_flags & POLY_ISSIDE)) { if(((sphere && pmodel == mdDisk && (spherespecial > 0 || equi)) || (pmodel == mdJoukowsky && hyperbolic) || (pmodel == mdDisk && hyperbolic && vid.alpha <= -1)) && !(poly_flags & POLY_ISSIDE)) {
if(!tinf) if(!tinf)
compute_side_by_centerin(this, nofill); compute_side_by_centerin(this, nofill);
@ -1353,7 +1355,7 @@ void drawqueue() {
// on the sphere, parts on the back are drawn first // on the sphere, parts on the back are drawn first
if(two_sided_model()) { if(two_sided_model()) {
if(pmodel == mdHyperboloid) { if(pmodel == mdHyperboloid && hyperbolic) {
dynamicval dv(pmodel, mdHyperboloidFlat); dynamicval dv(pmodel, mdHyperboloidFlat);
for(auto& ptd: ptds) for(auto& ptd: ptds)
if(!among(ptd->prio, PPR::MOBILE_ARROW, PPR::OUTCIRCLE, PPR::CIRCLE)) if(!among(ptd->prio, PPR::MOBILE_ARROW, PPR::OUTCIRCLE, PPR::CIRCLE))