diff options
author | Cyrille Henry <nusmuk@users.sourceforge.net> | 2013-04-09 08:55:28 +0000 |
---|---|---|
committer | Cyrille Henry <nusmuk@users.sourceforge.net> | 2013-04-09 08:55:28 +0000 |
commit | 72796f92c8b4bc3a38d8c6a17832275c3f5d3c33 (patch) | |
tree | e5d76ebed99f704db96aa37324934a7a2d2696ed | |
parent | ae5c64be35653c67533176657bdb16f471fcf50f (diff) |
bugfix
svn path=/trunk/externals/pmpd/; revision=17074
-rw-r--r-- | pmpd3d_list.c | 1 | ||||
-rw-r--r-- | pmpd3d_set.c | 26 |
2 files changed, 13 insertions, 14 deletions
diff --git a/pmpd3d_list.c b/pmpd3d_list.c index a362b69..39e8000 100644 --- a/pmpd3d_list.c +++ b/pmpd3d_list.c @@ -544,7 +544,6 @@ void pmpd3d_massSpeedNormL(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) SETFLOAT(&(pos_list[i]),sqrt(sqr(x->mass[i].speedX)+sqr(x->mass[i].speedY)+sqr(x->mass[i].speedZ))); outlet_anything(x->main_outlet, gensym("massSpeedNormL"),1 , pos_list); } - } // --------------------------------------------------------------------- diff --git a/pmpd3d_set.c b/pmpd3d_set.c index fccdb26..fe0fd9a 100644 --- a/pmpd3d_set.c +++ b/pmpd3d_set.c @@ -105,13 +105,13 @@ void pmpd3d_setL(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) int tmp, i; if ( (argc == 2) && ( argv[0].a_type == A_FLOAT ) && ( argv[1].a_type == A_FLOAT ) ) - { + { // set a link to a specific size tmp = atom_getfloatarg(0, argc, argv); tmp = max(0, min( x->nb_link-1, tmp)); x->link[tmp].L = atom_getfloatarg(1, argc, argv); } else if ( (argc == 2) && ( argv[0].a_type == A_SYMBOL ) && ( argv[1].a_type == A_FLOAT ) ) - { + { // set a class of link to a specific size for (i=0; i< x->nb_link; i++) { if ( atom_getsymbolarg(0,argc,argv) == x->link[i].Id) @@ -121,19 +121,19 @@ void pmpd3d_setL(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) } } else if ( (argc == 1) && ( argv[0].a_type == A_FLOAT ) ) - { + { // set a link to it's curent size tmp = atom_getfloatarg(0, argc, argv); tmp = max(0, min( x->nb_link-1, tmp)); - x->link[tmp].L = x->link[tmp].mass2->posX - x->link[tmp].mass1->posX; - } + 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 curent size for (i=0; i< x->nb_link; i++) { if ( atom_getsymbolarg(0,argc,argv) == x->link[i].Id) { - x->link[i].L = x->link[i].mass2->posX - x->link[i].mass1->posX; - } + x->link[i].L = x->link[i].distance; + } } } } @@ -143,29 +143,29 @@ void pmpd3d_setLCurrent(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) int tmp, i; if ( ( argc == 1 ) && ( argv[0].a_type == A_FLOAT ) ) - { + { // 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[tmp].mass2->posX - x->link[tmp].mass1->posX; } else if ( ( argc == 1 ) && ( argv[0].a_type == A_SYMBOL ) ) - { + { // set a class of link to there current length for (i=0; i< x->nb_link; i++) { if ( atom_getsymbolarg(0,argc,argv) == x->link[i].Id) { - x->link[i].L = x->link[i].mass2->posX - x->link[i].mass1->posX; + x->link[i].L = x->link[i].distance; } } } else if ( (argc == 2) && ( argv[0].a_type == A_FLOAT ) && ( argv[1].a_type == A_FLOAT ) ) - { + { // set a link to a mix between it's curent length and it's size i = atom_getfloatarg(0, argc, argv); i = max(0, min( x->nb_link-1, i)); x->link[i].L = mix(x->link[i].L,x->link[i].distance,atom_getfloatarg(1, argc, argv)); } else if ( (argc == 2) && ( argv[0].a_type == A_SYMBOL ) && ( argv[1].a_type == A_FLOAT ) ) - { + { // set a class of link to a mix between it's curent length and it's size for (i=0; i< x->nb_link; i++) { if ( atom_getsymbolarg(0,argc,argv) == x->link[i].Id) |