A generator class for a box mesh. More...
#include <boxgenerator.h>
Public Member Functions | |||
BoxGenerator (const Vector3 &HalfExtents, const Whole SegX=1, const Whole SegY=1, const Whole SegZ=1) | |||
Vector constructor. More... | |||
BoxGenerator (const Real HalfSizeX, const Real HalfSizeY, const Real HalfSizeZ, const Whole SegX=1, const Whole SegY=1, const Whole SegZ=1) | |||
Real constructor. More... | |||
virtual | ~BoxGenerator () | ||
Class destructor. | |||
virtual void | AddToTriangleBuffer (TriangleBuffer &Buffer) const | ||
Adds the vertices and indices as configured in this generator to a triangle buffer. More... | |||
BoxGenerator & | SetHalfExtents (const Vector3 &HalfExtents) | ||
Sets the half size of the box. More... | |||
BoxGenerator & | SetHalfSizeX (const Real HalfSizeX) | ||
Sets the half size along the X axis.
| |||
BoxGenerator & | SetHalfSizeY (const Real HalfSizeY) | ||
Sets the half size along the Y axis.
| |||
BoxGenerator & | SetHalfSizeZ (const Real HalfSizeZ) | ||
Sets the half size along the Z axis.
| |||
BoxGenerator & | SetNumSegX (const Whole SegX) | ||
Sets the number of segments along X axis. More... | |||
BoxGenerator & | SetNumSegY (const Whole SegY) | ||
Sets the number of segments along Y axis. More... | |||
BoxGenerator & | SetNumSegZ (const Whole SegZ) | ||
Sets the number of segments along Z axis. More... | |||
Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< BoxGenerator > | |||
MeshGenerator () | |||
Class constructor. | |||
virtual | ~MeshGenerator () | ||
Class destructor. | |||
TriangleBuffer | BuildTriangleBuffer () const | ||
Creates a TriangleBuffer with the the vertices and indices as configured in this generator. More... | |||
Mesh * | GenerateMesh (const String &MeshName, const String &MeshGroup, const String &MatName, const String &MatGroup) const | ||
Generates the mesh. More... | |||
BoxGenerator & | ResetTransforms () | ||
Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More... | |||
BoxGenerator & | SetEnableNormals (Boole EnableNormals) | ||
Sets whether normals are enabled or not. More... | |||
BoxGenerator & | SetNumTexCoordSet (const UInt8 NumSets) | ||
Sets the number of texture coordintate sets. More... | |||
BoxGenerator & | SetOrientation (const Quaternion &Ori) | ||
Sets an orientation baked into the resulting mesh. More... | |||
BoxGenerator & | SetOrientation (const Real X, const Real Y, const Real Z, const Real W) | ||
Sets an orientation baked into the resulting mesh. More... | |||
BoxGenerator & | SetPosition (const Vector3 &Loc) | ||
Sets a translation baked into the resulting mesh. More... | |||
BoxGenerator & | SetPosition (const Real X, const Real Y, const Real Z) | ||
Sets a translation baked into the resulting mesh. More... | |||
BoxGenerator & | SetScale (const Vector3 &Scaling) | ||
Sets a scale baked into the resulting mesh. More... | |||
BoxGenerator & | SetScale (const Real Scaling) | ||
Sets a uniform scale baked into the resulting mesh. More... | |||
BoxGenerator & | SetScale (const Real X, const Real Y, const Real Z) | ||
Sets a scale baked into the resulting mesh. More... | |||
BoxGenerator & | SetSwitchUV (Boole SwitchUV) | ||
Sets whether to switch U and V texture coordinates. More... | |||
BoxGenerator & | SetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom) | ||
Sets the texture rectangle. More... | |||
BoxGenerator & | SetUTile (const Real uTile) | ||
Sets the U Tile. More... | |||
BoxGenerator & | SetVTile (const Real vTile) | ||
Sets the V Tile. More... | |||
Static Public Attributes | |
static const String | TAG_NEGX = "box.negx" |
A String containing the name of the Negative X face of the box. | |
static const String | TAG_NEGY = "box.negy" |
A String containing the name of the Negative Y face of the box. | |
static const String | TAG_NEGZ = "box.negz" |
A String containing the name of the Negative Z face of the box. | |
static const String | TAG_X = "box.x" |
A String containing the name of the X face of the box. | |
static const String | TAG_Y = "box.y" |
A String containing the name of the Y face of the box. | |
static const String | TAG_Z = "box.z" |
A String containing the name of the Z face of the box. | |
Protected Attributes | |
Vector3 | BoxHalf |
The size of the box to generate. More... | |
Whole | NumSegX |
The number of segments to generate along the X axis for each face. More... | |
Whole | NumSegY |
The number of segments to generate along the Y axis for each face. More... | |
Whole | NumSegZ |
The number of segments to generate along the Z axis for each face. More... | |
Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< BoxGenerator > | |
UInt8 | GeneratorOpts |
Storage for the boolean options to be used by this generator. More... | |
UInt8 | NumTexCoordSet |
The number of texture coordinate sets to include. More... | |
Quaternion | Orientation |
Orientation to apply the mesh. More... | |
Vector3 | Position |
Position to apply to the mesh. More... | |
Vector3 | Scale |
Scale to apply to the mesh. More... | |
Real | UTile |
U tile for texture coords generation. More... | |
Vector2 | UVOrigin |
Rectangle in which the texture coordinates will be placed. More... | |
Real | VTile |
V tile for texture coords generation. More... | |
Additional Inherited Members | |
Public Types inherited from Mezzanine::Graphics::Procedural::MeshGenerator< BoxGenerator > | |
enum | GeneratorOptions |
A convenience enum used to describe boolean options for a generator. | |
Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< BoxGenerator > | |
void | AddPoint (TriangleBuffer &Buffer, const Vector3 &Loc, const Vector3 &Norm, const Vector2 &UV) const |
Adds a new point to a triangle buffer, using the format defined for that MeshGenerator. More... | |
A generator class for a box mesh.
Definition at line 82 of file boxgenerator.h.
Mezzanine::Graphics::Procedural::BoxGenerator::BoxGenerator | ( | const Vector3 & | HalfExtents, |
const Whole | SegX = 1 , |
||
const Whole | SegY = 1 , |
||
const Whole | SegZ = 1 |
||
) |
Vector constructor.
HalfExtents | The half size of the box to generate. |
SegX | The number of segments to generate along the X axis for each face. |
SegY | The number of segments to generate along the Y axis for each face. |
SegZ | The number of segments to generate along the Z axis for each face. |
Definition at line 88 of file boxgenerator.cpp.
Mezzanine::Graphics::Procedural::BoxGenerator::BoxGenerator | ( | const Real | HalfSizeX, |
const Real | HalfSizeY, | ||
const Real | HalfSizeZ, | ||
const Whole | SegX = 1 , |
||
const Whole | SegY = 1 , |
||
const Whole | SegZ = 1 |
||
) |
Real constructor.
HalfSizeX | The half size of the box to generate on the X axis. |
HalfSizeY | The half size of the box to generate on the Y axis. |
HalfSizeZ | The half size of the box to generate on the Z axis. |
SegX | The number of segments to generate along the X axis for each face. |
SegY | The number of segments to generate along the Y axis for each face. |
SegZ | The number of segments to generate along the Z axis for each face. |
Definition at line 96 of file boxgenerator.cpp.
|
virtual |
Adds the vertices and indices as configured in this generator to a triangle buffer.
Buffer | The buffer to append this generators vertices and indices to. |
Implements Mezzanine::Graphics::Procedural::MeshGenerator< BoxGenerator >.
Definition at line 112 of file boxgenerator.cpp.
BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetHalfExtents | ( | const Vector3 & | HalfExtents | ) |
Sets the half size of the box.
HalfExtents | The half size of the box that will be generated. |
Definition at line 182 of file boxgenerator.cpp.
BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetHalfSizeX | ( | const Real | HalfSizeX | ) |
Sets the half size along the X axis.
If | the size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
HalfSizeX | The half size to set for the generated box on the X axis. |
Definition at line 155 of file boxgenerator.cpp.
BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetHalfSizeY | ( | const Real | HalfSizeY | ) |
Sets the half size along the Y axis.
If | the size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
HalfSizeY | The half size to set for the generated box on the Y axis. |
Definition at line 164 of file boxgenerator.cpp.
BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetHalfSizeZ | ( | const Real | HalfSizeZ | ) |
Sets the half size along the Z axis.
If | the size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
HalfSizeZ | The half size to set for the generated box on the Z axis. |
Definition at line 173 of file boxgenerator.cpp.
BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetNumSegX | ( | const Whole | SegX | ) |
Sets the number of segments along X axis.
If | the number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown. |
SegX | The number of segments to set along the X axis. |
Definition at line 190 of file boxgenerator.cpp.
BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetNumSegY | ( | const Whole | SegY | ) |
Sets the number of segments along Y axis.
If | the number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown. |
SegX | The number of segments to set along the Y axis. |
Definition at line 199 of file boxgenerator.cpp.
BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetNumSegZ | ( | const Whole | SegZ | ) |
Sets the number of segments along Z axis.
If | the number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown. |
SegX | The number of segments to set along the Z axis. |
Definition at line 208 of file boxgenerator.cpp.
|
protected |
The size of the box to generate.
Definition at line 100 of file boxgenerator.h.
|
protected |
The number of segments to generate along the X axis for each face.
Definition at line 103 of file boxgenerator.h.
|
protected |
The number of segments to generate along the Y axis for each face.
Definition at line 106 of file boxgenerator.h.
|
protected |
The number of segments to generate along the Z axis for each face.
Definition at line 109 of file boxgenerator.h.