A generator class for a torus knot mesh. More...
#include <torusknotgenerator.h>
Public Member Functions | |||
TorusKnotGenerator (const Real PoloidalRadius, const Real ToroidalRadius, const Integer PParam=2, const Integer QParam=3, const Whole PoloidalSeg=16, const Whole ToroidalSeg=16) | |||
Class constructor. More... | |||
virtual | ~TorusKnotGenerator () | ||
Class destructor. | |||
virtual void | AddToTriangleBuffer (TriangleBuffer &Buffer) const | ||
Adds the vertices and indices as configured in this generator to a triangle buffer. More... | |||
TorusKnotGenerator & | SetNumPoloidalSeg (const Whole PoloidalSeg) | ||
Sets the number of segments on the Poloidal ring.
| |||
TorusKnotGenerator & | SetNumToroidalSeg (const Whole ToroidalSeg) | ||
Sets the number of segments along the guiding circle.
| |||
TorusKnotGenerator & | SetPoloidalRadius (const Real PoloidalRadius) | ||
Sets the radius of the torus.
| |||
TorusKnotGenerator & | SetPParameter (const Integer PParam) | ||
Sets the p parameter of the knot
| |||
TorusKnotGenerator & | SetQParameter (const Integer QParam) | ||
Sets the q parameter of the knot
| |||
TorusKnotGenerator & | SetToroidalRadius (const Real ToroidalRadius) | ||
Sets the radius of the torus ring. AKA it's thickness.
| |||
Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< TorusKnotGenerator > | |||
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... | |||
TorusKnotGenerator & | ResetTransforms () | ||
Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More... | |||
TorusKnotGenerator & | SetEnableNormals (Boole EnableNormals) | ||
Sets whether normals are enabled or not. More... | |||
TorusKnotGenerator & | SetNumTexCoordSet (const UInt8 NumSets) | ||
Sets the number of texture coordintate sets. More... | |||
TorusKnotGenerator & | SetOrientation (const Quaternion &Ori) | ||
Sets an orientation baked into the resulting mesh. More... | |||
TorusKnotGenerator & | SetOrientation (const Real X, const Real Y, const Real Z, const Real W) | ||
Sets an orientation baked into the resulting mesh. More... | |||
TorusKnotGenerator & | SetPosition (const Vector3 &Loc) | ||
Sets a translation baked into the resulting mesh. More... | |||
TorusKnotGenerator & | SetPosition (const Real X, const Real Y, const Real Z) | ||
Sets a translation baked into the resulting mesh. More... | |||
TorusKnotGenerator & | SetScale (const Vector3 &Scaling) | ||
Sets a scale baked into the resulting mesh. More... | |||
TorusKnotGenerator & | SetScale (const Real Scaling) | ||
Sets a uniform scale baked into the resulting mesh. More... | |||
TorusKnotGenerator & | SetScale (const Real X, const Real Y, const Real Z) | ||
Sets a scale baked into the resulting mesh. More... | |||
TorusKnotGenerator & | SetSwitchUV (Boole SwitchUV) | ||
Sets whether to switch U and V texture coordinates. More... | |||
TorusKnotGenerator & | SetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom) | ||
Sets the texture rectangle. More... | |||
TorusKnotGenerator & | SetUTile (const Real uTile) | ||
Sets the U Tile. More... | |||
TorusKnotGenerator & | SetVTile (const Real vTile) | ||
Sets the V Tile. More... | |||
Protected Attributes | |
Whole | NumPoloidalSeg |
The resolution of the Poloidal ring. More... | |
Whole | NumToroidalSeg |
The resolution of the Toroidal ring. More... | |
Integer | PParameter |
Controls how many times the knot is going around the torus. More... | |
Integer | QParameter |
Controls how many times the knot goes through the center of the torus. More... | |
Real | TorusPoloidalRadius |
The radius of the primary ring of the torus. More... | |
Real | TorusToroidalRadius |
The radius of the secondary ring of the torus. More... | |
Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< TorusKnotGenerator > | |
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< TorusKnotGenerator > | |
enum | GeneratorOptions |
A convenience enum used to describe boolean options for a generator. | |
Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< TorusKnotGenerator > | |
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 torus knot mesh.
Definition at line 85 of file torusknotgenerator.h.
Mezzanine::Graphics::Procedural::TorusKnotGenerator::TorusKnotGenerator | ( | const Real | PoloidalRadius, |
const Real | ToroidalRadius, | ||
const Integer | PParam = 2 , |
||
const Integer | QParam = 3 , |
||
const Whole | PoloidalSeg = 16 , |
||
const Whole | ToroidalSeg = 16 |
||
) |
Class constructor.
PoloidalRadius | The radius of the primary ring of the torus. |
ToroidalRadius | The radius of the secondary ring of the torus. |
PParam | Controls how many times the knot is going around the torus. |
QParam | Controls how many times the knot goes through the center of the torus. |
PoloidalSeg | The resolution of the primary ring of the torus. |
ToroidalSeg | The resolution of the secondary ring of the torus. |
Definition at line 81 of file torusknotgenerator.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< TorusKnotGenerator >.
Definition at line 96 of file torusknotgenerator.cpp.
TorusKnotGenerator & Mezzanine::Graphics::Procedural::TorusKnotGenerator::SetNumPoloidalSeg | ( | const Whole | PoloidalSeg | ) |
Sets the number of segments on the Poloidal ring.
If | the number of segments is less than three, a PARAMETERS_EXCEPTION will be thrown. |
PoloidalSeg | The resolution of the primary ring of the torus. |
Definition at line 183 of file torusknotgenerator.cpp.
TorusKnotGenerator & Mezzanine::Graphics::Procedural::TorusKnotGenerator::SetNumToroidalSeg | ( | const Whole | ToroidalSeg | ) |
Sets the number of segments along the guiding circle.
If | the number of segments is less than three, a PARAMETERS_EXCEPTION will be thrown. |
ToroidalSegThe | resolution of the secondary ring of the torus. |
Definition at line 192 of file torusknotgenerator.cpp.
TorusKnotGenerator & Mezzanine::Graphics::Procedural::TorusKnotGenerator::SetPoloidalRadius | ( | const Real | PoloidalRadius | ) |
Sets the radius of the torus.
If | the radius is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
PoloidalRadius | The radius of the primary ring of the torus. |
Definition at line 147 of file torusknotgenerator.cpp.
TorusKnotGenerator & Mezzanine::Graphics::Procedural::TorusKnotGenerator::SetPParameter | ( | const Integer | PParam | ) |
Sets the p parameter of the knot
If | the paramter is set to 0, a PARAMETERS_EXCEPTION will be thrown. |
PParam | Controls how many times the knot is going around the torus. |
Definition at line 165 of file torusknotgenerator.cpp.
TorusKnotGenerator & Mezzanine::Graphics::Procedural::TorusKnotGenerator::SetQParameter | ( | const Integer | QParam | ) |
Sets the q parameter of the knot
If | the paramter is set to 0, a PARAMETERS_EXCEPTION will be thrown. |
QParam | Controls how many times the knot goes through the center of the torus. |
Definition at line 174 of file torusknotgenerator.cpp.
TorusKnotGenerator & Mezzanine::Graphics::Procedural::TorusKnotGenerator::SetToroidalRadius | ( | const Real | ToroidalRadius | ) |
Sets the radius of the torus ring. AKA it's thickness.
If | the radius is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
ToroidalRadius | The radius of the secondary ring of the torus. |
Definition at line 156 of file torusknotgenerator.cpp.
|
protected |
The resolution of the Poloidal ring.
Definition at line 104 of file torusknotgenerator.h.
|
protected |
The resolution of the Toroidal ring.
Definition at line 107 of file torusknotgenerator.h.
|
protected |
Controls how many times the knot is going around the torus.
Definition at line 98 of file torusknotgenerator.h.
|
protected |
Controls how many times the knot goes through the center of the torus.
Definition at line 101 of file torusknotgenerator.h.
|
protected |
The radius of the primary ring of the torus.
Definition at line 91 of file torusknotgenerator.h.
|
protected |
The radius of the secondary ring of the torus.
Definition at line 95 of file torusknotgenerator.h.