diff options
author | David Robillard <d@drobilla.net> | 2013-12-18 07:11:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-12-18 07:11:11 +0000 |
commit | b3bc9a7a3688aeac53d75befae2a6552d8bc5846 (patch) | |
tree | 0e8b9f84a0ca73746368c120be721aac56e3c8e9 /src/fdgl.hpp | |
parent | 3472b5ee6e691b1c24e20e1f885f260c5513d171 (diff) | |
download | ganv-b3bc9a7a3688aeac53d75befae2a6552d8bc5846.tar.gz ganv-b3bc9a7a3688aeac53d75befae2a6552d8bc5846.tar.bz2 ganv-b3bc9a7a3688aeac53d75befae2a6552d8bc5846.zip |
FDGL performance improvements.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5179 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/fdgl.hpp')
-rw-r--r-- | src/fdgl.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fdgl.hpp b/src/fdgl.hpp index 6bdb2e7..cabdba8 100644 --- a/src/fdgl.hpp +++ b/src/fdgl.hpp @@ -16,10 +16,10 @@ #include <float.h> #include <math.h> -static const double SPRING_K = 50.0; -static const double SPRING_LEN = 1.0; -static const double CHARGE_KE = 50000.0; -static const double AREA_WEIGHT = 0.25; +static const double SPRING_K = 12.0; +static const double SPRING_LEN = 0.1; +static const double CHARGE_KE = 80000.0; +static const double AREA_WEIGHT = 0.4; inline Vector vec_add(const Vector& a, const Vector& b) @@ -70,7 +70,7 @@ inline Vector repel_force(const Vector& a, const Vector& a_area, const Vector& b, const Vector& b_area) { - const Vector vec = vec_sub(a, b); + const Vector vec = vec_mult(vec_sub(a, b), 4.0); const double rmag = vec_rmag(vec); const Vector a_weight = vec_mult(a_area, AREA_WEIGHT); const Vector b_weight = vec_mult(b_area, AREA_WEIGHT); |