Fix bug in visualize_telemetry

This commit is contained in:
Daniel Lovell
2024-09-14 15:37:45 -07:00
parent e583b2c126
commit bee353503e
5 changed files with 62 additions and 62 deletions

View File

@@ -44,6 +44,9 @@ public class SimMonitor : MonoBehaviour
foreach (var agent in SimManager.Instance.GetActiveTargets().Cast<Agent>().Concat(SimManager.Instance.GetActiveMissiles().Cast<Agent>()))
{
Vector3 pos = agent.transform.position;
if(pos == Vector3.zero) {
continue;
}
Vector3 vel = agent.GetComponent<Rigidbody>().velocity;
string type = agent is Target ? "T" : "M";
writer.WriteLine($"{time:F2},{agent.name},{pos.x:F2},{pos.y:F2},{pos.z:F2},{vel.x:F2},{vel.y:F2},{vel.z:F2},{(int)agent.GetFlightPhase()},{type}");