diff -r 07e909ba4203 -r b58f98bbc120 rust/hwphysics/src/physics.rs --- a/rust/hwphysics/src/physics.rs Thu Jul 25 15:18:00 2019 +0200 +++ b/rust/hwphysics/src/physics.rs Thu Jul 25 16:29:14 2019 +0300 @@ -101,6 +101,11 @@ .zip(self.shifts.iter()) .map(|(id, (from, to))| (id, from, to)) } + + pub fn clear(&mut self) { + self.gear_ids.clear(); + self.shifts.clear(); + } } impl PhysicsProcessor { @@ -114,6 +119,7 @@ } pub fn process(&mut self, time_step: FPNum) -> &PositionUpdates { + self.position_updates.clear(); for (gear_id, (pos, vel)) in self.dynamic_physics.iter_pos_update() { let old_pos = *pos; *pos += *vel * time_step;