Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::Procedural::CapsuleGenerator Class Reference

A generator class for a capsule mesh with rounded ends. More...

#include <capsulegenerator.h>

+ Inheritance diagram for Mezzanine::Graphics::Procedural::CapsuleGenerator:
+ Collaboration diagram for Mezzanine::Graphics::Procedural::CapsuleGenerator:

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...
 
CapsuleGeneratorSetHeight (const Real Height)
 Sets the height of the main body part of the capsule.

Exceptions
Ifthe height is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
CapsuleGeneratorSetNumRings (const Whole Rings)
 Sets the number of segments of the sphere part.

Exceptions
Ifthe number of rings is set to 0, a PARAMETERS_EXCEPTION will be thrown.
More...
 
CapsuleGeneratorSetNumSegCircle (const Whole SegCircle)
 Sets the number of segments when rotating around the cylinder.

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.
More...
 
CapsuleGeneratorSetNumSegHeight (const Whole SegHeight)
 Sets the number of segments along the axis of the cylinder.

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.
More...
 
CapsuleGeneratorSetRadius (const Real Radius)
 Sets the radius of the main body part of the capsule.

Exceptions
Ifthe radius is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
- 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...
 
MeshGenerateMesh (const String &MeshName, const String &MeshGroup, const String &MatName, const String &MatGroup) const
 Generates the mesh. More...
 
CapsuleGeneratorResetTransforms ()
 Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More...
 
CapsuleGeneratorSetEnableNormals (Boole EnableNormals)
 Sets whether normals are enabled or not. More...
 
CapsuleGeneratorSetNumTexCoordSet (const UInt8 NumSets)
 Sets the number of texture coordintate sets. More...
 
CapsuleGeneratorSetOrientation (const Quaternion &Ori)
 Sets an orientation baked into the resulting mesh. More...
 
CapsuleGeneratorSetOrientation (const Real X, const Real Y, const Real Z, const Real W)
 Sets an orientation baked into the resulting mesh. More...
 
CapsuleGeneratorSetPosition (const Vector3 &Loc)
 Sets a translation baked into the resulting mesh. More...
 
CapsuleGeneratorSetPosition (const Real X, const Real Y, const Real Z)
 Sets a translation baked into the resulting mesh. More...
 
CapsuleGeneratorSetScale (const Vector3 &Scaling)
 Sets a scale baked into the resulting mesh. More...
 
CapsuleGeneratorSetScale (const Real Scaling)
 Sets a uniform scale baked into the resulting mesh. More...
 
CapsuleGeneratorSetScale (const Real X, const Real Y, const Real Z)
 Sets a scale baked into the resulting mesh. More...
 
CapsuleGeneratorSetSwitchUV (Boole SwitchUV)
 Sets whether to switch U and V texture coordinates. More...
 
CapsuleGeneratorSetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom)
 Sets the texture rectangle. More...
 
CapsuleGeneratorSetUTile (const Real uTile)
 Sets the U Tile. More...
 
CapsuleGeneratorSetVTile (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...
 

Detailed Description

A generator class for a capsule mesh with rounded ends.

Definition at line 82 of file capsulegenerator.h.

Constructor & Destructor Documentation

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.

Parameters
RadiusThe radius of the capsule main body.
HeightThe total height of the capsule main body.
RingsThe resolution of both hemispheres at the end of the capsule.
SegCircleThe resolution of the circular component of the capsule.
SegHeightThe number of segments in the capsules body length.

Definition at line 81 of file capsulegenerator.cpp.

Member Function Documentation

void Mezzanine::Graphics::Procedural::CapsuleGenerator::AddToTriangleBuffer ( TriangleBuffer Buffer) const
virtual

Adds the vertices and indices as configured in this generator to a triangle buffer.

Parameters
BufferThe 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.

Exceptions
Ifthe height is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.

Parameters
HeightThe total height of the capsule main body.
Returns
Returns a reference to this.

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.

Exceptions
Ifthe number of rings is set to 0, a PARAMETERS_EXCEPTION will be thrown.

Parameters
RingsThe resolution of both hemispheres at the end of the capsule.
Returns
Returns a reference to this.

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.

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.

Parameters
SegCircleThe resolution of the circular component of the capsule.
Returns
Returns a reference to this.

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.

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.

Parameters
SegHeightThe number of segments in the capsules body length.
Returns
Returns a reference to this.

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.

Exceptions
Ifthe radius is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.

Parameters
RadiusThe radius of the capsule main body.
Returns
Returns a reference to this.

Definition at line 199 of file capsulegenerator.cpp.

Member Data Documentation

Real Mezzanine::Graphics::Procedural::CapsuleGenerator::CapsuleHeight
protected

The total height of the capsule main body.

Definition at line 90 of file capsulegenerator.h.

Real Mezzanine::Graphics::Procedural::CapsuleGenerator::CapsuleRadius
protected

The radius of the capsule main body.

Definition at line 87 of file capsulegenerator.h.

Whole Mezzanine::Graphics::Procedural::CapsuleGenerator::NumRings
protected

The resolution of both hemispheres at the end of the capsule.

Definition at line 93 of file capsulegenerator.h.

Whole Mezzanine::Graphics::Procedural::CapsuleGenerator::NumSegCircle
protected

The resolution of the circular component of the capsule.

Definition at line 96 of file capsulegenerator.h.

Whole Mezzanine::Graphics::Procedural::CapsuleGenerator::NumSegHeight
protected

The number of segments in the capsules body length.

Definition at line 99 of file capsulegenerator.h.


The documentation for this class was generated from the following files: