pub struct UniformGridGpu {
pub cell_size: f32,
pub origin: [f32; 3],
pub dims: [u32; 3],
}Expand description
Uniform 3-D grid for GPU broadphase.
Fields§
§cell_size: f32Cell size (same in all dimensions).
origin: [f32; 3]World-space origin of the grid [ox, oy, oz].
dims: [u32; 3]Number of cells in each dimension [nx, ny, nz].
Implementations§
Source§impl UniformGridGpu
impl UniformGridGpu
Sourcepub fn new(cell_size: f32, origin: [f32; 3], dims: [u32; 3]) -> Self
pub fn new(cell_size: f32, origin: [f32; 3], dims: [u32; 3]) -> Self
Create a new uniform grid.
Sourcepub fn cell_of(&self, pos: [f32; 3]) -> [i32; 3]
pub fn cell_of(&self, pos: [f32; 3]) -> [i32; 3]
Compute the cell index [ix, iy, iz] for a world-space position.
Trait Implementations§
Source§impl Clone for UniformGridGpu
impl Clone for UniformGridGpu
Source§fn clone(&self) -> UniformGridGpu
fn clone(&self) -> UniformGridGpu
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for UniformGridGpu
impl RefUnwindSafe for UniformGridGpu
impl Send for UniformGridGpu
impl Sync for UniformGridGpu
impl Unpin for UniformGridGpu
impl UnsafeUnpin for UniformGridGpu
impl UnwindSafe for UniformGridGpu
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more