pub struct OceanParams {
pub seed: i64,
pub num_waves: usize,
pub wavelength_min: f32,
pub wavelength_max: f32,
pub amplitude: f32,
pub choppiness: f32,
pub direction_deg: f32,
pub spread_deg: f32,
pub speed_scale: f32,
pub wind_speed: f32,
pub fetch_km: f32,
pub peak_enhancement: f32,
}Expand description
Simulation parameters — everything that shapes the spectrum.
These map 1:1 to the ocean component fields (see schemas/components/ocean.toml).
Fields§
§seed: i64RNG seed; same seed + params → identical spectrum.
num_waves: usizeNumber of waves (clamped to 1..=MAX_WAVES).
wavelength_min: f32Shortest wavelength in meters.
wavelength_max: f32Longest wavelength in meters.
amplitude: f32Total wave amplitude in meters: Σ Aᵢ (max possible crest height).
choppiness: f320 = rolling swells, 1 = maximum-sharp trochoids (pre-cusp).
direction_deg: f32Wind/primary travel direction in degrees (0 = +Z, 90 = +X).
spread_deg: f32Directional spread in degrees; small waves wander more than large.
speed_scale: f32Multiplier on time — a “becalmed” slider (1 = physical speed).
wind_speed: f32Wind speed in m/s — shapes the JONSWAP energy distribution
(which wavelengths carry the sea’s energy). Total height stays
governed by amplitude; this shifts WHERE that height lives.
fetch_km: f32Wind fetch in kilometers (how far the wind has blown over open water). Longer fetch → energy concentrates in longer swells.
peak_enhancement: f32JONSWAP peak-enhancement γ: 1 = broad Pierson-Moskowitz sea, 3.3 = typical North Sea, higher = narrow single-swell character.
Implementations§
Source§impl OceanParams
impl OceanParams
Sourcepub fn from_component(value: &Value) -> Self
pub fn from_component(value: &Value) -> Self
Read params from an ocean component TOML table; missing fields keep defaults.
Trait Implementations§
Source§impl Clone for OceanParams
impl Clone for OceanParams
Source§fn clone(&self) -> OceanParams
fn clone(&self) -> OceanParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more