pub struct StreamRadius {
pub r_active: f64,
pub r_evict: f64,
}Expand description
Per-grid streaming activity / eviction radii (S7.1).
Both values are in grid-local voxel units — the same scale
as a GridLocalPos::voxel coordinate. The math falls out
cleanly from there: chunks span fixed integer voxel extents and
the camera’s grid-local position is also expressed in voxels.
Semantics inside crate::Scene::pump_streaming_sync:
- A chunk whose AABB-to-camera distance is
≤ r_activeMUST be loaded; if absent + a generator is attached, it gets streamed in viacrate::Grid::ensure_chunk_generated. - A chunk whose AABB-to-camera distance is
> r_evictis dropped from the chunk map. - Chunks in the hysteresis band
(r_active, r_evict]are neither streamed in nor evicted — they’re left as-is. The gap prevents a camera oscillating near a boundary from thrashing generation + eviction.
The Default / Self::DISABLED value is r_active = 0,
r_evict = ∞: crate::Scene::pump_streaming_sync is a no-op.
Existing grids keep the pre-S7 “absent stays absent, present
stays present” behaviour until a caller opts in.
Fields§
§r_active: f64Chunks closer than this (grid-local voxels, AABB distance) are streamed in.
r_evict: f64Chunks farther than this (grid-local voxels, AABB distance)
are evicted. Must be ≥ r_active.
Implementations§
Source§impl StreamRadius
impl StreamRadius
Sourcepub const DISABLED: Self
pub const DISABLED: Self
r_active = 0, r_evict = ∞ — pump_streaming_sync
never streams a chunk in or evicts one. The default for
pre-S7.1 grids.
Sourcepub fn new(r_active: f64, r_evict: f64) -> Self
pub fn new(r_active: f64, r_evict: f64) -> Self
New radius pair. Requires r_evict >= r_active so the
hysteresis band is well-formed (or empty when ==).
§Panics
Panics if r_evict < r_active, if r_active is NaN or
negative, or if r_evict is negative. NaN and negative
radii are policy bugs — failing loud at construction beats
silently degenerating chunk-AABB tests later.
Sourcepub fn is_disabled(self) -> bool
pub fn is_disabled(self) -> bool
true for the Self::DISABLED sentinel pair. Lets
pump_streaming_sync skip the per-grid pass cheaply when
streaming is off.
Trait Implementations§
Source§impl Clone for StreamRadius
impl Clone for StreamRadius
Source§fn clone(&self) -> StreamRadius
fn clone(&self) -> StreamRadius
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamRadius
impl Debug for StreamRadius
Source§impl Default for StreamRadius
impl Default for StreamRadius
Source§impl PartialEq for StreamRadius
impl PartialEq for StreamRadius
Source§fn eq(&self, other: &StreamRadius) -> bool
fn eq(&self, other: &StreamRadius) -> bool
self and other values to be equal, and is used by ==.impl Copy for StreamRadius
impl StructuralPartialEq for StreamRadius
Auto Trait Implementations§
impl Freeze for StreamRadius
impl RefUnwindSafe for StreamRadius
impl Send for StreamRadius
impl Sync for StreamRadius
impl Unpin for StreamRadius
impl UnsafeUnpin for StreamRadius
impl UnwindSafe for StreamRadius
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more