pub struct SpatialQuerySystem {
pub bvh: Option<BvhNode>,
pub octree: Option<OctreeNode>,
pub visibility_grid: VisibilityGrid,
pub object_bounds: HashMap<u32, ChunkBounds>,
}Fields§
§bvh: Option<BvhNode>§octree: Option<OctreeNode>§visibility_grid: VisibilityGrid§object_bounds: HashMap<u32, ChunkBounds>Implementations§
Source§impl SpatialQuerySystem
impl SpatialQuerySystem
pub fn new(grid_cell_size: f32) -> Self
pub fn register_object(&mut self, id: u32, pos: Vec3, bounds: ChunkBounds)
pub fn unregister_object(&mut self, id: u32)
pub fn raycast( &self, origin: Vec3, direction: Vec3, max_dist: f32, ) -> Vec<SpatialQueryResult>
pub fn overlap_sphere(&self, center: Vec3, radius: f32) -> Vec<u32>
pub fn overlap_aabb(&self, bounds: &ChunkBounds) -> Vec<u32>
pub fn frustum_query(&self, frustum: &FrustumCulling) -> Vec<u32>
pub fn rebuild_bvh(&mut self)
pub fn rebuild_octree(&mut self)
Trait Implementations§
Source§impl Clone for SpatialQuerySystem
impl Clone for SpatialQuerySystem
Auto Trait Implementations§
impl Freeze for SpatialQuerySystem
impl RefUnwindSafe for SpatialQuerySystem
impl Send for SpatialQuerySystem
impl Sync for SpatialQuerySystem
impl Unpin for SpatialQuerySystem
impl UnsafeUnpin for SpatialQuerySystem
impl UnwindSafe for SpatialQuerySystem
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.