MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / enclosing_cell

Method enclosing_cell

splashsurf_lib/src/uniform_grid.rs:444–451  ·  view source on GitHub ↗
(&self, coord: &Vector3<R>)

Source from the content-addressed store, hash-verified

442 /// return negative indices or indices larger than the number of cells per dimension.
443 #[inline(always)]
444 pub fn enclosing_cell(&self, coord: &Vector3<R>) -> [I; 3] {
445 let normalized_coord = (coord - self.aabb.min()) / self.cell_size;
446 [
447 normalized_coord[0].floor().to_index_unchecked(),
448 normalized_coord[1].floor().to_index_unchecked(),
449 normalized_coord[2].floor().to_index_unchecked(),
450 ]
451 }
452
453 /// Returns an AABB of the given cell
454 #[inline(always)]

Calls 2

to_index_uncheckedMethod · 0.80
minMethod · 0.45

Tested by

no test coverage detected