diff options
-rw-r--r-- | pmpd2d_core.c | 6 | ||||
-rw-r--r-- | pmpd3d_core.c | 4 | ||||
-rw-r--r-- | pmpd_core.c | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/pmpd2d_core.c b/pmpd2d_core.c index 330dbd8..196e2b3 100644 --- a/pmpd2d_core.c +++ b/pmpd2d_core.c @@ -198,8 +198,8 @@ void pmpd2d_mass(t_pmpd2d *x, t_symbol *s, int argc, t_atom *argv) x->mass[x->nb_mass].overdamp = 0; x->nb_mass++ ; x->nb_mass = min ( nb_max_mass -1, x->nb_mass ); -} - +} + void pmpd2d_create_link(t_pmpd2d *x, t_symbol *Id, int mass1, int mass2, t_float K, t_float D, t_float Pow, t_float Lmin, t_float Lmax, t_int type) { // create a link based on mass number @@ -220,6 +220,8 @@ void pmpd2d_create_link(t_pmpd2d *x, t_symbol *Id, int mass1, int mass2, t_float x->link[x->nb_link].Lmin = Lmin; x->link[x->nb_link].Lmax = Lmax; x->link[x->nb_link].distance = x->link[x->nb_link].L ; + x->link[x->nb_link].forceX = 0 ; + x->link[x->nb_link].forceY = 0 ; x->nb_link++ ; x->nb_link = min ( nb_max_link -1, x->nb_link ); diff --git a/pmpd3d_core.c b/pmpd3d_core.c index b45475f..f884e44 100644 --- a/pmpd3d_core.c +++ b/pmpd3d_core.c @@ -241,7 +241,9 @@ void pmpd3d_create_link(t_pmpd3d *x, t_symbol *Id, int mass1, int mass2, t_float x->link[x->nb_link].Lmin = Lmin; x->link[x->nb_link].Lmax = Lmax; x->link[x->nb_link].distance = x->link[x->nb_link].L ; - + x->link[x->nb_link].forceX = 0 ; + x->link[x->nb_link].forceY = 0 ; + x->link[x->nb_link].forceZ = 0 ; x->nb_link++ ; x->nb_link = min ( nb_max_link -1, x->nb_link ); } diff --git a/pmpd_core.c b/pmpd_core.c index d4ee5fb..49df4c1 100644 --- a/pmpd_core.c +++ b/pmpd_core.c @@ -172,6 +172,7 @@ void pmpd_create_link(t_pmpd *x, t_symbol *Id, int mass1, int mass2, t_float K, x->link[x->nb_link].Lmin = Lmin; x->link[x->nb_link].Lmax = Lmax; x->link[x->nb_link].distance = x->link[x->nb_link].L; + x->link[x->nb_link].forceX = 0 ; x->nb_link++ ; x->nb_link = min ( nb_max_link -1, x->nb_link ); |