aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Henry <nusmuk@users.sourceforge.net>2014-01-22 20:15:42 +0000
committerCyrille Henry <nusmuk@users.sourceforge.net>2014-01-22 20:15:42 +0000
commita11aaea4ba7d393d4b419b1a550dee5c4555e41d (patch)
tree017e170cedcf765cb003bb91ddbb403f588aa9f7
parenta6412ad046445d2b617b6170eacaf2ed21e34d7b (diff)
small bug in line interactor
svn path=/trunk/externals/pmpd/; revision=17240
-rw-r--r--pmpd2d_interactor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pmpd2d_interactor.c b/pmpd2d_interactor.c
index fabef67..86cbaf6 100644
--- a/pmpd2d_interactor.c
+++ b/pmpd2d_interactor.c
@@ -104,7 +104,7 @@ void pmpd2d_iLine_i(t_pmpd2d *x, int i, t_float a, t_float b, t_float c, t_float
{
t_float distance, force;
- distance = ( (a * x->mass[i].posX) + (b * x->mass[i].posY) ) - c;
+ distance = (a * x->mass[i].posX) + (b * x->mass[i].posY) + c;
if ( (distance>Rmin) && (distance<=Rmax) )
{
@@ -156,7 +156,9 @@ void pmpd2d_iLine(t_pmpd2d *x, t_symbol *s, int argc, t_atom *argv)
// line equation : aX + bY + c = 0
K = atom_getfloatarg(5, argc, argv);
- power = atom_getfloatarg(6, argc, argv);
+
+ power = 1;
+ if ((argc>=7) && (argv[6].a_type == A_FLOAT)) { power = atom_getfloatarg(6, argc, argv);}
if (power == 0) power = 1;
Rmin = -1000000;