pub struct CavityConfig {
pub rays: u32,
pub max_ray_dist: f64,
pub min_feedback: f32,
pub max_feedback: f32,
pub max_wet: f32,
pub outdoor_openness: f32,
pub damping: f32,
pub material_map: Vec<(Rgb, u8)>,
pub damping_override: Vec<(u8, f32)>,
pub smoothing: f32,
}Expand description
Tuning knobs for the cavity probe + the reverb mapping.
Fields§
§rays: u32Rays in the golden-spiral fan. Default 32 (the Sound Physics
bounce budget). Clamped to at least 4.
max_ray_dist: f64Probe radius, world/voxel units: rays that reach it without a
hit count as escaped (open sky / huge space). Also the free
path a miss contributes to the mean. Deliberately SEPARATE from
the occlusion budget (AcousticsConfig::max_distance, default
128): occlusion reaches as far as sources are audible, the
reverb probe only needs the local room.
min_feedback: f32Reverb feedback (decay) in the smallest enclosed space.
max_feedback: f32Reverb feedback when the enclosed free path (walls actually
hit — escaped rays don’t inflate room size) reaches
max_ray_dist.
max_wet: f32Wet mix in a fully enclosed space.
outdoor_openness: f32Openness at (and beyond) which the wet mix reaches zero. A
listener standing on open ground always has ~half the fan in
the ground, so raw openness tops out near 0.5 outdoors — this
threshold makes that read as fully dry instead of half-wet.
Default 0.5; a sealed cavern (openness 0) is unaffected.
damping: f32Reverb damping (high-frequency loss) of the default
material — used verbatim when
damping_override is empty, and as
the fallback for unmapped materials / colour-less wall hits
when it is not (AU2.1).
material_map: Vec<(Rgb, u8)>AU2.1 — the host’s colour→material terrain map (the SAME map
crate::AcousticsConfig::material_map and the renderer
take), classifying the wall cells the probe rays hit. Only
consulted when damping_override is
non-empty.
damping_override: Vec<(u8, f32)>AU2.1 — material id → reverb damping for walls of that
material: the probe’s effective damping is the mean over hit
rays (a glass cavern at 0.1 rings brighter than stone at
the default). Unmapped materials and colour-less hits (carved
faces, bedrock) fall back to damping.
Empty (the default) keeps the exact legacy behaviour —
reverb_damping passes damping through
bit-identically, no classification runs. Colours absent from
the map classify as material 0, so an entry for id 0 here
re-damps every unmapped-but-coloured wall (the engine-wide
“0 = default material” convention).
smoothing: f32Fraction of the OLD smoothed value kept per
CavityEstimator::update — 0.75 is the prior art’s
(3·old + new) / 4. 0 disables smoothing.
Trait Implementations§
Source§impl Clone for CavityConfig
impl Clone for CavityConfig
Source§impl Debug for CavityConfig
impl Debug for CavityConfig
Source§impl Default for CavityConfig
impl Default for CavityConfig
Source§impl PartialEq for CavityConfig
impl PartialEq for CavityConfig
impl StructuralPartialEq for CavityConfig
Auto Trait Implementations§
impl Freeze for CavityConfig
impl RefUnwindSafe for CavityConfig
impl Send for CavityConfig
impl Sync for CavityConfig
impl Unpin for CavityConfig
impl UnsafeUnpin for CavityConfig
impl UnwindSafe for CavityConfig
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