aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmsd/main.cpp7
-rwxr-xr-xmsd2D/main.cpp14
-rwxr-xr-xmsd3D/main.cpp74
3 files changed, 63 insertions, 32 deletions
diff --git a/msd/main.cpp b/msd/main.cpp
index 28b3276..6e85290 100755
--- a/msd/main.cpp
+++ b/msd/main.cpp
@@ -252,15 +252,16 @@ protected:
{
if (GetInt(argv[0]) == (*mi)->nbr) {
(*mi)->posX = GetFloat(argv[1]);
+ (*mi)->posX2 = GetFloat(argv[1]);
break;
}
}
else
for (i=0, mi=mass; i<nb_mass; mi++, i++)
- {
- if (sym == (*mi)->Id)
+ if (sym == (*mi)->Id) {
(*mi)->posX = GetFloat(argv[1]);
- }
+ (*mi)->posX2 = GetFloat(argv[1]);
+ }
}
void m_set_mobile(int argc,t_atom *argv)
diff --git a/msd2D/main.cpp b/msd2D/main.cpp
index 436703b..d911a14 100755
--- a/msd2D/main.cpp
+++ b/msd2D/main.cpp
@@ -299,15 +299,16 @@ protected:
{
if (GetInt(argv[0]) == (*mi)->nbr) {
(*mi)->posX = GetFloat(argv[1]);
+ (*mi)->posX2 = GetFloat(argv[1]);
break;
}
}
else
for (i=0, mi=mass; i<nb_mass; mi++, i++)
- {
- if (sym == (*mi)->Id)
+ if (sym == (*mi)->Id) {
(*mi)->posX = GetFloat(argv[1]);
- }
+ (*mi)->posX2 = GetFloat(argv[1]);
+ }
}
void m_posY(int argc,t_atom *argv)
@@ -326,15 +327,16 @@ protected:
{
if (GetInt(argv[0]) == (*mi)->nbr) {
(*mi)->posY = GetFloat(argv[1]);
+ (*mi)->posY2 = GetFloat(argv[1]);
break;
}
}
else
for (i=0, mi=mass; i<nb_mass; mi++, i++)
- {
- if (sym == (*mi)->Id)
+ if (sym == (*mi)->Id) {
(*mi)->posY = GetFloat(argv[1]);
- }
+ (*mi)->posY2 = GetFloat(argv[1]);
+ }
}
void m_set_mobile(int argc,t_atom *argv)
diff --git a/msd3D/main.cpp b/msd3D/main.cpp
index fff45bc..6808f08 100755
--- a/msd3D/main.cpp
+++ b/msd3D/main.cpp
@@ -333,56 +333,84 @@ protected:
{
// displace mass(es) named Id to a certain position
t_int i;
- const t_symbol *sym = GetSymbol(argv[0]);
+ const t_symbol *sym = GetASymbol(argv[0]);
t_mass **mi;
if (argc != 2)
- error("posX : Idmass value");
+ error("posX : Id/Nomass value");
if (GetFloat(argv[1]) < Xmax && GetFloat(argv[1]) > Xmin)
- for (i=0, mi=mass; i<nb_mass;mi++, i++)
- {
- if (sym == (*mi)->Id)
- (*mi)->posX = GetAFloat(argv[1]);
- }
+ if (sym ==0)
+ for (i=0, mi=mass; i<nb_mass; mi++, i++)
+ {
+ if (GetInt(argv[0]) == (*mi)->nbr) {
+ (*mi)->posX = GetFloat(argv[1]);
+ (*mi)->posX2 = GetFloat(argv[1]);
+ break;
+ }
+ }
+ else
+ for (i=0, mi=mass; i<nb_mass; mi++, i++)
+ if (sym == (*mi)->Id) {
+ (*mi)->posX = GetFloat(argv[1]);
+ (*mi)->posX2 = GetFloat(argv[1]);
+ }
}
void m_posY(int argc,t_atom *argv)
{
// displace mass(es) named Id to a certain position
t_int i;
- const t_symbol *sym = GetSymbol(argv[0]);
+ const t_symbol *sym = GetASymbol(argv[0]);
t_mass **mi;
if (argc != 2)
- error("posY : Idmass value");
+ error("posY : Id/Nomass value");
if (GetFloat(argv[1]) < Ymax && GetFloat(argv[1]) > Ymin)
- for (i=0, mi=mass; i<nb_mass;mi++, i++)
- {
- if (sym == (*mi)->Id)
- (*mi)->posY = GetFloat(argv[1]);
- }
-
+ if (sym ==0)
+ for (i=0, mi=mass; i<nb_mass; mi++, i++)
+ {
+ if (GetInt(argv[0]) == (*mi)->nbr) {
+ (*mi)->posY = GetFloat(argv[1]);
+ (*mi)->posY2 = GetFloat(argv[1]);
+ break;
+ }
+ }
+ else
+ for (i=0, mi=mass; i<nb_mass; mi++, i++)
+ if (sym == (*mi)->Id) {
+ (*mi)->posY = GetFloat(argv[1]);
+ (*mi)->posY2 = GetFloat(argv[1]);
+ }
}
void m_posZ(int argc,t_atom *argv)
{
// displace mass(es) named Id to a certain position
t_int i;
- const t_symbol *sym = GetSymbol(argv[0]);
+ const t_symbol *sym = GetASymbol(argv[0]);
t_mass **mi;
if (argc != 2)
- error("posZ : Idmass value");
+ error("posY : Id/Nomass value");
if (GetFloat(argv[1]) < Zmax && GetFloat(argv[1]) > Zmin)
- for (i=0, mi=mass; i<nb_mass;mi++, i++)
- {
- if (sym == (*mi)->Id)
- (*mi)->posZ = GetFloat(argv[1]);
- }
-
+ if (sym ==0)
+ for (i=0, mi=mass; i<nb_mass; mi++, i++)
+ {
+ if (GetInt(argv[0]) == (*mi)->nbr) {
+ (*mi)->posZ = GetFloat(argv[1]);
+ (*mi)->posZ2 = GetFloat(argv[1]);
+ break;
+ }
+ }
+ else
+ for (i=0, mi=mass; i<nb_mass; mi++, i++)
+ if (sym == (*mi)->Id) {
+ (*mi)->posZ = GetFloat(argv[1]);
+ (*mi)->posZ2 = GetFloat(argv[1]);
+ }
}
void m_set_mobile(int argc,t_atom *argv)