iWaveOcean
3ds Max ocean simulation plugin
Grid Class Reference

#include <Grid.h>

Inheritance diagram for Grid:
Ambient

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
 

Detailed Description

Represents a grid mesh that can be deformed.

Constructor & Destructor Documentation

Grid::Grid ( float  width,
float  length,
int  widthSegs,
int  lengthSegs 
)

Creates a new Grid with the vertices uninitialized. Use the Clear() method to zero out all of the vertex heights.

Parameters
widththe width along the U-axis
lengththe length along the V-axis
widthSegsthe number of faces along the U-axis
lengthSegsthe number of faces along the V-axis
Grid::Grid ( float  width,
float  length,
int  widthSegs,
int  lengthSegs,
float *  vertexHeights 
)

Creates a new Grid with the vertices initialized to the specified array.

Parameters
widththe width along the U-axis
lengththe length along the V-axis
widthSegsthe number of faces along the U-axis
lengthSegsthe number of faces along the V-axis
verticesthe heights of the vertices; this array must be of size (widthSegs + 1) * (lengthSegs + 1)

Member Function Documentation

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.


The documentation for this class was generated from the following files: