iWaveOcean
3ds Max ocean simulation plugin
|
#include <Grid.h>
Public Member Functions | |
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 () |
Protected Attributes | |
const float | _width |
const float | _length |
const int | _widthSegs |
const int | _lengthSegs |
const int | _widthVtex |
const int | _lengthVtex |
float * | _vertices |
Represents a grid mesh that can be deformed.
Grid::Grid | ( | float | width, |
float | length, | ||
int | widthSegs, | ||
int | lengthSegs | ||
) |
Grid::Grid | ( | float | width, |
float | length, | ||
int | widthSegs, | ||
int | lengthSegs, | ||
float * | vertexHeights | ||
) |
Creates a new Grid with the vertices initialized to the specified array.
width | the width along the U-axis |
length | the length along the V-axis |
widthSegs | the number of faces along the U-axis |
lengthSegs | the number of faces along the V-axis |
vertices | the heights of the vertices; this array must be of size (widthSegs + 1) * (lengthSegs + 1) |
void Grid::Clear | ( | ) |
Zeroes out all of the values on the height map.
float Grid::GetLength | ( | ) | const |
Gets the display height.
int Grid::GetLengthSegs | ( | ) | const |
Gets the number of faces along the V-axis.
int Grid::GetLengthVertices | ( | ) | const |
Gets the number of vertices along the V-axis.
int Grid::GetTotalVertices | ( | ) | const |
Gets the total number of vertices.
float * Grid::GetVertexHeights | ( | ) | const |
Gets the array of heights corresponding to each UV coordinate on the grid. The vertices are arranged U-major; e.g. UV coords (0, 0.1), (0, 0.2), (0, 0.3), ..., (0.1, 0.1), (0.1, 0.2), (0.1, 0.3), ..., (1.0, 1.0).
float Grid::GetWidth | ( | ) | const |
Gets the display width.
int Grid::GetWidthSegs | ( | ) | const |
Gets the number of faces along the U-axis.
int Grid::GetWidthVertices | ( | ) | const |
Gets the number of vertices along the U-axis.