|
Public Types |
enum | TextureCoordFlip {
Flip_None = 0,
Flip_X = BIT(0),
Flip_Y = BIT(1),
Flip_XY = Flip_X | Flip_Y
} |
| This is used to specify flip options for creating the texture coord array. More...
|
Public Member Functions |
| VectorField () |
| Default Constructor.
|
| VectorField (const Point2I &resolution, const F32 maxX=1.f, const F32 maxY=1.f, TextureCoordFlip flip=Flip_None, VectorFieldInitFn initFn=NULL) |
| Constructor.
|
| VectorField (const char *fileName) |
| Constructor with file name.
|
| ~VectorField () |
| Destructor.
|
void | initVectorField (F32 maxX=1.f, F32 maxY=1.f, TextureCoordFlip flip=Flip_None, VectorFieldInitFn initFn=NULL) |
| Init the vector field.
|
bool | loadField (const char *fileName) |
| Load the vector field from a file.
|
bool | saveField (const char *fileName) const |
| Save the vector field to a file.
|
void | renderField (bool texture=false) const |
| Render out the vector field.
|
void | visualizeField (F32 alpha=1.f) const |
| Render the field to let someone visualize what it is doing.
|
Private Member Functions |
void | allocVectorField (const Point2I &resolution) |
| Helper function to create the vector field.
|
void | destroyVectorField () |
| Helper function to destroy the vector field.
|
void | nullField () |
| Helper function to null the pointers.
|
Point2F & | getVector (const U32 x, const U32 y) |
| Helper inline just so I can store the vector field as a 1d array but access it as a 2d array.
|
const Point2F & | getVector (const U32 x, const U32 y) const |
void | serialize (Stream *stream) const |
| Put this field out to a stream.
|
void | unserialize (Stream *stream) |
| Read a stream and set up this field.
|
Private Attributes |
Point2I | mFieldResolution |
| Resolution of the vector field, x * y = number of quads.
|
Point2F * | mVectorField |
| Vector Field.
|
Point2F * | mFieldVerts |
| Vertices for rendering the field.
|
U16 * | mFieldIndices |
| Indices for rendering the field.
|
Point2F | mMax |
| Maximum texture coordinate values.
|
Point2F * | mUnflippedVecField |
| If the coords get flipped, then this will be unflipped.
|