rust/hwphysics/src/lib.rs
changeset 15388 701ad89a9f2a
parent 15386 52844baced17
--- a/rust/hwphysics/src/lib.rs	Thu Aug 29 00:08:03 2019 +0300
+++ b/rust/hwphysics/src/lib.rs	Thu Aug 29 00:20:41 2019 +0300
@@ -53,7 +53,12 @@
     }
 
     pub fn step(&mut self, time_step: Millis, land: &Land2D<u32>) {
-        let updates = self.physics.process(&mut self.data, time_step);
+        let updates = if time_step == Millis::new(1) {
+            self.physics.process_single_tick(&mut self.data)
+        } else {
+            self.physics
+                .process_multiple_ticks(&mut self.data, time_step)
+        };
         let collisions = self.collision.process(land, &updates);
         let events = self.time.process(time_step);
     }