iWaveOcean
3ds Max ocean simulation plugin
|
#include <Ambient.h>
Public Member Functions | |
Ambient (float width, float length, int widthSegs, int lengthSegs, unsigned long rngSeed, float phaseDuration, float accelerationGravity) | |
void | Simulate (float time, float speed, float direction, float scale, float waveSizeLimit, float desiredMaxHeight) |
Public Member Functions inherited from Grid | |
Grid (float width, float length, int widthSegs, int lengthSegs) | |
Grid (float width, float length, int widthSegs, int lengthSegs, float *vertexHeights) | |
float | GetWidth () const |
float | GetLength () const |
int | GetWidthSegs () const |
int | GetLengthSegs () const |
int | GetWidthVertices () const |
int | GetLengthVertices () const |
int | GetTotalVertices () const |
float * | GetVertexHeights () const |
void | Clear () |
Static Public Attributes | |
static const float | GRAVITY_METRIC = 9.81 |
static const float | GRAVITY_US = 386.1 |
Additional Inherited Members | |
Protected Attributes inherited from Grid | |
const float | _width |
const float | _length |
const int | _widthSegs |
const int | _lengthSegs |
const int | _widthVtex |
const int | _lengthVtex |
float * | _vertices |
A class that simulates ocean waves at a given time using Tessendorf's wave equations and the FFT method. The equations referenced by the documentation comments are those in "Simulating Ocean Waves", (c) 1999-2001 Jerry Tessendorf (SIGGRAPH Course Notes 2002). This class assumes the 3ds Max coordinate system, i.e. X- and Y-axes are in the horizontal plane and the Z-axis goes up and down.
Ambient::Ambient | ( | float | width, |
float | length, | ||
int | widthSegs, | ||
int | lengthSegs, | ||
unsigned long | rngSeed, | ||
float | phaseDuration, | ||
float | accelerationGravity | ||
) |
Creates a new Tessendorf wave simulation at a specified time, given the specified parameters.
width | the width along the X-axis |
length | the length along the Y-axis |
widthSegs | the number of faces along the X-axis |
lengthSegs | the number of faces along the Y-axis |
rngSeed | seed for the pseudorandom number generator |
phaseDuration | duration of one phase (in s) |
accelerationGravity | acceleration due to gravity; e.g. if using metric units, 9.8 m/s^2 and if using US customary, 386.1 in/s^2 |
void Ambient::Simulate | ( | float | time, |
float | speed, | ||
float | direction, | ||
float | scale, | ||
float | waveSizeLimit, | ||
float | desiredMaxHeight | ||
) |
Generates the wave surface and performs Fast Fourier Transforms (FFTs) to calculate the displacement.
time | time (in s) |
speed | wind speed (in distance/s) |
direction | direction of wind |
scale | simulated length of plane along X-axis; Y-scale is automatically generated from this value |
waveSizeLimit | size limit that waves must surpass to be rendered |
desiredMaxHeight | height of the tallest wave |
|
static |
The constant g in m/s^2.
|
static |
Gravity in America. (Just kidding – it's the constant g in in/s^2.)