From a11aaea4ba7d393d4b419b1a550dee5c4555e41d Mon Sep 17 00:00:00 2001 From: Cyrille Henry Date: Wed, 22 Jan 2014 20:15:42 +0000 Subject: small bug in line interactor svn path=/trunk/externals/pmpd/; revision=17240 --- pmpd2d_interactor.c | 6 ++++-- 1 file 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; -- cgit v1.2.1