fix indexing
authoralfadur
Wed, 11 Nov 2020 21:18:31 +0300
changeset 15756 1d652bca512e
parent 15755 2eb3469a28a0
child 15757 c7332c7f64cd
fix indexing
rust/hwphysics/src/grid.rs
--- a/rust/hwphysics/src/grid.rs	Wed Nov 11 12:45:29 2020 -0500
+++ b/rust/hwphysics/src/grid.rs	Wed Nov 11 21:18:31 2020 +0300
@@ -52,7 +52,7 @@
     }
 
     fn get_bin(&mut self, index: Point) -> &mut GridBin {
-        &mut self.bins[index.x as usize * self.bins_count.width + index.y as usize]
+        &mut self.bins[index.y as usize * self.bins_count.width + index.x as usize]
     }
 
     fn lookup_bin(&mut self, position: &FPPoint) -> &mut GridBin {