equal
deleted
inserted
replaced
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 |