Update of /cvsroot/pure-data/externals/nusmuk
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20188
Modified Files:
msd.h
Log Message:
add new get messages.
this message allow to possibility to get the masses or link name (not there id)
Index: msd.h
===================================================================
RCS file: /cvsroot/pure-data/externals/nusmuk/msd.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** msd.h 14 May 2007 17:56:25 -0000 1.15
--- msd.h 16 May 2007 09:49:51 -0000 1.16
***************
*** 1258,1262 ****
SetSymbol(sortie[0],mit.data()->Id);
for(int i = 0; i < N; ++i) SetFloat(sortie[1+i],mit.data()->pos[i]);
! ToOutAnything(0,S_massesPos,1+N,sortie);
}
}
--- 1258,1262 ----
SetSymbol(sortie[0],mit.data()->Id);
for(int i = 0; i < N; ++i) SetFloat(sortie[1+i],mit.data()->pos[i]);
! ToOutAnything(0,S_massesPosName,1+N,sortie);
}
}
***************
*** 1298,1301 ****
--- 1298,1308 ----
}
}
+ else if (auxtype == S_massesForcesName) { // get all masses forces
+ for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) {
+ SetSymbol(sortie[0],mit.data()->Id);
+ for(int i = 0; i < N; ++i) SetFloat(sortie[1+i],mit.data()->out_force[i]);
+ ToOutAnything(0,S_massesForcesName,1+N,sortie);
+ }
+ }
else if (auxtype == S_massesForcesMean) { // get all masses forces mean
for(int i = 0; i<N; ++i)
***************
*** 1338,1341 ****
--- 1345,1358 ----
}
}
+ else if (auxtype == S_linksPosName) { // get all links positions
+ for(typename IndexMap<t_link *>::iterator lit(link); lit; ++lit) {
+ SetSymbol(sortie[0],lit.data()->Id);
+ for(int i = 0; i < N; ++i) {
+ SetFloat(sortie[1+i],lit.data()->mass1->pos[i]);
+ SetFloat(sortie[1+N+i],lit.data()->mass2->pos[i]);
+ }
+ ToOutAnything(0,S_linksPosName,1+2*N,sortie);
+ }
+ }
else if (auxtype == S_linksLenghts) { // get all links lenghts
for(typename IndexMap<t_link *>::iterator lit(link); lit; ++lit) {
***************
*** 1379,1382 ****
--- 1396,1406 ----
}
}
+ else if (auxtype == S_massesSpeedsName) { // get all masses speeds
+ for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) {
+ SetSymbol(sortie[0],mit.data()->Id);
+ for(int i = 0; i < N; ++i) SetFloat(sortie[1+i],mit.data()->speed[i]);
+ ToOutAnything(0,S_massesSpeedsName,1+N,sortie);
+ }
+ }
else if (auxtype == S_massesSpeedsMean) { // get all masses forces mean
for(int i = 0; i<N; ++i)
***************
*** 1728,1731 ****
--- 1752,1756 ----
const static t_symbol *S_massesPosId;
const static t_symbol *S_linksPos;
+ const static t_symbol *S_linksPosName;
const static t_symbol *S_linksPosNo;
const static t_symbol *S_linksPosId;
***************
*** 1736,1739 ****
--- 1761,1765 ----
const static t_symbol *S_linksLenghtsId;
const static t_symbol *S_massesForces;
+ const static t_symbol *S_massesForcesName;
const static t_symbol *S_massesForcesMean;
const static t_symbol *S_massesForcesStd;
***************
*** 1741,1744 ****
--- 1767,1771 ----
const static t_symbol *S_massesForcesId;
const static t_symbol *S_massesSpeeds;
+ const static t_symbol *S_massesSpeedsName;
const static t_symbol *S_massesSpeedsMean;
const static t_symbol *S_massesSpeedsStd;
***************
*** 1768,1771 ****
--- 1795,1799 ----
S_massesPosId = MakeSymbol("massesPosId");
S_linksPos = MakeSymbol("linksPos");
+ S_linksPosName = MakeSymbol("linksPosName");
S_linksPosNo = MakeSymbol("linksPosNo");
S_linksPosId = MakeSymbol("linksPosId");
***************
*** 1776,1779 ****
--- 1804,1808 ----
S_linksLenghtsId = MakeSymbol("linksLenghtsId");
S_massesForces = MakeSymbol("massesForces");
+ S_massesForcesName = MakeSymbol("massesForcesName");
S_massesForcesMean = MakeSymbol("massesForcesMean");
S_massesForcesStd = MakeSymbol("massesForcesStd");
***************
*** 1781,1784 ****
--- 1810,1814 ----
S_massesForcesId = MakeSymbol("massesForcesId");
S_massesSpeeds = MakeSymbol("massesSpeeds");
+ S_massesSpeedsName = MakeSymbol("massesSpeedsName");
S_massesSpeedsMean = MakeSymbol("massesSpeedsMean");
S_massesSpeedsStd = MakeSymbol("massesSpeedsStd");
***************
*** 1906,1909 ****
--- 1936,1940 ----
template<int N> const t_symbol *msdN<N>::S_massesPosId;
template<int N> const t_symbol *msdN<N>::S_linksPos;
+ template<int N> const t_symbol *msdN<N>::S_linksPosName;
template<int N> const t_symbol *msdN<N>::S_linksPosNo;
template<int N> const t_symbol *msdN<N>::S_linksPosId;
***************
*** 1914,1917 ****
--- 1945,1949 ----
template<int N> const t_symbol *msdN<N>::S_linksLenghtsId;
template<int N> const t_symbol *msdN<N>::S_massesForces;
+ template<int N> const t_symbol *msdN<N>::S_massesForcesName;
template<int N> const t_symbol *msdN<N>::S_massesForcesMean;
template<int N> const t_symbol *msdN<N>::S_massesForcesStd;
***************
*** 1919,1922 ****
--- 1951,1955 ----
template<int N> const t_symbol *msdN<N>::S_massesForcesId;
template<int N> const t_symbol *msdN<N>::S_massesSpeeds;
+ template<int N> const t_symbol *msdN<N>::S_massesSpeedsName;
template<int N> const t_symbol *msdN<N>::S_massesSpeedsMean;
template<int N> const t_symbol *msdN<N>::S_massesSpeedsStd;