pub struct QuadtreeNode {
pub x: usize,
pub y: usize,
pub size: usize,
pub lod: u8,
pub children: Option<[Box<QuadtreeNode>; 4]>,
pub min_h: f32,
pub max_h: f32,
pub center: Vec3,
pub is_leaf: bool,
}Fields§
§x: usize§y: usize§size: usize§lod: u8§children: Option<[Box<QuadtreeNode>; 4]>§min_h: f32§max_h: f32§center: Vec3§is_leaf: boolImplementations§
Source§impl QuadtreeNode
impl QuadtreeNode
pub fn new(x: usize, y: usize, size: usize, cell_size: f32) -> Self
pub fn build( hmap: &Heightmap, x: usize, y: usize, size: usize, min_size: usize, cell_size: f32, depth: u8, ) -> Box<Self>
Sourcepub fn collect_visible<'a>(
&'a self,
frustum: &Frustum,
cam_pos: Vec3,
max_lod: u8,
out: &mut Vec<&'a QuadtreeNode>,
cell_size: f32,
height_scale: f32,
)
pub fn collect_visible<'a>( &'a self, frustum: &Frustum, cam_pos: Vec3, max_lod: u8, out: &mut Vec<&'a QuadtreeNode>, cell_size: f32, height_scale: f32, )
Collect visible leaf nodes given a frustum and camera position
Trait Implementations§
Source§impl Clone for QuadtreeNode
impl Clone for QuadtreeNode
Auto Trait Implementations§
impl Freeze for QuadtreeNode
impl RefUnwindSafe for QuadtreeNode
impl Send for QuadtreeNode
impl Sync for QuadtreeNode
impl Unpin for QuadtreeNode
impl UnsafeUnpin for QuadtreeNode
impl UnwindSafe for QuadtreeNode
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.