A generator class for a rounded box mesh. More...
#include <roundedboxgenerator.h>
Public Member Functions | |||
RoundedBoxGenerator (const Vector3 &Size, const Real ChamferSize, const Whole SegX=1, const Whole SegY=1, const Whole SegZ=1, const Whole ChamferSeg=1) | |||
Vector constructor. More... | |||
RoundedBoxGenerator (const Real SizeX, const Real SizeY, const Real SizeZ, const Real ChamferSize, const Whole SegX=1, const Whole SegY=1, const Whole SegZ=1, const Whole ChamferSeg=1) | |||
Real constructor. More... | |||
virtual | ~RoundedBoxGenerator () | ||
Class destructor. | |||
virtual void | AddToTriangleBuffer (TriangleBuffer &Buffer) const | ||
Adds the vertices and indices as configured in this generator to a triangle buffer. More... | |||
RoundedBoxGenerator & | SetChamferSize (const Real ChamferSize) | ||
Sets the size of the chamfer, ie the radius of the rounded part
| |||
RoundedBoxGenerator & | SetNumChamferSeg (const Whole ChamferSeg) | ||
Sets the number of segments along the rounded edge of the box.
| |||
RoundedBoxGenerator & | SetNumSegX (const Whole SegX) | ||
Sets the number of segments along X axis
| |||
RoundedBoxGenerator & | SetNumSegY (const Whole SegY) | ||
Sets the number of segments along Y axis
| |||
RoundedBoxGenerator & | SetNumSegZ (const Whole SegZ) | ||
Sets the number of segments along Z axis
| |||
RoundedBoxGenerator & | SetSize (const Vector3 &Size) | ||
Sets the size of the box.
| |||
RoundedBoxGenerator & | SetSizeX (const Real SizeX) | ||
Sets the size of the box along X axis.
| |||
RoundedBoxGenerator & | SetSizeY (const Real SizeY) | ||
Sets the size of the box along Y axis.
| |||
RoundedBoxGenerator & | SetSizeZ (const Real SizeZ) | ||
Sets the size of the box along Z axis.
| |||
Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< RoundedBoxGenerator > | |||
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... | |||
RoundedBoxGenerator & | ResetTransforms () | ||
Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More... | |||
RoundedBoxGenerator & | SetEnableNormals (Boole EnableNormals) | ||
Sets whether normals are enabled or not. More... | |||
RoundedBoxGenerator & | SetNumTexCoordSet (const UInt8 NumSets) | ||
Sets the number of texture coordintate sets. More... | |||
RoundedBoxGenerator & | SetOrientation (const Quaternion &Ori) | ||
Sets an orientation baked into the resulting mesh. More... | |||
RoundedBoxGenerator & | SetOrientation (const Real X, const Real Y, const Real Z, const Real W) | ||
Sets an orientation baked into the resulting mesh. More... | |||
RoundedBoxGenerator & | SetPosition (const Vector3 &Loc) | ||
Sets a translation baked into the resulting mesh. More... | |||
RoundedBoxGenerator & | SetPosition (const Real X, const Real Y, const Real Z) | ||
Sets a translation baked into the resulting mesh. More... | |||
RoundedBoxGenerator & | SetScale (const Vector3 &Scaling) | ||
Sets a scale baked into the resulting mesh. More... | |||
RoundedBoxGenerator & | SetScale (const Real Scaling) | ||
Sets a uniform scale baked into the resulting mesh. More... | |||
RoundedBoxGenerator & | SetScale (const Real X, const Real Y, const Real Z) | ||
Sets a scale baked into the resulting mesh. More... | |||
RoundedBoxGenerator & | SetSwitchUV (Boole SwitchUV) | ||
Sets whether to switch U and V texture coordinates. More... | |||
RoundedBoxGenerator & | SetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom) | ||
Sets the texture rectangle. More... | |||
RoundedBoxGenerator & | SetUTile (const Real uTile) | ||
Sets the U Tile. More... | |||
RoundedBoxGenerator & | SetVTile (const Real vTile) | ||
Sets the V Tile. More... | |||
Protected Member Functions | |
void | _AddCorner (TriangleBuffer &Buffer, Boole IsXPositive, Boole IsYPositive, Boole IsZPositive) const |
Builds a "corner" of the rounded box, ie a 1/8th of a sphere. More... | |
void | _AddEdge (TriangleBuffer &Buffer, Int16 XPos, Int16 YPos, Int16 ZPos) const |
Builds an "edge" of the rounded box, ie a quarter cylinder. More... | |
Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< RoundedBoxGenerator > | |
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... | |
Protected Attributes | |
Real | BoxChamferSize |
The radius of the rounded portion of the box corners. More... | |
Vector3 | BoxSize |
The size of the box to generate. More... | |
Whole | NumChamferSeg |
The number of segments to generate along the length of the rounded edges. More... | |
Whole | NumSegX |
The number of segments to generate along the X axis for each side. More... | |
Whole | NumSegY |
The number of segments to generate along the Y axis for each side. More... | |
Whole | NumSegZ |
The number of segments to generate along the Z axis for each side. More... | |
Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< RoundedBoxGenerator > | |
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< RoundedBoxGenerator > | |
enum | GeneratorOptions |
A convenience enum used to describe boolean options for a generator. | |
A generator class for a rounded box mesh.
Definition at line 82 of file roundedboxgenerator.h.
Mezzanine::Graphics::Procedural::RoundedBoxGenerator::RoundedBoxGenerator | ( | const Vector3 & | Size, |
const Real | ChamferSize, | ||
const Whole | SegX = 1 , |
||
const Whole | SegY = 1 , |
||
const Whole | SegZ = 1 , |
||
const Whole | ChamferSeg = 1 |
||
) |
Vector constructor.
Size | The size of the box to generate. |
ChamferSize | The radius of the rounded portion of the box corners. |
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. |
ChamferSeg | The number of segments to generate along the length of the rounded edges. |
Definition at line 82 of file roundedboxgenerator.cpp.
Mezzanine::Graphics::Procedural::RoundedBoxGenerator::RoundedBoxGenerator | ( | const Real | SizeX, |
const Real | SizeY, | ||
const Real | SizeZ, | ||
const Real | ChamferSize, | ||
const Whole | SegX = 1 , |
||
const Whole | SegY = 1 , |
||
const Whole | SegZ = 1 , |
||
const Whole | ChamferSeg = 1 |
||
) |
Real constructor.
SizeX | The size of the box to generate on the X axis. |
SizeY | The size of the box to generate on the Y axis. |
SizeZ | The size of the box to generate on the Z axis. |
ChamferSize | The radius of the rounded portion of the box corners. |
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. |
ChamferSeg | The number of segments to generate along the length of the rounded edges. |
Definition at line 92 of file roundedboxgenerator.cpp.
|
protected |
Builds a "corner" of the rounded box, ie a 1/8th of a sphere.
Buffer | The buffer to append the corner data to. |
IsXPositive | Whether or not the corner needing to be generated is on the positive side of the X axis. |
IsYPositive | Whether or not the corner needing to be generated is on the positive side of the Y axis. |
IsZPositive | Whether or not the corner needing to be generated is on the positive side of the Z axis. |
Definition at line 165 of file roundedboxgenerator.cpp.
|
protected |
Builds an "edge" of the rounded box, ie a quarter cylinder.
Buffer | The buffer to append the edge data to. |
XPos | Expects either "1" or "-1" based on the side of the X axis to generate the edge on. |
YPos | Expects either "1" or "-1" based on the side of the Y axis to generate the edge on. |
ZPos | Expects either "1" or "-1" based on the side of the Z axis to generate the edge on. |
Definition at line 107 of file roundedboxgenerator.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< RoundedBoxGenerator >.
Definition at line 221 of file roundedboxgenerator.cpp.
RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetChamferSize | ( | const Real | ChamferSize | ) |
Sets the size of the chamfer, ie the radius of the rounded part
If | the size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
ChamferSize | The radius of the rounded portion of the box corners. |
Definition at line 324 of file roundedboxgenerator.cpp.
RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetNumChamferSeg | ( | const Whole | ChamferSeg | ) |
Sets the number of segments along the rounded edge of the box.
If | the number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown. |
ChamferSeg | The number of segments to generate along the length of the rounded edges. |
Definition at line 360 of file roundedboxgenerator.cpp.
RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::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 generate along the X axis for each side. |
Definition at line 333 of file roundedboxgenerator.cpp.
RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::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. |
SegY | The number of segments to generate along the Y axis for each side. |
Definition at line 342 of file roundedboxgenerator.cpp.
RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::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. |
SegZ | The number of segments to generate along the Z axis for each side. |
Definition at line 351 of file roundedboxgenerator.cpp.
RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetSize | ( | const Vector3 & | Size | ) |
Sets the size of the box.
If | the size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
Size | The size of the box that will be generated. |
Definition at line 316 of file roundedboxgenerator.cpp.
RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetSizeX | ( | const Real | SizeX | ) |
Sets the size of the box along X axis.
If | the size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
SizeX | The size to set for the generated box on the X axis. |
Definition at line 289 of file roundedboxgenerator.cpp.
RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetSizeY | ( | const Real | SizeY | ) |
Sets the size of the box along Y axis.
If | the size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
SizeY | The size to set for the generated box on the Y axis. |
Definition at line 298 of file roundedboxgenerator.cpp.
RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetSizeZ | ( | const Real | SizeZ | ) |
Sets the size of the box along Z axis.
If | the size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
SizeZ | The size to set for the generated box on the Z axis. |
Definition at line 307 of file roundedboxgenerator.cpp.
|
protected |
The radius of the rounded portion of the box corners.
Definition at line 90 of file roundedboxgenerator.h.
|
protected |
The size of the box to generate.
Definition at line 87 of file roundedboxgenerator.h.
|
protected |
The number of segments to generate along the length of the rounded edges.
Definition at line 93 of file roundedboxgenerator.h.
|
protected |
The number of segments to generate along the X axis for each side.
Definition at line 96 of file roundedboxgenerator.h.
|
protected |
The number of segments to generate along the Y axis for each side.
Definition at line 99 of file roundedboxgenerator.h.
|
protected |
The number of segments to generate along the Z axis for each side.
Definition at line 102 of file roundedboxgenerator.h.