rust/hwphysics/src/lib.rs
changeset 15404 701ad89a9f2a
parent 15402 52844baced17
child 15784 84c07aa94b61
equal deleted inserted replaced
15403:6ad92b6ac43c 15404:701ad89a9f2a
    51         self.time.cancel(gear_id);
    51         self.time.cancel(gear_id);
    52         self.allocator.free(gear_id)
    52         self.allocator.free(gear_id)
    53     }
    53     }
    54 
    54 
    55     pub fn step(&mut self, time_step: Millis, land: &Land2D<u32>) {
    55     pub fn step(&mut self, time_step: Millis, land: &Land2D<u32>) {
    56         let updates = self.physics.process(&mut self.data, time_step);
    56         let updates = if time_step == Millis::new(1) {
       
    57             self.physics.process_single_tick(&mut self.data)
       
    58         } else {
       
    59             self.physics
       
    60                 .process_multiple_ticks(&mut self.data, time_step)
       
    61         };
    57         let collisions = self.collision.process(land, &updates);
    62         let collisions = self.collision.process(land, &updates);
    58         let events = self.time.process(time_step);
    63         let events = self.time.process(time_step);
    59     }
    64     }
    60 
    65 
    61     #[inline]
    66     #[inline]