diff options
-rw-r--r-- | pmpd.c | 2 | ||||
-rw-r--r-- | pmpd2d.c | 6 | ||||
-rw-r--r-- | pmpd2d_set.c | 6 | ||||
-rw-r--r-- | pmpd3d_set.c | 2 | ||||
-rw-r--r-- | pmpd_core.c | 10 | ||||
-rw-r--r-- | pmpd_set.c | 2 | ||||
-rw-r--r-- | pmpd_tab.c | 6 | ||||
-rw-r--r-- | pmpd_test.c | 6 |
8 files changed, 17 insertions, 23 deletions
@@ -162,7 +162,7 @@ void pmpd_setup(void) class_addmethod(pmpd_class, (t_method)pmpd_linksPosSpeedT, gensym("linkPosSpeedXT"), A_GIMME, 0);
class_addmethod(pmpd_class, (t_method)pmpd_linksLengthSpeedT, gensym("linkLengthSpeedXT"), A_GIMME, 0);
- class_addmethod(pmpd_class, (t_method)pmpd_linksEndT, gensym("linksEndT"), A_GIMME, 0);
+ class_addmethod(pmpd_class, (t_method)pmpd_linkEndT, gensym("linksEndT"), A_GIMME, 0);
class_addmethod(pmpd_class, (t_method)pmpd_linkEnd1T, gensym("linkEnd1T"), A_GIMME, 0);
class_addmethod(pmpd_class, (t_method)pmpd_linkEnd2T, gensym("linkEnd2T"), A_GIMME, 0);
class_addmethod(pmpd_class, (t_method)pmpd_linkEndT, gensym("linkEndXT"), A_GIMME, 0);
@@ -95,9 +95,9 @@ void pmpd2d_setup(void) class_addmethod(pmpd2d_class, (t_method)pmpd2d_posX, gensym("setPosX"), A_GIMME, 0);
class_addmethod(pmpd2d_class, (t_method)pmpd2d_posY, gensym("setPosY"), A_GIMME, 0);
class_addmethod(pmpd2d_class, (t_method)pmpd2d_overdamp, gensym("setOverdamp"), A_GIMME, 0);
- class_addmethod(pmpd3d_class, (t_method)pmpd2d_setEnd1, gensym("setEnd1"), A_GIMME, 0);
- class_addmethod(pmpd3d_class, (t_method)pmpd2d_setEnd2, gensym("setEnd2"), A_GIMME, 0);
- class_addmethod(pmpd3d_class, (t_method)pmpd2d_setEnd, gensym("setEnd"), A_GIMME, 0);
+ class_addmethod(pmpd2d_class, (t_method)pmpd2d_setEnd1, gensym("setEnd1"), A_GIMME, 0);
+ class_addmethod(pmpd2d_class, (t_method)pmpd2d_setEnd2, gensym("setEnd2"), A_GIMME, 0);
+ class_addmethod(pmpd2d_class, (t_method)pmpd2d_setEnd, gensym("setEnd"), A_GIMME, 0);
/*
pmpd2d_get
--
diff --git a/pmpd2d_set.c b/pmpd2d_set.c index aa13697..2c448c1 100644 --- a/pmpd2d_set.c +++ b/pmpd2d_set.c @@ -446,7 +446,7 @@ void pmpd2d_setForceY(t_pmpd2d *x, t_symbol *s, int argc, t_atom *argv) } } -void pmpd2d_setActivei(t_pmpd3d *x, int i) +void pmpd2d_setActivei(t_pmpd2d *x, int i) { float Lx, Ly, L; Lx = x->link[i].mass1->posX - x->link[i].mass2->posX; @@ -472,7 +472,7 @@ void pmpd2d_setActive(t_pmpd2d *x, t_symbol *s, int argc, t_atom *argv) { if ( atom_getsymbolarg(0,argc,argv) == x->link[i].Id ) { - pmpd2d_setActivei(x,tmp); + pmpd2d_setActivei(x,i); } } } @@ -480,7 +480,7 @@ void pmpd2d_setActive(t_pmpd2d *x, t_symbol *s, int argc, t_atom *argv) { for (i=0; i< x->nb_link; i++) { - pmpd2d_setActivei(x,tmp); + pmpd2d_setActivei(x,i); } } } diff --git a/pmpd3d_set.c b/pmpd3d_set.c index 7592e45..337c8b1 100644 --- a/pmpd3d_set.c +++ b/pmpd3d_set.c @@ -146,7 +146,7 @@ void pmpd3d_setLCurrent(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) { // set a link to it's current length tmp = atom_getfloatarg(0, argc, argv); tmp = max(0, min( x->nb_link-1, tmp)); - x->link[tmp].L = x->link[i].distance; + x->link[tmp].L = x->link[tmp].distance; } else if ( ( argc == 1 ) && ( argv[0].a_type == A_SYMBOL ) ) { // set a class of link to there current length diff --git a/pmpd_core.c b/pmpd_core.c index 1d1e673..a56753d 100644 --- a/pmpd_core.c +++ b/pmpd_core.c @@ -74,11 +74,11 @@ void pmpd_bang(t_pmpd *x) // amplify force that opose to movement if (x->mass[i].overdamp != 0) { - tmp = x->mass[i].speedX * x->mass[i].forceX; - tmp = min(0,tmp); // overdamped only if force opose movment - tmp *= -x->mass[i].overdamp; - tmp += 1; - x->mass[i].forceX *= tmp; + tmpX = x->mass[i].speedX * x->mass[i].forceX; + tmpX = min(0,tmpX); // overdamped only if force opose movment + tmpX *= -x->mass[i].overdamp; + tmpX += 1; + x->mass[i].forceX *= tmpX; } x->mass[i].speedX += x->mass[i].forceX * x->mass[i].invM; @@ -118,7 +118,7 @@ void pmpd_setLCurrent(t_pmpd *x, t_symbol *s, int argc, t_atom *argv) { // set a link to it's current length tmp = atom_getfloatarg(0, argc, argv); tmp = max(0, min( x->nb_link-1, tmp)); - x->link[tmp].L = x->link[i].distance; + x->link[tmp].L = x->link[tmp].distance; } else if ( ( argc == 1 ) && ( argv[0].a_type == A_SYMBOL ) ) { // set a class of link to there current length @@ -348,7 +348,7 @@ void pmpd_linksLengthSpeedT(t_pmpd *x, t_symbol *s, int argc, t_atom *argv) } } -void pmpd_linksEndT(t_pmpd *x, t_symbol *s, int argc, t_atom *argv) +void pmpd_linkEndT(t_pmpd *x, t_symbol *s, int argc, t_atom *argv) { int i, j, vecsize; t_garray *a; @@ -401,7 +401,7 @@ void pmpd_linksEndT(t_pmpd *x, t_symbol *s, int argc, t_atom *argv) } } -void pmpd3d_linkEnd1T(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) +void pmpd_linkEnd1T(t_pmpd *x, t_symbol *s, int argc, t_atom *argv) { int i, j, vecsize; t_garray *a; @@ -451,7 +451,7 @@ void pmpd3d_linkEnd1T(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) } } -void pmpd3d_linkEnd2T(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) +void pmpd_linkEnd2T(t_pmpd *x, t_symbol *s, int argc, t_atom *argv) { int i, j, vecsize; t_garray *a; diff --git a/pmpd_test.c b/pmpd_test.c index 7ccfbdc..da40424 100644 --- a/pmpd_test.c +++ b/pmpd_test.c @@ -158,12 +158,6 @@ int test_1d_link(int i, t_pmpd *x, int argc, t_atom *argv) if ( tmp < atom_getfloatarg(j+1,argc,argv) ) { return(0); } j+=2; } - else if ( atom_getsymbolarg(j,argc,argv) == gensym("lengthYInf") ) - { - tmp = fabs(x->link[i].mass1->posY - x->link[i].mass2->posY); - if ( tmp >= atom_getfloatarg(j+1,argc,argv) ) { return(0); } - j+=2; - } else if ( atom_getsymbolarg(j,argc,argv) == gensym("connectedTo") ) { if (argv[j+1].a_type == A_SYMBOL) |