rust/hwphysics/src/collision.rs
changeset 15261 501dfa1c8deb
parent 15120 febccab419b1
child 15263 24828281c9c5
equal deleted inserted replaced
15260:775d7efa4e5c 15261:501dfa1c8deb
   105             detected_collisions: DetectedCollisions::new(0),
   105             detected_collisions: DetectedCollisions::new(0),
   106         }
   106         }
   107     }
   107     }
   108 
   108 
   109     pub fn process(&mut self, land: &Land2D<u32>, updates: &crate::physics::PositionUpdates) {
   109     pub fn process(&mut self, land: &Land2D<u32>, updates: &crate::physics::PositionUpdates) {
       
   110         for (id, old_position, new_position) in updates.iter() {
       
   111             self.grid.update_position(id, old_position, new_position)
       
   112         }
   110         self.grid.check_collisions(&mut self.detected_collisions);
   113         self.grid.check_collisions(&mut self.detected_collisions);
   111 
   114 
   112         for (gear_id, collision) in self.enabled_collisions.iter() {
   115         for (gear_id, collision) in self.enabled_collisions.iter() {
   113             if collision
   116             if collision
   114                 .bounds
   117                 .bounds