raisin::WaterWaveSpectrum
struct · #include <rayrai/Water.hpp>
Parameters of generateGerstnerWaves(): a wind-driven set of waves, long to short.
Wave i of n gets the rank a = 1 - i / n, jittered by randomness / n. Its wavelength is mix(minWavelength, maxWavelength, a^wavelengthFalloff), its amplitude mix(minAmplitude, maxAmplitude, a^amplitudeFalloff) and its steepness mix(longWaveSteepness, shortWaveSteepness, (i / n)^steepnessFalloff), scaled down together when they add up to more than maxSteepnessSum. Wave 0 travels along the wind; the others are turned by a random angle within +-directionSpreadRadians.
Public attributes
waveCount
int waveCountNumber of waves, [1, kMaxWaterWaves].
seed
uint32_t seedSeed of the directions, the jitter and the phases.
windAngleRadians
float windAngleRadiansDominant travel direction, radians from +X toward +Y.
directionSpreadRadians
float directionSpreadRadiansHalf range of the direction offsets, [0, pi].
minWavelength
float minWavelengthShortest wave, metres (> 0).
maxWavelength
float maxWavelengthLongest wave, metres (>= minWavelength).
wavelengthFalloff
float wavelengthFalloffRank exponent of the wavelength (> 0); larger values give more short waves.
minAmplitude
float minAmplitudeAmplitude of the shortest wave, metres (>= 0).
maxAmplitude
float maxAmplitudeAmplitude of the longest wave, metres (>= minAmplitude).
amplitudeFalloff
float amplitudeFalloffRank exponent of the amplitude (> 0).
longWaveSteepness
float longWaveSteepnessSteepness of the longest wave, [0, 1].
shortWaveSteepness
float shortWaveSteepnessSteepness of the shortest wave, [0, 1].
steepnessFalloff
float steepnessFalloffRank exponent of the steepness (> 0).
randomness
float randomnessRank jitter, [0, 1].
maxSteepnessSum
float maxSteepnessSumUpper bound of the summed steepness, [0, 1]; the steepness of every wave is scaled down to meet it. A sum up to 1 never folds the surface over.