Skip to main content

CaveParams

Struct CaveParams 

Source
pub struct CaveParams {
    pub seed: u64,
    pub seed_count: usize,
    pub air_ratio: f32,
    pub anisotropy: f32,
    pub perlin_octaves: u32,
    pub perlin_amplitude: f32,
}
Expand description

Parameters for the procedural cave generators.

All fields are public so callers can override per-preset defaults. Generators are expected to fall back to their preset-specific defaults when the user constructs a CaveParams via CaveParams::default — that returns the “blue cave” baseline from caveblue2m.jpg. Other presets (e.g., MagCaveGenerator) supply their own defaults via factory constructors.

Fields§

§seed: u64

RNG seed. Same seed + same params + same code → byte-stable output. Promotes determinism across runs and platforms.

§seed_count: usize

Number of Worley seed points placed in the volume. Controls the cave’s chamber-vs-corridor texture.

§air_ratio: f32

Fraction of seeds tagged “air” (the rest are “solid”). Higher values produce more open caves.

§anisotropy: f32

Per-seed distance scaling factor — voxlap CaveTex’s “shape” parameter. 1.0 produces isotropic Worley cells; > 1.0 elongates them along an arbitrary axis.

§perlin_octaves: u32

Number of Perlin-noise octaves overlaid on the air/solid boundary to break up Worley’s clean facets.

§perlin_amplitude: f32

Magnitude of the Perlin overlay (added to d_a in the classification step). Larger values give more organic surfaces; 0 disables overlay.

Trait Implementations§

Source§

impl Clone for CaveParams

Source§

fn clone(&self) -> CaveParams

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 CaveParams

Source§

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

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

impl Default for CaveParams

Source§

fn default() -> Self

“Blue cave” baseline matching caveblue2m.jpg.

Source§

impl PartialEq for CaveParams

Source§

fn eq(&self, other: &CaveParams) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for CaveParams

Source§

impl StructuralPartialEq for CaveParams

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.