pub struct GridSpec { /* private fields */ }Expand description
Uniform 3D grid configuration.
Implementations§
Source§impl GridSpec
impl GridSpec
Sourcepub fn new(cell_size: f32) -> Result<Self, GridSpecError>
pub fn new(cell_size: f32) -> Result<Self, GridSpecError>
Creates a grid spec when cell_size is finite and positive.
Sourcepub fn cell_at(self, position: Position3) -> CellCoord3
pub fn cell_at(self, position: Position3) -> CellCoord3
Maps a world-space position to a cell coordinate.
Sourcepub fn cells_for_aabb(self, aabb: Aabb3) -> Vec<CellCoord3>
pub fn cells_for_aabb(self, aabb: Aabb3) -> Vec<CellCoord3>
Returns all cells touched by an AABB.
Sourcepub fn cells_for_bounds(
self,
position: Position3,
bounds: Bounds,
) -> Vec<CellCoord3>
pub fn cells_for_bounds( self, position: Position3, bounds: Bounds, ) -> Vec<CellCoord3>
Returns all cells touched by entity bounds at position.
Trait Implementations§
impl Copy for GridSpec
impl StructuralPartialEq for GridSpec
Auto Trait Implementations§
impl Freeze for GridSpec
impl RefUnwindSafe for GridSpec
impl Send for GridSpec
impl Sync for GridSpec
impl Unpin for GridSpec
impl UnsafeUnpin for GridSpec
impl UnwindSafe for GridSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more