A generator class for a capsule mesh with rounded ends. More...
#include <capsulegenerator.h>
Public Member Functions | |||
CapsuleGenerator (const Real Radius, const Real Height, const Whole Rings=8, const Whole SegCircle=16, const Whole SegHeight=1) | |||
Class constructor. More... | |||
virtual | ~CapsuleGenerator () | ||
Class destructor. | |||
virtual void | AddToTriangleBuffer (TriangleBuffer &Buffer) const | ||
Adds the vertices and indices as configured in this generator to a triangle buffer. More... | |||
CapsuleGenerator & | SetHeight (const Real Height) | ||
Sets the height of the main body part of the capsule.
| |||
CapsuleGenerator & | SetNumRings (const Whole Rings) | ||
Sets the number of segments of the sphere part.
| |||
CapsuleGenerator & | SetNumSegCircle (const Whole SegCircle) | ||
Sets the number of segments when rotating around the cylinder.
| |||
CapsuleGenerator & | SetNumSegHeight (const Whole SegHeight) | ||
Sets the number of segments along the axis of the cylinder.
| |||
CapsuleGenerator & | SetRadius (const Real Radius) | ||
Sets the radius of the main body part of the capsule.
| |||
Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< CapsuleGenerator > | |||
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... | |||
CapsuleGenerator & | ResetTransforms () | ||
Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More... | |||
CapsuleGenerator & | SetEnableNormals (Boole EnableNormals) | ||
Sets whether normals are enabled or not. More... | |||
CapsuleGenerator & | SetNumTexCoordSet (const UInt8 NumSets) | ||
Sets the number of texture coordintate sets. More... | |||
CapsuleGenerator & | SetOrientation (const Quaternion &Ori) | ||
Sets an orientation baked into the resulting mesh. More... | |||
CapsuleGenerator & | SetOrientation (const Real X, const Real Y, const Real Z, const Real W) | ||
Sets an orientation baked into the resulting mesh. More... | |||
CapsuleGenerator & | SetPosition (const Vector3 &Loc) | ||
Sets a translation baked into the resulting mesh. More... | |||
CapsuleGenerator & | SetPosition (const Real X, const Real Y, const Real Z) | ||
Sets a translation baked into the resulting mesh. More... | |||
CapsuleGenerator & | SetScale (const Vector3 &Scaling) | ||
Sets a scale baked into the resulting mesh. More... | |||
CapsuleGenerator & | SetScale (const Real Scaling) | ||
Sets a uniform scale baked into the resulting mesh. More... | |||
CapsuleGenerator & | SetScale (const Real X, const Real Y, const Real Z) | ||
Sets a scale baked into the resulting mesh. More... | |||
CapsuleGenerator & | SetSwitchUV (Boole SwitchUV) | ||
Sets whether to switch U and V texture coordinates. More... | |||
CapsuleGenerator & | SetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom) | ||
Sets the texture rectangle. More... | |||
CapsuleGenerator & | SetUTile (const Real uTile) | ||
Sets the U Tile. More... | |||
CapsuleGenerator & | SetVTile (const Real vTile) | ||
Sets the V Tile. More... | |||
Protected Attributes | |
Real | CapsuleHeight |
The total height of the capsule main body. More... | |
Real | CapsuleRadius |
The radius of the capsule main body. More... | |
Whole | NumRings |
The resolution of both hemispheres at the end of the capsule. More... | |
Whole | NumSegCircle |
The resolution of the circular component of the capsule. More... | |
Whole | NumSegHeight |
The number of segments in the capsules body length. More... | |
Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< CapsuleGenerator > | |
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< CapsuleGenerator > | |
enum | GeneratorOptions |
A convenience enum used to describe boolean options for a generator. | |
Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< CapsuleGenerator > | |
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 capsule mesh with rounded ends.
Definition at line 82 of file capsulegenerator.h.
Mezzanine::Graphics::Procedural::CapsuleGenerator::CapsuleGenerator | ( | const Real | Radius, |
const Real | Height, | ||
const Whole | Rings = 8 , |
||
const Whole | SegCircle = 16 , |
||
const Whole | SegHeight = 1 |
||
) |
Class constructor.
Radius | The radius of the capsule main body. |
Height | The total height of the capsule main body. |
Rings | The resolution of both hemispheres at the end of the capsule. |
SegCircle | The resolution of the circular component of the capsule. |
SegHeight | The number of segments in the capsules body length. |
Definition at line 81 of file capsulegenerator.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< CapsuleGenerator >.
Definition at line 95 of file capsulegenerator.cpp.
CapsuleGenerator & Mezzanine::Graphics::Procedural::CapsuleGenerator::SetHeight | ( | const Real | Height | ) |
Sets the height of the main body part of the capsule.
If | the height is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
Height | The total height of the capsule main body. |
Definition at line 208 of file capsulegenerator.cpp.
CapsuleGenerator & Mezzanine::Graphics::Procedural::CapsuleGenerator::SetNumRings | ( | const Whole | Rings | ) |
Sets the number of segments of the sphere part.
If | the number of rings is set to 0, a PARAMETERS_EXCEPTION will be thrown. |
Rings | The resolution of both hemispheres at the end of the capsule. |
Definition at line 216 of file capsulegenerator.cpp.
CapsuleGenerator & Mezzanine::Graphics::Procedural::CapsuleGenerator::SetNumSegCircle | ( | const Whole | SegCircle | ) |
Sets the number of segments when rotating around the cylinder.
If | the number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown. |
SegCircle | The resolution of the circular component of the capsule. |
Definition at line 225 of file capsulegenerator.cpp.
CapsuleGenerator & Mezzanine::Graphics::Procedural::CapsuleGenerator::SetNumSegHeight | ( | const Whole | SegHeight | ) |
Sets the number of segments along the axis of the cylinder.
If | the number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown. |
SegHeight | The number of segments in the capsules body length. |
Definition at line 234 of file capsulegenerator.cpp.
CapsuleGenerator & Mezzanine::Graphics::Procedural::CapsuleGenerator::SetRadius | ( | const Real | Radius | ) |
Sets the radius of the main body part of the capsule.
If | the radius is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown. |
Radius | The radius of the capsule main body. |
Definition at line 199 of file capsulegenerator.cpp.
|
protected |
The total height of the capsule main body.
Definition at line 90 of file capsulegenerator.h.
|
protected |
The radius of the capsule main body.
Definition at line 87 of file capsulegenerator.h.
|
protected |
The resolution of both hemispheres at the end of the capsule.
Definition at line 93 of file capsulegenerator.h.
|
protected |
The resolution of the circular component of the capsule.
Definition at line 96 of file capsulegenerator.h.
|
protected |
The number of segments in the capsules body length.
Definition at line 99 of file capsulegenerator.h.