pub struct SpatialPrefetchGrid { /* private fields */ }Expand description
Uniform 3D spatial hash index accelerating velocity-predicted lookahead prefetching and rear-frustum cancellation.
Implementations§
Source§impl SpatialPrefetchGrid
Spatial anchor registration, lookahead sphere querying, and rear-camera cancellation for SpatialPrefetchGrid.
impl SpatialPrefetchGrid
Spatial anchor registration, lookahead sphere querying, and rear-camera cancellation for SpatialPrefetchGrid.
Sourcepub fn register_anchor(&mut self, anchor: SpatialAssetAnchor)
pub fn register_anchor(&mut self, anchor: SpatialAssetAnchor)
Registers or replaces a spatial asset anchor inside all overlapping 3D hash cells.
§Arguments
SpatialAssetAnchor- Asset spatial anchor descriptor.
Sourcepub fn unregister_anchor(&mut self, key_hash: u64) -> bool
pub fn unregister_anchor(&mut self, key_hash: u64) -> bool
Sourcepub fn anchor_count(&self) -> usize
pub fn anchor_count(&self) -> usize
Sourcepub fn mark_prefetched(&mut self, key_hash: u64)
pub fn mark_prefetched(&mut self, key_hash: u64)
Marks key_hash as having an active speculative prefetch job eligible for behind-camera cancellation.
§Arguments
u64- Asset key hash currently being prefetched.
Sourcepub fn unmark_prefetched(&mut self, key_hash: u64)
pub fn unmark_prefetched(&mut self, key_hash: u64)
Clears key_hash from the active speculative prefetch set once resident or cancelled.
§Arguments
u64- Asset key hash to clear.
Sourcepub fn query_lookahead(
&self,
volume: &SpatialPrefetchVolume,
out_prefetch: &mut Vec<SpatialAssetAnchor>,
out_cancel: &mut Vec<u64>,
)
pub fn query_lookahead( &self, volume: &SpatialPrefetchVolume, out_prefetch: &mut Vec<SpatialAssetAnchor>, out_cancel: &mut Vec<u64>, )
Queries the velocity-predicted lookahead sphere pos + vel * lookahead_secs for upcoming assets and identifies trailing behind-camera prefetches to cancel.
§Arguments
&SpatialPrefetchVolume- Camera position, velocity, horizon, and spherical prefetch radius.&mut Vec<SpatialAssetAnchor>- Destination list populated with upcoming lookahead anchors ordered nearest-first.&mut Vec<u64>- Destination list populated with trailing behind-camera asset key hashes to cancel.
Trait Implementations§
Source§impl Clone for SpatialPrefetchGrid
impl Clone for SpatialPrefetchGrid
Source§impl Debug for SpatialPrefetchGrid
impl Debug for SpatialPrefetchGrid
Auto Trait Implementations§
impl Forget for SpatialPrefetchGrid
impl Freeze for SpatialPrefetchGridwhere
*const u8 is !null: Freeze,
PhantomData<Option<SpatialAssetAnchor>>: Freeze,
PhantomData<(u64, usize)>: Freeze,
PhantomData<((i32, i32, i32), Vec<usize>)>: Freeze,
PhantomData<(u64, ())>: Freeze,
impl Move for SpatialPrefetchGrid
impl RefUnwindSafe for SpatialPrefetchGrid
impl Send for SpatialPrefetchGrid
impl Sync for SpatialPrefetchGrid
impl Unpin for SpatialPrefetchGrid
impl UnsafeUnpin for SpatialPrefetchGridwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Option<SpatialAssetAnchor>>: UnsafeUnpin,
PhantomData<(u64, usize)>: UnsafeUnpin,
PhantomData<((i32, i32, i32), Vec<usize>)>: UnsafeUnpin,
PhantomData<(u64, ())>: UnsafeUnpin,
impl UnwindSafe for SpatialPrefetchGridwhere
RawVecInner: UnwindSafe,
HashMap<u64, usize>: UnwindSafe,
HashMap<(i32, i32, i32), Vec<usize>>: UnwindSafe,
NonNull<u8>: UnwindSafe,
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