summaryrefslogtreecommitdiff
path: root/glgrav.cpp
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2010-08-24 08:10:56 +0000
committerIan C <ianc@noddybox.co.uk>2010-08-24 08:10:56 +0000
commitb1d6b4e0bcf376ca314c54ff618342a0dbeb99cc (patch)
treeddfb1ec13410f455e3cccf5d126d03aa274352a8 /glgrav.cpp
parentdf40de3b564062c1bba93332d08e86f3691e6b00 (diff)
Tweaks to output XML.
Diffstat (limited to 'glgrav.cpp')
-rw-r--r--glgrav.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/glgrav.cpp b/glgrav.cpp
index 5c08b90..a7f2c99 100644
--- a/glgrav.cpp
+++ b/glgrav.cpp
@@ -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++)