summaryrefslogtreecommitdiff
path: root/src/ocean/ocean_alt.h
diff options
context:
space:
mode:
authorSebastian Park <SebPark03@gmail.com>2024-05-10 04:09:10 -0400
committerSebastian Park <SebPark03@gmail.com>2024-05-10 04:09:10 -0400
commit487b0874e1fbb891e5ecf5721bd05814b0c0572d (patch)
tree99f394d3776f3094294097e262d711cd1a5acc89 /src/ocean/ocean_alt.h
parentee06bfd66ebc0d0d9d88bb9cb69b7cb350e3cfe2 (diff)
parentb4ca8b708587c540233284beae8d42ff43092580 (diff)
Merge branch 'main' of https://github.com/Seb-Park/ocean-simulation
Diffstat (limited to 'src/ocean/ocean_alt.h')
-rw-r--r--src/ocean/ocean_alt.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ocean/ocean_alt.h b/src/ocean/ocean_alt.h
index 9c5e4e2..7e293f9 100644
--- a/src/ocean/ocean_alt.h
+++ b/src/ocean/ocean_alt.h
@@ -27,6 +27,13 @@ struct FoamConstants{
std::vector<Eigen::Vector2f> texCoords;
};
+struct OceanSpray{
+ Eigen::Vector3f height;
+ Eigen::Vector3f slope;
+ Eigen::Vector2f slope_vector;
+
+};
+
class ocean_alt
{
public:
@@ -43,6 +50,8 @@ public:
}
std::vector<Eigen::Vector3f> m_vertices; // current displacement vector for each K
+ std::vector<OceanSpray> m_heights; // stores height above threshold
+
@@ -71,8 +80,8 @@ private:
const double Lx = 512.0;
const double Lz = 512.0;
- const int num_rows = 256;
- const int num_cols = 256;
+ const int num_rows = 256;
+ const int num_cols = 256;
const int num_tiles_x = 1;
const int num_tiles_z = 1;
@@ -83,8 +92,8 @@ private:
const double lambda = .5; // how much displacement matters
const double spacing = 1.0; // spacing between grid points
- const double A = 10000; // numeric constant for the Phillips spectrum
- const double V = 500; // wind speed
+ const double A = 10000; // numeric constant for the Phillips spectrum
+ 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
@@ -102,6 +111,8 @@ private:
// FOR FOAM:
FoamConstants m_foam_constants;
+ float height_threshold = 2.f;
+
float max = 0;