pub struct WorldPartition {
pub cells: HashMap<ChunkCoord, WorldPartitionCell>,
pub cell_size: f32,
pub actor_to_cell: HashMap<u32, ChunkCoord>,
pub loaded_cells: HashSet<ChunkCoord>,
pub streaming_sources: Vec<Vec3>,
pub bounds: ChunkBounds,
}Fields§
§cells: HashMap<ChunkCoord, WorldPartitionCell>§cell_size: f32§actor_to_cell: HashMap<u32, ChunkCoord>§loaded_cells: HashSet<ChunkCoord>§streaming_sources: Vec<Vec3>§bounds: ChunkBoundsImplementations§
Source§impl WorldPartition
impl WorldPartition
pub fn new(cell_size: f32) -> Self
pub fn register_actor(&mut self, actor_id: u32, world_pos: Vec3)
pub fn unregister_actor(&mut self, actor_id: u32)
pub fn move_actor(&mut self, actor_id: u32, new_pos: Vec3)
pub fn add_streaming_source(&mut self, pos: Vec3)
pub fn clear_streaming_sources(&mut self)
pub fn compute_cells_to_load(&self, load_radius: f32) -> HashSet<ChunkCoord>
pub fn get_actors_in_bounds(&self, bounds: &ChunkBounds) -> Vec<u32>
pub fn get_actors_in_radius(&self, center: Vec3, radius: f32) -> Vec<u32>
pub fn cell_count(&self) -> usize
pub fn actor_count(&self) -> usize
Trait Implementations§
Source§impl Clone for WorldPartition
impl Clone for WorldPartition
Auto Trait Implementations§
impl Freeze for WorldPartition
impl RefUnwindSafe for WorldPartition
impl Send for WorldPartition
impl Sync for WorldPartition
impl Unpin for WorldPartition
impl UnsafeUnpin for WorldPartition
impl UnwindSafe for WorldPartition
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.