summaryrefslogtreecommitdiff
path: root/src/ocean/ocean_alt.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ocean/ocean_alt.h')
-rw-r--r--src/ocean/ocean_alt.h42
1 files changed, 20 insertions, 22 deletions
diff --git a/src/ocean/ocean_alt.h b/src/ocean/ocean_alt.h
index 219ad60..dc8888d 100644
--- a/src/ocean/ocean_alt.h
+++ b/src/ocean/ocean_alt.h
@@ -32,6 +32,7 @@ class ocean_alt
public:
ocean_alt();
void updateVertexAmplitudes(double t);
+ void update_ocean();
std::vector<Eigen::Vector3f> get_vertices();
std::vector<Eigen::Vector3i> get_faces();
void fft_prime(double t);
@@ -59,40 +60,39 @@ private:
Eigen::Vector2d get_horiz_pos(int i);
std::pair<double, double> sample_complex_gaussian();
-
// FOAM
std::vector<float> m_saturation;
-
-
-
-
-
-
-
-
std::map<int, WaveIndexConstant> m_waveIndexConstants; // stores constants that only need to be calculate once for each grid constant
+ const double Lx = 512.0;
+ const double Lz = 512.0;
+
+ const int num_rows = 256;
+ const int num_cols = 256;
+ const int num_tiles_x = 2;
+ const int num_tiles_z = 2;
- const double Lx = 1024.0;
- const double Lz = 1024.0;
+ const double vertex_displacement = Lx / 2;
- const int num_rows = 256;
- const int num_cols = 256;
const int N = num_rows*num_cols; // total number of grid points
- const double lambda = 2.5; // how much displacement matters
- const double spacing = 25.0; // spacing between grid points
+ const double lambda = .5; // how much displacement matters
+ const double spacing = 1.0; // spacing between grid points
- const double A = 200; // numeric constant for the Phillips spectrum
- const double V = 200; // wind speed
+ const double A = 10000; // numeric constant for the Phillips spectrum
+ const double V = 500; // 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
std::vector<Eigen::Vector2d> m_current_h; // current height fields for each K
- std::vector<Eigen::Vector2d> m_displacements; // current displacement vector for each K
- std::vector<Eigen::Vector2d> m_slopes; // current displacement vector for each K
+ // std::vector<Eigen::Vector2d> m_displacements; // current displacement vector for each K
+ // std::vector<Eigen::Vector2d> m_slopes; // current displacement vector for each K
+ std::vector<Eigen::Vector2d> m_slopes_x;
+ std::vector<Eigen::Vector2d> m_slopes_z;
+ std::vector<Eigen::Vector2d> m_displacements_x;
+ std::vector<Eigen::Vector2d> m_displacements_z;
//std::vector<Eigen::Vector3f> m_slope_vectors; // current displacement vector for each K
std::vector<Eigen::Vector3f> m_normals; // normal calculations
@@ -106,9 +106,7 @@ private:
int iterations = 0;
-
-
-
+ std::vector<Eigen::Vector3f> m_vertices; // current displacement vector for each K
const double D = 1.0; // Depth below mean water level (for dispersion relation)