pub struct AcousticsConfig {
pub rays: u32,
pub jitter_radius: f64,
pub absorption_per_voxel: f64,
pub open_cutoff_hz: f32,
pub occluded_cutoff_hz: f32,
pub max_occlusion_db: f32,
pub send_occlusion_frac: f32,
pub max_distance: f64,
}Expand description
Tuning knobs for source_acoustics. The defaults are the cave-demo
tuning; every field is plain data so hosts can persist or lerp them.
Fields§
§rays: u32Jittered rays per source→listener query, including the direct
ray. 1 = direct only; the default 9 (direct + an 8-point ring)
matches the Sound Physics budget and gives soft doorway
transitions. Clamped to at least 1.
jitter_radius: f64Radius (world/voxel units) of the jitter ring around the source, perpendicular to the source→listener axis. Roughly “how big is the emitter”: bigger radii leak more around thin edges.
absorption_per_voxel: f64Per-voxel absorption: a ray crossing t voxels of solid keeps
exp(-absorption · t) of its energy. 0.25 ⇒ ~78% through a
1-voxel wall, ~29% through 5.
open_cutoff_hz: f32Lowpass cutoff at full transmission (unoccluded), Hz.
occluded_cutoff_hz: f32Lowpass cutoff at zero transmission (fully buried), Hz.
max_occlusion_db: f32Gain applied at zero transmission, decibels (negative). Scales
linearly with 1 - transmission; distance attenuation is NOT
included (that is the spatial backend’s job).
send_occlusion_frac: f32Fraction of the occlusion gain also applied to the reverb send —
a buried source still excites the room, just less. 0.5 halves
the dB loss on the send relative to the dry path.
max_distance: f64Hard cap on the marched source→listener distance (world units);
beyond it no rays are cast and the source reports
SourceAcoustics::clear — distance attenuation is the spatial
backend’s job, and a far-away source in open air must NOT come
back muffled. Bounds the DDA cost.
Trait Implementations§
Source§impl Clone for AcousticsConfig
impl Clone for AcousticsConfig
Source§fn clone(&self) -> AcousticsConfig
fn clone(&self) -> AcousticsConfig
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 AcousticsConfig
impl Debug for AcousticsConfig
Source§impl Default for AcousticsConfig
impl Default for AcousticsConfig
Source§impl PartialEq for AcousticsConfig
impl PartialEq for AcousticsConfig
Source§fn eq(&self, other: &AcousticsConfig) -> bool
fn eq(&self, other: &AcousticsConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AcousticsConfig
Auto Trait Implementations§
impl Freeze for AcousticsConfig
impl RefUnwindSafe for AcousticsConfig
impl Send for AcousticsConfig
impl Sync for AcousticsConfig
impl Unpin for AcousticsConfig
impl UnsafeUnpin for AcousticsConfig
impl UnwindSafe for AcousticsConfig
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