A generator that produces a Mesh by rotating a 2D shape around the Y axis. More...
#include <lathe.h>
Public Member Functions | |||
Lathe () | |||
Class constructor. | |||
Lathe (Shape *ToLathe, const Whole Segments) | |||
Shape constructor. More... | |||
Lathe (MultiShape *ToLathe, const Whole Segments) | |||
MultiShape constructor. More... | |||
virtual | ~Lathe () | ||
Class destructor. | |||
virtual void | AddToTriangleBuffer (TriangleBuffer &Buffer) const | ||
Adds the vertices and indices as configured in this generator to a triangle buffer. More... | |||
Lathe & | SetAngleBegin (const Real Begin) | ||
Sets the starting angle for the rotation. More... | |||
Lathe & | SetAngleEnd (const Real End) | ||
Sets the endng angle for the rotation. More... | |||
Lathe & | SetCapped (const Boole ShapeCapped) | ||
Sets whether or not the outside ends of the rotated shape should be enclosed. More... | |||
Lathe & | SetClosed (const Boole ShapeClosed) | ||
Sets whether or not the start and end segments should be connected. More... | |||
Lathe & | SetMultiShapeToLathe (MultiShape *ToLathe) | ||
Sets the MultiShape to to be Lathe'd. More... | |||
Lathe & | SetNumSegments (const Whole Segments) | ||
Sets the number of segments in the rotation to generate.
| |||
Lathe & | SetShapeToLathe (Shape *ToLathe) | ||
Sets the Shape to to be Lathe'd. More... | |||
Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Lathe > | |||
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... | |||
Lathe & | ResetTransforms () | ||
Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More... | |||
Lathe & | SetEnableNormals (Boole EnableNormals) | ||
Sets whether normals are enabled or not. More... | |||
Lathe & | SetNumTexCoordSet (const UInt8 NumSets) | ||
Sets the number of texture coordintate sets. More... | |||
Lathe & | SetOrientation (const Quaternion &Ori) | ||
Sets an orientation baked into the resulting mesh. More... | |||
Lathe & | SetOrientation (const Real X, const Real Y, const Real Z, const Real W) | ||
Sets an orientation baked into the resulting mesh. More... | |||
Lathe & | SetPosition (const Vector3 &Loc) | ||
Sets a translation baked into the resulting mesh. More... | |||
Lathe & | SetPosition (const Real X, const Real Y, const Real Z) | ||
Sets a translation baked into the resulting mesh. More... | |||
Lathe & | SetScale (const Vector3 &Scaling) | ||
Sets a scale baked into the resulting mesh. More... | |||
Lathe & | SetScale (const Real Scaling) | ||
Sets a uniform scale baked into the resulting mesh. More... | |||
Lathe & | SetScale (const Real X, const Real Y, const Real Z) | ||
Sets a scale baked into the resulting mesh. More... | |||
Lathe & | SetSwitchUV (Boole SwitchUV) | ||
Sets whether to switch U and V texture coordinates. More... | |||
Lathe & | SetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom) | ||
Sets the texture rectangle. More... | |||
Lathe & | SetUTile (const Real uTile) | ||
Sets the U Tile. More... | |||
Lathe & | SetVTile (const Real vTile) | ||
Sets the V Tile. More... | |||
Protected Member Functions | |
void | GenerateBody (TriangleBuffer &Buffer, const Shape *ToLathe) const |
Creates the main body of the lathe'd shape. More... | |
void | GenerateCaps (TriangleBuffer &Buffer) const |
Creates the caps at the ends of the rotated shape. More... | |
Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Lathe > | |
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 | AngleBegin |
The angle at which the rotation will start. More... | |
Real | AngleEnd |
The angle at which the rotation will end. More... | |
Boole | Capped |
Whether or not the ends should be capped if the shape isn't rotated a full 360 degrees. More... | |
Boole | Closed |
Whether or not the Lathe is configured to rotate a full 360 degrees. More... | |
MultiShape * | MultiShapeToLathe |
A pointer to the MultiShape that will be used to generate a Mesh. More... | |
Whole | NumSegments |
The number of segments to have when rotating the shape to produce the Mesh. Large number of segments means smoother shape. More... | |
Shape * | ShapeToLathe |
A pointer to the Shape that will be used to generate a Mesh. More... | |
Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Lathe > | |
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< Lathe > | |
enum | GeneratorOptions |
A convenience enum used to describe boolean options for a generator. | |
A generator that produces a Mesh by rotating a 2D shape around the Y axis.
Shapes that are Lathe'd do not need to be closed, and in general are assumed to be defined in the ( X >= 0 ) half-plane. In other words, the Y axis in local space for the generated Mesh will line up with "0" on the X axis in the shape, and be rotated to produce a mesh.
Mezzanine::Graphics::Procedural::Lathe::Lathe | ( | MultiShape * | ToLathe, |
const Whole | Segments | ||
) |
MultiShape constructor.
ToLathe | A pointer to the MultiShape to be Lathed. |
Segments | The number of segments to have when rotating the shape to produce the Mesh. Large number of segments means smoother shape. Will be clamped to be at least 3. |
|
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. |
If | neither the shape or multishape are defined an INVALID_STATE_EXCEPTION will be thrown. |
Implements Mezzanine::Graphics::Procedural::MeshGenerator< Lathe >.
|
protected |
|
protected |
Lathe & Mezzanine::Graphics::Procedural::Lathe::SetMultiShapeToLathe | ( | MultiShape * | ToLathe | ) |
Sets the MultiShape to to be Lathe'd.
ToLathe | A pointer to the MultiShape that will be used to generate a Mesh. |
Sets the number of segments in the rotation to generate.
If | the number of segments is being set to a number less than 3, an INVALID_PARAMETERS exception will be thrown. |
Segments | The number of segments to have when rotating the shape to produce the Mesh. Large number of segments means smoother shape. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
A pointer to the MultiShape that will be used to generate a Mesh.
|
protected |
|
protected |