2004-01-09 17:05:26 +00:00
|
|
|
namespace yasim {
|
|
|
|
|
|
|
|
class Turbulence {
|
|
|
|
public:
|
|
|
|
Turbulence(int gens, int seed);
|
|
|
|
~Turbulence();
|
|
|
|
void update(double dt, double rate);
|
2004-01-10 22:34:49 +00:00
|
|
|
void setMagnitude(double mag);
|
2004-01-09 17:05:26 +00:00
|
|
|
void getTurbulence(double* loc, float* turbOut);
|
2004-01-10 22:34:49 +00:00
|
|
|
void offset(float* dist);
|
2004-01-09 17:05:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned int hashrand(unsigned int i);
|
|
|
|
float lattice(unsigned int x, unsigned int y);
|
|
|
|
float iturb(unsigned int x, unsigned int y);
|
|
|
|
float fturb(double a, double b);
|
|
|
|
void mkimg(float* buf, int sz);
|
|
|
|
float cubenorm(float x, float y, float z);
|
|
|
|
void turblut(int x, int y, float* out);
|
|
|
|
|
|
|
|
int _gens;
|
|
|
|
int _sz;
|
|
|
|
int _seed;
|
|
|
|
|
2004-01-10 22:34:49 +00:00
|
|
|
double _off[3];
|
|
|
|
double _timeOff;
|
2004-01-09 17:05:26 +00:00
|
|
|
double _mag;
|
|
|
|
float _x0, _x1, _y0, _y1, _z0, _z1;
|
|
|
|
unsigned char* _data;
|
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace yasim
|