rust/hwphysics/src/grid.rs
changeset 15756 1d652bca512e
parent 15274 42b710b0f883
child 15757 c7332c7f64cd
equal deleted inserted replaced
15755:2eb3469a28a0 15756:1d652bca512e
    50     fn bin_index(&self, position: &FPPoint) -> Point {
    50     fn bin_index(&self, position: &FPPoint) -> Point {
    51         self.index.map(fppoint_round(position))
    51         self.index.map(fppoint_round(position))
    52     }
    52     }
    53 
    53 
    54     fn get_bin(&mut self, index: Point) -> &mut GridBin {
    54     fn get_bin(&mut self, index: Point) -> &mut GridBin {
    55         &mut self.bins[index.x as usize * self.bins_count.width + index.y as usize]
    55         &mut self.bins[index.y as usize * self.bins_count.width + index.x as usize]
    56     }
    56     }
    57 
    57 
    58     fn lookup_bin(&mut self, position: &FPPoint) -> &mut GridBin {
    58     fn lookup_bin(&mut self, position: &FPPoint) -> &mut GridBin {
    59         self.get_bin(self.bin_index(position))
    59         self.get_bin(self.bin_index(position))
    60     }
    60     }