diff options
Diffstat (limited to 'src/ocean')
-rw-r--r-- | src/ocean/ocean_alt.cpp | 7 | ||||
-rw-r--r-- | src/ocean/ocean_alt.h | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/ocean/ocean_alt.cpp b/src/ocean/ocean_alt.cpp index 1c9306b..9ead324 100644 --- a/src/ocean/ocean_alt.cpp +++ b/src/ocean/ocean_alt.cpp @@ -381,9 +381,12 @@ void ocean_alt::update_ocean() // std::cout << m_foam_constants.wavelengths[i] << std::endl; // } - if (waveheight >= height_threshold){ + if (m_foam_constants.wavelengths[i] >= height_threshold){ //std::cout << "push" << std::endl; - m_heights.push_back(v); + OceanSpray s; + s.height = v; + s.slope = norm; + m_heights.push_back(s); } diff --git a/src/ocean/ocean_alt.h b/src/ocean/ocean_alt.h index a5bcd12..bbfce9a 100644 --- a/src/ocean/ocean_alt.h +++ b/src/ocean/ocean_alt.h @@ -27,6 +27,12 @@ struct FoamConstants{ std::vector<Eigen::Vector2f> texCoords; }; +struct OceanSpray{ + Eigen::Vector3f height; + Eigen::Vector3f slope; + +}; + class ocean_alt { public: @@ -43,7 +49,7 @@ public: } std::vector<Eigen::Vector3f> m_vertices; // current displacement vector for each K - std::vector<Eigen::Vector3f> m_heights; // stores height above threshold + std::vector<OceanSpray> m_heights; // stores height above threshold @@ -86,7 +92,7 @@ private: const double spacing = 1.0; // spacing between grid points const double A = 100; // numeric constant for the Phillips spectrum - const double V = 50; // wind speed + const double V = 100; // wind speed const double gravity = 9.81; const double L = V*V/gravity; const Eigen::Vector2d omega_wind = Eigen::Vector2d(1.0, 0.0); // wind direction, used in Phillips equation |