diff options
-rw-r--r-- | depend.mak | 2 | ||||
-rw-r--r-- | glgrav.cpp | 27 | ||||
-rw-r--r-- | test2.dat | 9 |
3 files changed, 30 insertions, 8 deletions
@@ -1,5 +1,5 @@ glgrav.o: glgrav.cpp global.h config.h mass.h vec3d.h particles.h \ - sparks.h + sparks.h mass.o: mass.cpp mass.h global.h vec3d.h config.o: config.cpp config.h global.h mass.h vec3d.h particles.o: particles.cpp particles.h global.h @@ -190,7 +190,7 @@ int main(int argc, char *argv[]) if (output) { output << "<?xml version=\"1.0\" encoding=\"utf-8\"?>" << endl; - output << "<simulation>" << endl; + output << "<simulation G=\"" << config.gravConst() << "\">" << endl; } } @@ -897,7 +897,9 @@ static void Update(void) if (output) { - output << "<step tick=\"" << tick++ << "\">" << endl; + output << "<step tick=\"" << tick++ << "\"" + << " bodies=\"" << mass.size() + << "\">" << endl; } for(f=0;f<mass.size();f++) @@ -912,10 +914,21 @@ static void Update(void) mass[f].getColour(r, g, b); mass[f].getDelta(dx, dy, dz); - output << "<mass name=\"" << mass[f].getName() << "\" " - << "r=\"" << r << "\" " - << "g=\"" << g << "\" " - << "b=\"" << b << "\" " + output << "<body name=\"" << mass[f].getName() << "\" "; + + if (mass[f].isMassless()) + { + output << "massless=\"true\" "; + } + else + { + output << "mass=\"" << mass[f].getMass() << "\" "; + } + + output << "size=\"" << mass[f].getSize() << "\" " + << "red=\"" << r << "\" " + << "green=\"" << g << "\" " + << "blue=\"" << b << "\" " << "x=\"" << x << "\" " << "y=\"" << y << "\" " << "z=\"" << z << "\" " @@ -930,7 +943,7 @@ static void Update(void) if (output) { - output << "</step>" << endl; + output << "</step>" << endl << flush; } for(f=0;f<mass.size();f++) @@ -41,6 +41,15 @@ radial mass2, 0,1,0, 0; +radial mass3, + 0, + centre, + 300, + 0, + 0.50, + 0,1,0, + 0; + look centre; look mass1; look mass2; |