rust/hwphysics/src/physics.rs
changeset 15275 66c987015f2d
parent 15274 42b710b0f883
child 15281 8095853811a6
--- a/rust/hwphysics/src/physics.rs	Thu Jul 25 22:31:24 2019 +0300
+++ b/rust/hwphysics/src/physics.rs	Thu Jul 25 23:02:02 2019 +0300
@@ -1,4 +1,4 @@
-use crate::common::{GearData, GearDataProcessor, GearId};
+use crate::common::{GearData, GearDataProcessor, GearId, Millis};
 use fpnum::*;
 use integral_geometry::{GridIndex, Point, Size};
 
@@ -133,11 +133,12 @@
         }
     }
 
-    pub fn process(&mut self, time_step: FPNum) -> &PositionUpdates {
+    pub fn process(&mut self, time_step: Millis) -> &PositionUpdates {
+        let fp_step = time_step.to_fixed();
         self.position_updates.clear();
         for (gear_id, (pos, vel)) in self.dynamic_physics.iter_pos_update() {
             let old_pos = *pos;
-            *pos += *vel * time_step;
+            *pos += *vel * fp_step;
             if !vel.is_zero() {
                 self.position_updates.push(gear_id, &old_pos, pos)
             } else {