I want to store a history of where each car was at certain times, to analyze e.g. how the gaps change over the race and all kinds of other stuff. Is there a neat way to get the total time since the start of a session from a Lap Data packet?
- It seems that the m_sessionTime in the header doesn't reset when doing a flashback (and instead keeps just increasing), so it isn't useful for timing.
- In a race, I can calculate the total time by storing the sum of all previous lap times and using m_currentLapTime. However, if a lap is completely missing from the UDP stream (due to connection issues or whatever), the total time can't be recovered after the connection returns.
- In a qualifying, the m_sessionTimeLeft is good as the session time doesn't change. However, that time is only sent twice a second, and would require some interpolation for the Lap Data packets.