diff options
author | epoch <epoch@enzo.thebackupbox.net> | 2021-01-24 13:09:32 -0600 |
---|---|---|
committer | epoch <epoch@enzo.thebackupbox.net> | 2021-01-24 13:09:32 -0600 |
commit | 4feb44b2849b9c2779118f58991a295efb0727b9 (patch) | |
tree | 564c3589e7f994b130e7a49e61a27eb0d8b880b4 | |
parent | 03753a8a92e8c3dd25e4f067f13503a7d748a98d (diff) | |
download | hackvr-4feb44b2849b9c2779118f58991a295efb0727b9.tar.gz hackvr-4feb44b2849b9c2779118f58991a295efb0727b9.zip |
changed some constants in anonet map generator and swapped from maxdist to mindist in shitdist2()
-rwxr-xr-x | share/hackvr/examples/anonet_map/map | 5 | ||||
-rw-r--r-- | src/graphics_c3.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/share/hackvr/examples/anonet_map/map b/share/hackvr/examples/anonet_map/map index 4dbbdbd..976bb79 100755 --- a/share/hackvr/examples/anonet_map/map +++ b/share/hackvr/examples/anonet_map/map @@ -2,6 +2,7 @@ paths="$(ncat --recv-only 21.41.41.1 64777 | sort | uniq | tee ${PREFIX}/var/cache/hackvr/anonet_data.new)" MAP=${PREFIX}/var/cache/hackvr/anonet_map.hackvr +mkdir -p ${PREFIX}/var/cache/hackvr/ #see if the data actually changed before regenerating this shit... if cmp ${PREFIX}/var/cache/hackvr/anonet_data.new ${PREFIX}/var/cache/hackvr/anonet_data.old ; then @@ -17,7 +18,7 @@ nodes=$(printf "%s\n" "$paths" | tr ' ' '\n' | sort | uniq) nodes_count="$(printf "%s\n" "$nodes" | tr ' ' '\n' | wc -l | tr -cd '0-9')" #echo $nodes #echo $nodes_count -echo $USER move 0 0 -17 +echo $USER move 0 0 -20 coords="$( (for node in $nodes;do printf "AS%s addshape 4 2 0 8 0 0 0 0\n" "$node" printf "AS* rotate 0 0 +%d\n" "$[360 / ${nodes_count} ]" @@ -56,7 +57,7 @@ for node in $nodes;do printf "<whois://whois.ano/AS%s> addshape 5 4 -1 8 0 -1 10 0 1 10 0 1 8 0\n" "$node" printf "<whois://whois.ano/AS* rotate 0 0 +%d\n" "$[360 / ${nodes_count} ]" printf "<whois://whois.ano/AS* flatten\n" - makelabel.sh AS$node $( echo | awk "{print $(xcoord_by_ASN $node) * 13}" ) $( echo | awk "{print $(ycoord_by_ASN $node) * 13}" ) -10 <<< $node + makelabel.sh AS$node $( echo | awk "{print $(xcoord_by_ASN $node) * 13}" ) $( echo | awk "{print $(ycoord_by_ASN $node) * 13}" ) -19 <<< $node printf "AS%s scale .1 .1 .1\n" "$node" done | tee -a $MAP diff --git a/src/graphics_c3.c b/src/graphics_c3.c index 0fcee5d..cfd7dde 100644 --- a/src/graphics_c3.c +++ b/src/graphics_c3.c @@ -301,6 +301,7 @@ real shitdist(struct c3_shape *s,c3_t p) {//this function is a killer. :/ int i; real curdist=0; real maxdist=0; + real mindist=0; c3_group_rel_t *gr=get_group_relative(s->id); for(i=0;i< s->len+(s->len==1);i++) { if(gr) { @@ -309,8 +310,10 @@ real shitdist(struct c3_shape *s,c3_t p) {//this function is a killer. :/ curdist=shitdist2(p,s->p[i]);//if there's no gr we're basically just this point. no rotation, not offests. } if(curdist > maxdist) maxdist=curdist; + if(curdist < mindist) mindist=curdist; } - return maxdist; + return mindist; + //return maxdist; //averaging it works ok, but I've decided to now use the farthest to say the distance something is. //why the fuck did we get group rotations each... nevermind. this code just sucks. /* |