Skip to content

eulerjs API / @eulerjs/marine / SumOfSinesOptions

SumOfSinesOptions ​

Defined in: packages/marine/src/waves/SumOfSines.ts:3

Properties ​

PropertyTypeDescriptionDefined in
amplitude?numberAmplitude the series starts from, in metres.packages/marine/src/waves/SumOfSines.ts:9
amplitudeFalloff?numberEach wave's amplitude is this fraction of the previous one's.packages/marine/src/waves/SumOfSines.ts:11
directionBias?Vector2Added to every direction before normalising, so waves lean toward it (x, z).packages/marine/src/waves/SumOfSines.ts:23
directionSeed?numberAngle (radians) the first wave's direction is derived from.packages/marine/src/waves/SumOfSines.ts:19
directionStep?numberAdded to the direction angle after each wave, scattering the waves' directions.packages/marine/src/waves/SumOfSines.ts:21
fullSamplesPerPeriod?number...and is fully present from this many.packages/marine/src/waves/SumOfSines.ts:40
gravity?numberGravitational acceleration used for the phase speeds, in m/s².packages/marine/src/waves/SumOfSines.ts:17
inversionIterations?numberFixed-point iterations used to find the undisplaced point under a world position.packages/marine/src/waves/SumOfSines.ts:42
minSamplesPerPeriod?numberA wave fades in from this many grid samples per period...packages/marine/src/waves/SumOfSines.ts:38
peakOffset?number-packages/marine/src/waves/SumOfSines.ts:26
peakSharpness?numberHow peaked the crests are: each wave is exp(peakSharpness * sin(phase) - peakOffset).packages/marine/src/waves/SumOfSines.ts:25
sampleSpacing?numberThe finest detail the physics resolves, as the spacing of an imaginary sample grid in metres. Waves too short for that grid fade out of the physics surface, matching what the water mesh renders at its finest level of detail.packages/marine/src/waves/SumOfSines.ts:36
speedFactor?numberScales the deep-water phase speed sqrt(g λ / 2π) of every wave.packages/marine/src/waves/SumOfSines.ts:15
timeOffset?numberAdded to the simulation time before evaluating the waves, so they don't all start in phase.packages/marine/src/waves/SumOfSines.ts:28
timeScale?numberSpeeds up (> 1) or slows down (< 1) the waves.packages/marine/src/waves/SumOfSines.ts:30
waveCount?numberNumber of waves. Each is shorter and lower than the one before.packages/marine/src/waves/SumOfSines.ts:5
wavelength?numberWavelength the series starts from, in metres; the first wave is already one falloff shorter.packages/marine/src/waves/SumOfSines.ts:7
wavelengthFalloff?numberEach wave's wavelength is this fraction of the previous one's.packages/marine/src/waves/SumOfSines.ts:13

Released under the MIT License.