rust/hwphysics/src/lib.rs
changeset 15780 f4b563a9ac5e
parent 15775 95402fa4e191
child 15828 44b49f255e31
equal deleted inserted replaced
15778:50315e39d705 15780:f4b563a9ac5e
    46         self.collision.remove(gear_id);
    46         self.collision.remove(gear_id);
    47         self.allocator.free(gear_id)
    47         self.allocator.free(gear_id)
    48     }
    48     }
    49 
    49 
    50     pub fn step(&mut self, time_step: Millis, land: &Land2D<u32>) {
    50     pub fn step(&mut self, time_step: Millis, land: &Land2D<u32>) {
    51         let updates = if time_step == Millis::new(1) {
    51         let updates = self.physics.process(&mut self.data, time_step);
    52             self.physics.process_single_tick(&mut self.data)
       
    53         } else {
       
    54             self.physics
       
    55                 .process_multiple_ticks(&mut self.data, time_step)
       
    56         };
       
    57         let collisions = self.collision.process(land, &updates);
    52         let collisions = self.collision.process(land, &updates);
    58     }
    53     }
    59 
    54 
    60     #[inline]
    55     #[inline]
    61     pub fn add_gear_data<T: Clone + 'static>(&mut self, gear_id: GearId, data: &T) {
    56     pub fn add_gear_data<T: Clone + 'static>(&mut self, gear_id: GearId, data: &T) {