8#include "core/reflect.h"
11namespace Vkm::Engine {
41 static constexpr uint32_t MAX_WAVES = 64;
42 static constexpr uint32_t MAX_SURGES = 4;
69 glm::vec3
foamColor = glm::vec3(0.9f, 0.94f, 0.96f);
75 std::array<OceanSurge, MAX_SURGES>
surges{};
86EntityId findOcean(
const Scene& scene);
102 VKM_F(shortestRipple)
Central registry managing entities and an open set of component types.
Definition scene.h:29
A ridge of water rolling across the sea, raised by gameplay: a straight crest of finite length,...
Definition ocean.h:22
glm::vec2 centre
World X and Z: the crest's middle.
Definition ocean.h:23
float halfLength
Metres from its middle to each end, along its crest.
Definition ocean.h:27
float height
Metres over the water's rest at the crest; 0 is none.
Definition ocean.h:25
float halfWidth
Metres from the crest to the sea, along its roll.
Definition ocean.h:26
glm::vec2 direction
On the XZ plane: the way it rolls; zero is no surge.
Definition ocean.h:24
The scene's sea: wind-driven waves moving every surface whose material is waves.
Definition ocean.h:40
float depth
Metres of water under the waves: shallower slows them and flattens the long ones. 0 is deep.
Definition ocean.h:50
float choppiness
0 round swells; 1 crests drawn to a point.
Definition ocean.h:52
static constexpr float WATERLINE_SQUARE
Metres across the square of sea ahead of the eye where the water meets what stands in it.
Definition ocean.h:44
float detailScale
Metres across one repeat of the material's maps, laid over the water and drifting with the wind.
Definition ocean.h:71
glm::vec3 foamColor
Definition ocean.h:69
float windDirection
Degrees round from +Z toward +X: the way the waves roll.
Definition ocean.h:47
float foam
Definition ocean.h:65
float fetch
Definition ocean.h:48
uint32_t seed
Definition ocean.h:57
float calmRadius
Metres from the Transform where the waves begin to fade.
Definition ocean.h:62
float stillRadius
Where they are gone; at or inside calmRadius they never fade.
Definition ocean.h:63
uint32_t waveCount
Waves summed, up to MAX_WAVES.
Definition ocean.h:56
float minWavelength
Metres; shorter are ripples, per pixel.
Definition ocean.h:54
float waterlineFoam
Definition ocean.h:68
float maxWavelength
Metres.
Definition ocean.h:55
float windSpeed
m/s, ten metres up: the waves' energy grows nearly with its square.
Definition ocean.h:46
std::array< OceanSurge, MAX_SURGES > surges
Definition ocean.h:75
float heightScale
On the heights the spectrum gives.
Definition ocean.h:53
float spread
0 every wave rolls with the wind; 1 they come from all ahead of it.
Definition ocean.h:51
float shortestRipple
Definition ocean.h:60