diff options
-rw-r--r-- | msd.h | 49 | ||||
-rw-r--r-- | msd1D/01_msdtest.pd (renamed from msd/01_msdtest.pd) | 0 | ||||
-rw-r--r-- | msd1D/02_msdstring.pd (renamed from msd/02_msdstring.pd) | 0 | ||||
-rw-r--r-- | msd1D/03_msdwave.pd (renamed from msd/03_msdwave.pd) | 0 | ||||
-rw-r--r-- | msd1D/Makefile.am (renamed from msd/Makefile.am) | 0 | ||||
-rw-r--r-- | msd1D/license.txt (renamed from msd/license.txt) | 0 | ||||
-rw-r--r-- | msd1D/main.cpp (renamed from msd/main.cpp) | 0 | ||||
-rw-r--r-- | msd1D/msd-help.pd (renamed from msd/msd-help.pd) | 0 | ||||
-rw-r--r-- | msd1D/package.txt (renamed from msd/package.txt) | 0 |
9 files changed, 14 insertions, 35 deletions
@@ -172,22 +172,22 @@ public: t_float longueur, long_min, long_max; t_float distance_old; t_float puissance; - t_int oriented; //0 : no, 1 : tangential, 2 : normal + t_int link_type; //0 : no, 1 : tangential, 2 : normal t_float tdirection1[N], tdirection2[N]; Link(t_int n,const t_symbol *id,Mass<N> *m1,Mass<N> *m2,t_float k1,t_float d1, t_int o=0, t_float tangent[N]=NULL,t_float pow=1, t_float lmin = 0,t_float lmax = 1e10) : nbr(n),Id(id) , mass1(m1),mass2(m2) - , K1(k1),D1(d1),D2(0),oriented(o),puissance(pow) + , K1(k1),D1(d1),D2(0),link_type(o),puissance(pow) , long_min(lmin),long_max(lmax) { for (int i=0; i<N; i++) { tdirection1[i] = 0; tdirection2[i] = 0; } - if (oriented == 0) + if (link_type == 0) distance_old = longueur = Mass<N>::dist(*mass1,*mass2); // L[n-1] - else if (oriented == 1) { // TANGENTIAL LINK + else if (link_type == 1) { // TANGENTIAL LINK t_float norme = 0; for(int i = 0; i < N; ++i) norme += sqr(tangent[i]); norme = sqrt(norme); @@ -201,7 +201,7 @@ public: distance_old = sqrt(distance_old); longueur = distance_old; } - /*else if (oriented == 2) { // NORMAL LINK 2D + /*else if (link_type == 2) { // NORMAL LINK 2D if (N >= 2) { const t_float norme = sqrt(sqr(xa)+sqr(ya)); tdirection1[0]=ya/norme; @@ -249,14 +249,14 @@ public: t_float F; Mass<N> *m1 = mass1,*m2 = mass2; // cache locally if (m1->invM || m2->invM) { - if (oriented == 0) + if (link_type == 0) distance = Mass<N>::dist(*m1,*m2); - else if (oriented == 1) { + else if (link_type == 1) { for(int i = 0; i < N; ++i) distance += sqr((m1->pos[i]-m2->pos[i])*tdirection1[i]); distance = sqrt(distance); } - else if (oriented == 2) { + else if (link_type == 2) { for(int i = 0; i < N; ++i) distance += sqr((m1->pos[i]-m2->pos[i])*(tdirection1[i] +tdirection2[i])); distance = sqrt(distance); @@ -274,19 +274,19 @@ public: F = (K1 * pow(distance - longueur,puissance) + D1 * (distance - distance_old))/distance ; else F = (-K1 * pow(longueur - distance,puissance) + D1 * (distance - distance_old))/distance ; - if (oriented == 0) + if (link_type == 0) for(int i = 0; i < N; ++i) { const t_float Fn = F * (m1->pos[i] - m2->pos[i]); // Fx = F * Lx[n]/L[n] m1->force[i] -= Fn + D2 * m1->speed[i]; // Fx1[n] = -Fx, Fx1[n] = Fx1[n] - D2 * vx1[n-1] m2->force[i] += Fn - D2 * m2->speed[i]; // Fx2[n] = Fx, Fx2[n] = Fx2[n] - D2 * vx2[n-1] } - else if (oriented == 1 || (oriented == 2 && N == 2)) + else if (link_type == 1 || (link_type == 2 && N == 2)) for(int i = 0; i < N; ++i) { const t_float Fn = F * (m1->pos[i] - m2->pos[i])*tdirection1[i]; // Fx = F * Lx[n]/L[n] m1->force[i] -= Fn + D2 * m1->speed[i]; // Fx1[n] = -Fx, Fx1[n] = Fx1[n] - D2 * vx1[n-1] m2->force[i] += Fn - D2 * m2->speed[i]; // Fx2[n] = Fx, Fx2[n] = Fx2[n] - D2 * vx2[n-1] } - else if (oriented == 2 && N == 3) + else if (link_type == 2 && N == 3) for(int i = 0; i < N; ++i) { const t_float Fn = F * (m1->pos[i] - m2->pos[i])*(tdirection1[i] +tdirection2[i]); // Fx = F * Lx[n]/L[n] m1->force[i] -= Fn + D2 * m1->speed[i]; // Fx1[n] = -Fx, Fx1[n] = Fx1[n] - D2 * vx1[n-1] @@ -900,12 +900,6 @@ protected: argc >= 6+N?GetFloat(argv[5+N]):1, // power argc >= 7+N?GetFloat(argv[6+N]):0, // Lmin argc >= 8+N?GetFloat(argv[7+N]):1e10 // Lmax - -//GetAFloat(argv[5]),N >= 2?GetAFloat(argv[6]):0,N >= 3?GetAFloat(argv[7]):0, // vector - //(N==1 && argc >= 7)?GetFloat(argv[6]):((N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1)), // power - //(N==1 && argc >= 8)?GetFloat(argv[7]):((N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0)), // Lmin - //(N==1 && argc >= 9)?GetFloat(argv[8]):((N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10))// Lmax - ); linkids.insert(l); link.insert(id_link++,l); @@ -929,11 +923,6 @@ protected: argc >= 6+N?GetFloat(argv[5+N]):1, // power argc >= 7+N?GetFloat(argv[6+N]):0, // Lmin argc >= 8+N?GetFloat(argv[7+N]):1e10 // Lmax - - //GetAFloat(argv[5]),N >= 2?GetAFloat(argv[6]):0,N >= 3?GetAFloat(argv[7]):0, // vector - //(N==1 && argc >= 7)?GetFloat(argv[6]):((N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1)), // power - //(N==1 && argc >= 8)?GetFloat(argv[7]):((N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0)), // Lmin - //(N==1 && argc >= 9)?GetFloat(argv[8]):((N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10))// Lmax ); linkids.insert(l); link.insert(id_link++,l); @@ -956,11 +945,6 @@ protected: argc >= 6+N?GetFloat(argv[5+N]):1, // power argc >= 7+N?GetFloat(argv[6+N]):0, // Lmin argc >= 8+N?GetFloat(argv[7+N]):1e10 // Lmax - - //GetAFloat(argv[5]),N >= 2?GetAFloat(argv[6]):0,N >= 3?GetAFloat(argv[7]):0, // vector - //(N==1 && argc >= 7)?GetFloat(argv[6]):((N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1)), // power - //(N==1 && argc >= 8)?GetFloat(argv[7]):((N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0)), // Lmin - //(N==1 && argc >= 9)?GetFloat(argv[8]):((N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10))// Lmax ); linkids.insert(l); link.insert(id_link++,l); @@ -986,12 +970,7 @@ protected: argc >= 6+N?GetFloat(argv[5+N]):1, // power argc >= 7+N?GetFloat(argv[6+N]):0, // Lmin argc >= 8+N?GetFloat(argv[7+N]):1e10 // Lmax - - //GetAFloat(argv[5]),N >= 2?GetAFloat(argv[6]):0,N >= 3?GetAFloat(argv[7]):0, // vector - //(N==1 && argc >= 7)?GetFloat(argv[6]):((N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1)), // power - //(N==1 && argc >= 8)?GetFloat(argv[7]):((N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0)), // Lmin - //(N==1 && argc >= 9)?GetFloat(argv[8]):((N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10))// Lmax -); + ); linkids.insert(l); link.insert(id_link++,l); outlink(S_tLink,l); @@ -1789,13 +1768,13 @@ private: SetFloat((sortie[4]),l->K1); SetFloat((sortie[5]),l->D1); - if (l->oriented == 1 ||(l->oriented == 2 && N ==2)) { + if (l->link_type == 1 ||(l->link_type == 2 && N ==2)) { for (int i=0; i<N; i++) SetFloat((sortie[6+i]),l->tdirection1[i]); // ToOutAnything(1,s,6+N,sortie); size = 6+N; } - else if (l->oriented == 2 && N==3) { + else if (l->link_type == 2 && N==3) { for (int i=0; i<N; i++) { SetFloat((sortie[6+i]),l->tdirection1[i]); SetFloat((sortie[6+i+N]),l->tdirection2[i]); diff --git a/msd/01_msdtest.pd b/msd1D/01_msdtest.pd index 49922e9..49922e9 100644 --- a/msd/01_msdtest.pd +++ b/msd1D/01_msdtest.pd diff --git a/msd/02_msdstring.pd b/msd1D/02_msdstring.pd index 8eebc38..8eebc38 100644 --- a/msd/02_msdstring.pd +++ b/msd1D/02_msdstring.pd diff --git a/msd/03_msdwave.pd b/msd1D/03_msdwave.pd index 816840a..816840a 100644 --- a/msd/03_msdwave.pd +++ b/msd1D/03_msdwave.pd diff --git a/msd/Makefile.am b/msd1D/Makefile.am index 59a3dff..59a3dff 100644 --- a/msd/Makefile.am +++ b/msd1D/Makefile.am diff --git a/msd/license.txt b/msd1D/license.txt index b1e3f5a..b1e3f5a 100644 --- a/msd/license.txt +++ b/msd1D/license.txt diff --git a/msd/main.cpp b/msd1D/main.cpp index 844b8f9..844b8f9 100644 --- a/msd/main.cpp +++ b/msd1D/main.cpp diff --git a/msd/msd-help.pd b/msd1D/msd-help.pd index 784d081..784d081 100644 --- a/msd/msd-help.pd +++ b/msd1D/msd-help.pd diff --git a/msd/package.txt b/msd1D/package.txt index c564a23..c564a23 100644 --- a/msd/package.txt +++ b/msd1D/package.txt |