aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorN.N. <nimon@users.sourceforge.net>2015-03-06 22:46:31 +0000
committerN.N. <nimon@users.sourceforge.net>2015-03-06 22:46:31 +0000
commit1137b3860fce28495161ad61d6f04c8350f2da4d (patch)
tree13104529a3945eaad1eb1966b38d5991be10b679
parent1c1bb745a181cb7d3e931cb290251e2b2ae025ac (diff)
changed the usage of power in interactors
svn path=/trunk/externals/pmpd/; revision=17437
-rw-r--r--pmpd2d_interactor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pmpd2d_interactor.c b/pmpd2d_interactor.c
index e02fa9e..009b8fb 100644
--- a/pmpd2d_interactor.c
+++ b/pmpd2d_interactor.c
@@ -26,10 +26,10 @@ void pmpd2d_iCircle_i(t_pmpd2d *x, int i, t_float a, t_float b, t_float r, t_flo
if ( (distance>Rmin) && (distance<=Rmax) )
{
- tmp = -pow_ch(K * distance, power);
+ tmp = -pow_ch(distance, power)*K;
x->mass[i].forceX += X * tmp;
x->mass[i].forceY += Y * tmp;
- tmp = -pow_ch(Kt * distance, power);
+ tmp = -pow_ch(distance, power)*Kt;
x->mass[i].forceX += -Y * tmp;
x->mass[i].forceY += X * tmp;
@@ -66,11 +66,11 @@ void pmpd2d_iCircle(t_pmpd2d *x, t_symbol *s, int argc, t_atom *argv)
K = atom_getfloatarg(4, argc, argv);
power = atom_getfloatarg(5, argc, argv);
- if (power == 0) power = 1;
+ //if (power == 0) power = 1;
Kt = atom_getfloatarg(6, argc, argv);
powert = atom_getfloatarg(7, argc, argv);
- if (powert == 0) powert = 1;
+ //if (powert == 0) powert = 1;
Rmin = 0;
if ((argc>=9) && (argv[8].a_type == A_FLOAT)) { Rmin = (atom_getfloatarg(8,argc,argv));}
@@ -110,7 +110,7 @@ void pmpd2d_iLine_i(t_pmpd2d *x, int i, t_float a, t_float b, t_float c, t_float
if ( (distance>Rmin) && (distance<=Rmax) )
{
- force = -pow_ch(K * distance, power);
+ force = -pow_ch(distance, power)*K;
x->mass[i].forceX += a * force;
x->mass[i].forceY += b * force;
}