From 65335e58a582621bcf007b610eac640d049b93f5 Mon Sep 17 00:00:00 2001 From: Cyrille Henry Date: Wed, 1 May 2013 17:07:19 +0000 Subject: debug typo so that everything compile svn path=/trunk/externals/pmpd/; revision=17111 --- pmpd.c | 2 +- pmpd2d.c | 6 +++--- pmpd2d_set.c | 6 +++--- pmpd3d_set.c | 2 +- pmpd_core.c | 10 +++++----- pmpd_set.c | 2 +- pmpd_tab.c | 6 +++--- pmpd_test.c | 6 ------ 8 files changed, 17 insertions(+), 23 deletions(-) diff --git a/pmpd.c b/pmpd.c index 11c0c47..38b798b 100644 --- a/pmpd.c +++ b/pmpd.c @@ -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); diff --git a/pmpd2d.c b/pmpd2d.c index a2b0e32..f12377c 100644 --- a/pmpd2d.c +++ b/pmpd2d.c @@ -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; diff --git a/pmpd_set.c b/pmpd_set.c index bb91ca0..d383430 100644 --- a/pmpd_set.c +++ b/pmpd_set.c @@ -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 diff --git a/pmpd_tab.c b/pmpd_tab.c index b9a24b6..173c32d 100644 --- a/pmpd_tab.c +++ b/pmpd_tab.c @@ -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) -- cgit v1.2.1