From 08108c342cfe4c1ca38774bc0caf35a14a8317cd Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 5 Oct 2019 12:33:00 +0200 Subject: [PATCH] aura in the fisheye projection, also minor optimization --- graph.cpp | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/graph.cpp b/graph.cpp index ae1bc758..836e6d54 100644 --- a/graph.cpp +++ b/graph.cpp @@ -2874,11 +2874,15 @@ EX ld straightDownSpeed; array,AURA+1> aurac; -EX bool haveaura() { - if(!(vid.aurastr>0 && !svg::in && (auraNOGL || vid.usingGL))) return false; - if(sphere && mdAzimuthalEqui()) return true; +int haveaura_cached; + +/** 0 = no aura, 1 = standard aura, 2 = Joukowsky aura */ +EX int haveaura() { + if(!(vid.aurastr>0 && !svg::in && (auraNOGL || vid.usingGL))) return 0; + if(sphere && mdAzimuthalEqui()) return 0; if(among(pmodel, mdJoukowsky, mdJoukowskyInverted) && hyperbolic && models::model_transition < 1) - return true; + return 2; + if(pmodel == mdFisheye) return 1; return pmodel == mdDisk && (!sphere || vid.alpha > 10) && !euclid; } @@ -2886,8 +2890,9 @@ vector > auraspecials; int auramemo; -EX void clearaura() { - if(!haveaura()) return; +EX void clearaura() { + haveaura_cached = haveaura(); + if(!haveaura_cached) return; for(int a=0; aradius; if(sphere && !mdAzimuthalEqui()) rad /= sqrt(vid.alpha*vid.alpha - 1); + if(hyperbolic && pmodel == mdFisheye) { + ld h = 1; + h /= vid.fisheye_param; + ld nrad = h / sqrt(2 + h*h); + rad *= nrad; + } for(int v=0; v<4; v++) sumaura(v); for(auto& p: auraspecials) {