]> git.tdb.fi Git - netvis.git/commitdiff
Keep the local network in the center
authorMikko Rasa <tdb@tdb.fi>
Sun, 15 Jun 2014 08:44:53 +0000 (11:44 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 15 Jun 2014 08:44:53 +0000 (11:44 +0300)
source/host.cpp

index c18f117ba11d3dc360328ad0eb539c3d4e8939ed..fca3a304e545d29eefafd8201958020c92b6470e 100644 (file)
@@ -100,8 +100,9 @@ void Host::tick(const Msp::Time::TimeDelta &td)
                return;
 
        const map<unsigned, Host *> &hosts = netvis.get_hosts();
-       float fx = -pos.x*0.1;
-       float fy = -pos.y*0.1;
+       float center_force = (local ? 0.5 : 0.1);
+       float fx = -pos.x*center_force;
+       float fy = -pos.y*center_force;
        for(map<unsigned, Host *>::const_iterator i=hosts.begin(); i!=hosts.end(); ++i)
        {
                if(i->second!=this)