(init_time: TimeDelta, init_value: T, start_time: Option<TimeDelta>)
| 50 | |
| 51 | impl<T: Copy + Add<T, Output = T>> Trace<T> { |
| 52 | pub fn new(init_time: TimeDelta, init_value: T, start_time: Option<TimeDelta>) -> Self { |
| 53 | let init_time = start_time.unwrap_or(TimeDelta::zero()).max(init_time); |
| 54 | Self { |
| 55 | time: vec![init_time.as_seconds_f32()], |
| 56 | value: vec![init_value], |
| 57 | start_time, |
| 58 | } |
| 59 | } |
| 60 | pub fn add_change(&mut self, time: TimeDelta, delta: T) { |
| 61 | if let Some(start_time) = self.start_time |
| 62 | && time < start_time |
nothing calls this directly
no test coverage detected