Currently it loops through every time step every time it's called. Can instead calculate it only when the segments change, and only from the changed segment until end of dive.
Could also defer the calculation until getCeilingError is called, and just invalidate the memoized copy when segments change.
Currently it loops through every time step every time it's called. Can instead calculate it only when the segments change, and only from the changed segment until end of dive.
Could also defer the calculation until
getCeilingError
is called, and just invalidate the memoized copy when segments change.