iWaveOcean
3ds Max ocean simulation plugin
Ambient.h
1 #include <complex>
2 #include <random>
3 #include <point3.h>
4 #include <iparamb2.h>
5 #include "Grid.h"
6 
7 typedef std::complex<float> complex;
8 
14 class Ambient : public Grid {
15  std::tr1::mt19937 engine;
16  std::tr1::normal_distribution<float> dist;
17 
18  const float gravity;
19  const float omega_0;
20  const float T;
21  const unsigned long seed;
23  float Lx;
24  float Ly;
25  float l;
26  float V;
27  Point3 w_hat;
28  float t;
30  // Values precached on initialization.
31  float P_h__L;
32  float P_h__l_2;
34  complex* h_tildes_in;
35  complex* h_tildes_out;
36 
37 public:
38  static const float GRAVITY_METRIC;
39  static const float GRAVITY_US;
52  Ambient(float width, float length, int widthSegs, int lengthSegs, unsigned long rngSeed, float phaseDuration, float accelerationGravity);
53 
54  ~Ambient();
55 
66  void Simulate(float time, float speed, float direction, float scale, float waveSizeLimit, float desiredMaxHeight);
67 
68 private:
73  float omega(Point3 k);
74 
79  float P_h(Point3 k);
80 
85  complex h_tilde_0(Point3 k);
86 
91  complex h_tilde(Point3 k);
92 
96  float max_height();
97 
106  void heights(float heightScale, float time);
107 };
void Simulate(float time, float speed, float direction, float scale, float waveSizeLimit, float desiredMaxHeight)
Definition: Ambient.cpp:135
Definition: Ambient.h:14
static const float GRAVITY_METRIC
Definition: Ambient.h:38
static const float GRAVITY_US
Definition: Ambient.h:39
Ambient(float width, float length, int widthSegs, int lengthSegs, unsigned long rngSeed, float phaseDuration, float accelerationGravity)
Definition: Ambient.cpp:9
Definition: Grid.h:4