pub struct NoiseProvider { /* private fields */ }Expand description
A built-in CPU fBm-terrain provider.
Implementations§
Source§impl NoiseProvider
impl NoiseProvider
pub fn new(p: NoiseParams) -> Self
Trait Implementations§
Source§impl CpuSurfaceProvider for NoiseProvider
impl CpuSurfaceProvider for NoiseProvider
Source§fn bake(&self, frame: &FaceFrame, chunk: &Chunk, tile_res: u32) -> ChunkSurface
fn bake(&self, frame: &FaceFrame, chunk: &Chunk, tile_res: u32) -> ChunkSurface
Resample this chunk’s surface at
tile_res × tile_res. Called on a bake
worker thread. A streaming provider may also enqueue any data it still
needs (a side effect) so poll_refresh can later
report the chunk for a re-bake once that data arrives.Source§fn sample_height(&self, dir: Vector3) -> Option<f32>
fn sample_height(&self, dir: Vector3) -> Option<f32>
Surface displacement at
dir, in the height buffer’s unit (multiply by
height_scale · radius for world units). Steers LOD
toward the displaced surface. None ⇒ no data (treated as sea level).Source§fn height_scale(&self) -> f32
fn height_scale(&self) -> f32
Per-height-unit displaced-radius factor for the GPU: the surface radius
becomes
radius · (1 + height · height_scale).Source§fn poll_refresh(&self) -> Vec<Chunk>
fn poll_refresh(&self) -> Vec<Chunk>
Chunks whose awaited data has arrived and should be re-baked (streaming).
Called each frame on the main thread; a non-streaming provider returns
empty. Returns whole [
Chunk]s (not just ids) so the caller can re-queue
a bake directly.Source§fn set_wanted(&self, _ids: &HashSet<ChunkId>)
fn set_wanted(&self, _ids: &HashSet<ChunkId>)
Camera-driven cancellation hint: the set of chunk ids still in view.
Streaming providers drop bookkeeping / downloads for anything else.
Source§fn base_ready(&self) -> bool
fn base_ready(&self) -> bool
Is enough data present for the surface to be shown (the GPU
surface_enabled gate)? A streaming provider returns false until its base
map lands; a self-contained provider (noise) is always ready.Source§fn resources_in_flight(&self) -> usize
fn resources_in_flight(&self) -> usize
External resource fetches in flight (streaming providers; for the HUD).
Auto Trait Implementations§
impl Freeze for NoiseProvider
impl RefUnwindSafe for NoiseProvider
impl Send for NoiseProvider
impl Sync for NoiseProvider
impl Unpin for NoiseProvider
impl UnsafeUnpin for NoiseProvider
impl UnwindSafe for NoiseProvider
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