-#pragma once
-
-#include <complex>
-#include <random>
-
-#include "seafwd.h"
-
-#include "complexpair.h"
-#include "watersurfacefwd.h"
-
-class Sea
-{
- public:
- Sea(WaterSurfacePtr surface);
- void update();
-
- private:
- static const double PHILLIPS_CONSTANT;
- static const double GRAVITATIONAL_CONSTANT;
-
- WaterSurfacePtr m_surface;
- double m_windDirection[2];
- double m_windSpeed;
- std::random_device m_randomDevice;
- std::mt19937 m_randomGenerator;
- std::normal_distribution<> m_normalDistribution;
- std::vector<ComplexPair> m_fourierAmplitudes;
-
- double phillipsSpectrum(double k_x, double k_y) const;
- ComplexPair generateFourierAmplitude(double k_x, double k_y);
- ComplexPair& fourierAmplitudeAt(int n, int m);
- void generateFourierAmplitudes();
- double spatialFrequencyForIndex(int n) const;
-};