pub struct StreamingTileMap {
pub tile_size_world: f32,
pub tiles: HashMap<(i32, i32), StreamingTile>,
pub world_origin: Vec3,
pub max_tiles: usize,
}Fields§
§tile_size_world: f32§tiles: HashMap<(i32, i32), StreamingTile>§world_origin: Vec3§max_tiles: usizeImplementations§
Source§impl StreamingTileMap
impl StreamingTileMap
pub fn new(tile_size_world: f32) -> Self
pub fn world_to_tile(&self, world_pos: Vec3) -> (i32, i32)
pub fn get_or_create(&mut self, tile_x: i32, tile_y: i32) -> &mut StreamingTile
pub fn get(&self, tile_x: i32, tile_y: i32) -> Option<&StreamingTile>
pub fn tiles_in_radius(&self, center: Vec3, radius: f32) -> Vec<(i32, i32)>
pub fn tiles_in_frustum(&self, frustum: &Frustum) -> Vec<(i32, i32)>
pub fn add_level_to_tile(&mut self, tile_x: i32, tile_y: i32, level_id: u64)
pub fn remove_level_from_all(&mut self, level_id: u64)
pub fn tile_count(&self) -> usize
pub fn stale_tiles( &self, current_time: f64, max_age_seconds: f64, ) -> Vec<(i32, i32)>
pub fn evict_stale(&mut self, current_time: f64, max_age_seconds: f64) -> usize
Trait Implementations§
Source§impl Clone for StreamingTileMap
impl Clone for StreamingTileMap
Auto Trait Implementations§
impl Freeze for StreamingTileMap
impl RefUnwindSafe for StreamingTileMap
impl Send for StreamingTileMap
impl Sync for StreamingTileMap
impl Unpin for StreamingTileMap
impl UnsafeUnpin for StreamingTileMap
impl UnwindSafe for StreamingTileMap
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.