Flint Engine / Guide / API Reference

OceanParams

Struct OceanParams 

Source
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: i64

RNG seed; same seed + params → identical spectrum.

§num_waves: usize

Number of waves (clamped to 1..=MAX_WAVES).

§wavelength_min: f32

Shortest wavelength in meters.

§wavelength_max: f32

Longest wavelength in meters.

§amplitude: f32

Total wave amplitude in meters: Σ Aᵢ (max possible crest height).

§choppiness: f32

0 = rolling swells, 1 = maximum-sharp trochoids (pre-cusp).

§direction_deg: f32

Wind/primary travel direction in degrees (0 = +Z, 90 = +X).

§spread_deg: f32

Directional spread in degrees; small waves wander more than large.

§speed_scale: f32

Multiplier on time — a “becalmed” slider (1 = physical speed).

§wind_speed: f32

Wind 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: f32

Wind fetch in kilometers (how far the wind has blown over open water). Longer fetch → energy concentrates in longer swells.

§peak_enhancement: f32

JONSWAP peak-enhancement γ: 1 = broad Pierson-Moskowitz sea, 3.3 = typical North Sea, higher = narrow single-swell character.

Implementations§

Source§

impl OceanParams

Source

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

Source§

fn clone(&self) -> OceanParams

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OceanParams

Source§

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

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

impl Default for OceanParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for OceanParams

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 StructuralPartialEq for OceanParams

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> Same for T

Source§

type Output = T

Should always be Self
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.