pub struct ChunkBounds {
pub min: Vec3,
pub max: Vec3,
}Fields§
§min: Vec3§max: Vec3Implementations§
Source§impl ChunkBounds
impl ChunkBounds
pub fn new(min: Vec3, max: Vec3) -> Self
pub fn from_center_size(center: Vec3, half_size: Vec3) -> Self
pub fn from_chunk_coord(coord: &ChunkCoord, chunk_size: f32) -> Self
pub fn contains(&self, point: Vec3) -> bool
pub fn intersects(&self, other: &ChunkBounds) -> bool
pub fn expand(&self, amount: f32) -> ChunkBounds
pub fn volume(&self) -> f32
pub fn center(&self) -> Vec3
pub fn size(&self) -> Vec3
pub fn surface_area(&self) -> f32
pub fn half_size(&self) -> Vec3
pub fn merge(&self, other: &ChunkBounds) -> ChunkBounds
pub fn intersection(&self, other: &ChunkBounds) -> Option<ChunkBounds>
pub fn distance_sq_to_point(&self, point: Vec3) -> f32
pub fn distance_to_point(&self, point: Vec3) -> f32
pub fn closest_point(&self, point: Vec3) -> Vec3
pub fn farthest_point(&self, point: Vec3) -> Vec3
pub fn octant_bounds(&self, octant: usize) -> ChunkBounds
pub fn octant_for_point(&self, point: Vec3) -> usize
pub fn transformed_by(&self, transform: Mat4) -> ChunkBounds
pub fn corners(&self) -> [Vec3; 8]
pub fn is_degenerate(&self) -> bool
pub fn scale(&self, factor: f32) -> ChunkBounds
Trait Implementations§
Source§impl Clone for ChunkBounds
impl Clone for ChunkBounds
Source§impl Debug for ChunkBounds
impl Debug for ChunkBounds
Source§impl PartialEq for ChunkBounds
impl PartialEq for ChunkBounds
impl StructuralPartialEq for ChunkBounds
Auto Trait Implementations§
impl Freeze for ChunkBounds
impl RefUnwindSafe for ChunkBounds
impl Send for ChunkBounds
impl Sync for ChunkBounds
impl Unpin for ChunkBounds
impl UnsafeUnpin for ChunkBounds
impl UnwindSafe for ChunkBounds
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.