public String serialized()
{
string header = "VERSION:" + Utilities.trackFileFormat + "\n"
+ "[HEADER]\n"
+ "VESSELNAME:" + VesselName + "\n"
+ "DESCRIPTION:" + Description + "\n"
+ "VISIBLE:" + (isVisible ? "1" : "0") + "\n"
+ "MAINBODY:" + referenceBody.GetName() + "\n"
+ "SAMPLING:" + SamplingFactor + "\n"
+ "LINECOLOR:" + LineColor.r + ";" + LineColor.g + ";" + LineColor.b + ";" + LineColor.a + "\n"
+ "LINEWIDTH:" + LineWidth + "\n"
+ "CONERADIUSFACTOR:" + ConeRadiusToLineWidthFactor + "\n"
+ "NUMDIRECTIONMARKERS:" + NumDirectionMarkers + "\n"
+ "REPLAYCOLLIDERS:" + (ReplayColliders? "1":"0") + "\n"
+ "END:" + EndAction.ToString("F") + (EndAction == EndActions.LOOP ? ":" + LoopClosureTime.ToString() : "") + "\n"; //"F" makes creates a string literal
string points= "[WAYPOINTS]\n";
foreach (Waypoint waypoint in waypoints) {
points +=
waypoint.recordTime + ";"
+ waypoint.latitude + ";"
+ waypoint.longitude + ";"
+ waypoint.altitude + ";"
+ waypoint.orientation.x + ";" + waypoint.orientation.y + ";" + waypoint.orientation.z + ";" + waypoint.orientation.w + ";"
+ waypoint.velocity.x + ";" + waypoint.velocity.y + ";" + waypoint.velocity.z + "\n";
}
string logs = "[LOGENTRIES]\n";
foreach (LogEntry entry in logEntries)
{
logs += entry.recordTime + ";"
+ entry.latitude + ";"
+ entry.longitude + ";"
+ entry.altitude + ";"
+ entry.orientation.x + ";" + entry.orientation.y + ";" + entry.orientation.z + ";" + entry.orientation.w + ";"
+ entry.velocity.x + ";" + entry.velocity.y + ";" + entry.velocity.z + ";"
+ entry.label + ";"
+ entry.description + "\n";
}
return header + points + logs;
}