Skip to main content

SpatialPrefetchGrid

Struct SpatialPrefetchGrid 

Source
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.

Source

pub fn new(cell_size: f32) -> Self

Creates an empty SpatialPrefetchGrid with uniform cell width cell_size.

§Arguments
  • f32 - Uniform 3D spatial cell width in meters (clamped to >= 1.0).
§Returns
  • Self - Empty spatial prefetch grid.
Source

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.
Source

pub fn unregister_anchor(&mut self, key_hash: u64) -> bool

Removes a previously registered spatial anchor by 64-bit asset key hash.

§Arguments
  • u64 - Deterministic 64-bit asset key hash.
§Returns
  • bool - true when an anchor existed and was removed.
Source

pub fn anchor_count(&self) -> usize

Returns the count of registered spatial asset anchors.

§Returns
  • usize - Active anchor count.
Source

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.
Source

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.
Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpatialPrefetchGrid

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SpatialPrefetchGrid

Default spatial hash prefetcher configured with 16m uniform grid cells.

Source§

fn default() -> Self

Creates an empty SpatialPrefetchGrid using PREFETCH_DEFAULT_CELL_SIZE.

§Returns
  • Self - Empty spatial prefetch index.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.