diff options
author | Cyrille Henry <nusmuk@users.sourceforge.net> | 2013-02-11 16:57:35 +0000 |
---|---|---|
committer | Cyrille Henry <nusmuk@users.sourceforge.net> | 2013-02-11 16:57:35 +0000 |
commit | 7f927c2f4a64c883eaab73472291c8aed2d769a8 (patch) | |
tree | a3ee0828e3d3f9fe7bb6b7fd013351cff0644363 /pmpd3d_set.c | |
parent | c6e20af88d58602d44e5eefcf72a690265c4f616 (diff) |
lot's of new features...
svn path=/trunk/externals/pmpd/; revision=17031
Diffstat (limited to 'pmpd3d_set.c')
-rw-r--r-- | pmpd3d_set.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/pmpd3d_set.c b/pmpd3d_set.c index 58bd812..4792a72 100644 --- a/pmpd3d_set.c +++ b/pmpd3d_set.c @@ -136,13 +136,34 @@ void pmpd3d_setL(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) } } } - else if ( (argc== 3) && ( argv[0].a_type == A_FLOAT ) && ( argv[2].a_type == A_FLOAT ) && ( atom_getsymbolarg(1,argc,argv) == gensym("current") ) ) +} +void pmpd3d_setLCurrent(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) +{ + int tmp, i; + + if ( ( argv[0].a_type == A_FLOAT ) && ( argc == 1 ) ) + { + 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 ( ( argv[0].a_type == A_SYMBOL ) && ( argc == 1 ) ) + { + 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; + } + } + } + else if ( ( argv[0].a_type == A_FLOAT ) && ( argv[1].a_type == A_FLOAT ) ) { 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(2, argc, argv)); } - else if ( (argc== 3) && ( argv[0].a_type == A_SYMBOL ) && ( argv[2].a_type == A_FLOAT ) && ( atom_getsymbolarg(1,argc,argv) == gensym("current") ) ) + else if ( ( argv[0].a_type == A_SYMBOL ) && ( argv[1].a_type == A_FLOAT ) ) { for (i=0; i< x->nb_link; i++) { @@ -154,6 +175,8 @@ void pmpd3d_setL(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) } } + + void pmpd3d_setLKTab(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) { int tmp, i; |