From b3ba7ad25ce0a6b76bcff21aaf1e8311b2198b4f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 31 Dec 2013 04:26:45 +0000 Subject: FDGL: Increase maximum simulation time to converge faster on larger graphs. git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5238 a436a847-0d15-0410-975c-d299462d15a1 --- src/Canvas.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Canvas.cpp b/src/Canvas.cpp index ca71017..b1d8900 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -741,12 +741,12 @@ apply_force(GanvNode* a, GanvNode* b, const Vector& f) gboolean GanvCanvasImpl::layout_iteration() { - static const double T_PER_US = .00001; // Sym time per real microsecond + static const double T_PER_US = .0001; // Sym time per real microsecond static uint64_t prev = 0; // Previous iteration time const uint64_t now = g_get_monotonic_time(); - const double time_to_run = std::min((now - prev) * T_PER_US, 1.0); + const double time_to_run = std::min((now - prev) * T_PER_US, 10.0); prev = now; @@ -768,7 +768,7 @@ GanvCanvasImpl::layout_calculate(double dur, bool update) static const double SPRING_K = 48.0; // A light directional force to push sources to the top left - static const double DIR_MAGNITUDE = -2800.0; + static const double DIR_MAGNITUDE = -2000.0; Vector dir = { 0.0, 0.0 }; switch (_gcanvas->direction) { case GANV_DIRECTION_RIGHT: dir.x = DIR_MAGNITUDE; break; @@ -838,7 +838,7 @@ GanvCanvasImpl::layout_calculate(double dur, bool update) const Vector mouth = { -100000.0, -100000.0 }; node->impl->force = vec_add( node->impl->force, - tide_force(mouth, reg.pos, 1000000000000.0)); + tide_force(mouth, reg.pos, 4000000000000.0)); FOREACH_ITEM(_items, j) { if (i == j || (!GANV_IS_MODULE(*i) && !GANV_IS_CIRCLE(*i))) { -- cgit v1.2.1