aboutsummaryrefslogtreecommitdiff
path: root/pmpd3d_set.c
diff options
context:
space:
mode:
authorCyrille Henry <nusmuk@users.sourceforge.net>2013-04-09 08:55:28 +0000
committerCyrille Henry <nusmuk@users.sourceforge.net>2013-04-09 08:55:28 +0000
commit72796f92c8b4bc3a38d8c6a17832275c3f5d3c33 (patch)
treee5d76ebed99f704db96aa37324934a7a2d2696ed /pmpd3d_set.c
parentae5c64be35653c67533176657bdb16f471fcf50f (diff)
bugfix
svn path=/trunk/externals/pmpd/; revision=17074
Diffstat (limited to 'pmpd3d_set.c')
-rw-r--r--pmpd3d_set.c26
1 files changed, 13 insertions, 13 deletions
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)