pub struct VegetationQuery<'a> { /* private fields */ }Expand description
Query API for finding vegetation near a position.
Implementations§
Source§impl<'a> VegetationQuery<'a>
impl<'a> VegetationQuery<'a>
pub fn new(system: &'a VegetationSystem) -> Self
Sourcepub fn trees_near(&self, pos: Vec3, radius: f32) -> Vec<&VegetationInstance>
pub fn trees_near(&self, pos: Vec3, radius: f32) -> Vec<&VegetationInstance>
Find all visible trees within radius of pos.
Sourcepub fn nearest_tree(&self, pos: Vec3) -> Option<&VegetationInstance>
pub fn nearest_tree(&self, pos: Vec3) -> Option<&VegetationInstance>
Find the nearest tree to pos.
Sourcepub fn count_by_kind(&self, pos: Vec3, radius: f32) -> HashMap<String, usize>
pub fn count_by_kind(&self, pos: Vec3, radius: f32) -> HashMap<String, usize>
Count instances of each kind within radius.
Sourcepub fn rocks_near(&self, pos: Vec3, radius: f32) -> Vec<&VegetationInstance>
pub fn rocks_near(&self, pos: Vec3, radius: f32) -> Vec<&VegetationInstance>
Find all rocks within radius.
Auto Trait Implementations§
impl<'a> Freeze for VegetationQuery<'a>
impl<'a> RefUnwindSafe for VegetationQuery<'a>
impl<'a> Send for VegetationQuery<'a>
impl<'a> Sync for VegetationQuery<'a>
impl<'a> Unpin for VegetationQuery<'a>
impl<'a> UnsafeUnpin for VegetationQuery<'a>
impl<'a> UnwindSafe for VegetationQuery<'a>
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> 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.