raisin::GerstnerWave
struct · #include <rayrai/Water.hpp>
One trochoidal (Gerstner) wave.
With k = 2 pi / wavelength, omega = sqrt(g k) and theta = k * dot(direction, p) - omega * t + phase, the surface point that rests at the horizontal position p moves to p - direction * (steepness / k) * sin(theta) and rises to amplitude * cos(theta). The wave travels along direction; the points gather at the crests, which grow sharper with the steepness, and spread out in the troughs.
Public attributes
direction
glm::vec2 directionTravel direction in the water body frame (normalized; must not be zero).
wavelength
float wavelengthCrest-to-crest distance, metres (> 0).
amplitude
float amplitudeCrest height above the mean level, metres (>= 0).
steepness
float steepnessk times the horizontal displacement amplitude, [0, 1]: 0 is a sine wave, 1 a cusped crest. Where the crests of several waves meet and their steepness adds up above 1, the surface folds over itself.
phase
float phasePhase offset, radians.