diff options
Diffstat (limited to 'glgrav.cpp')
-rw-r--r-- | glgrav.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -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++) |