Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::Procedural::MeshGenerator< T > Class Template Referenceabstract

A base class containing all of the utilities needed for a mesh generator. More...

#include <meshgenerator.h>

+ Collaboration diagram for Mezzanine::Graphics::Procedural::MeshGenerator< T >:

Public Types

enum  GeneratorOptions { GO_EnableNormals = 1, GO_SwitchUV = 2, GO_Transform = 4 }
 A convenience enum used to describe boolean options for a generator. More...
 

Public Member Functions

 MeshGenerator ()
 Class constructor.
 
virtual ~MeshGenerator ()
 Class destructor.
 
virtual void AddToTriangleBuffer (TriangleBuffer &Buffer) const =0
 Adds the vertices and indices as configured in this generator to a triangle buffer. More...
 
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...
 
T & ResetTransforms ()
 Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More...
 
T & SetEnableNormals (Boole EnableNormals)
 Sets whether normals are enabled or not. More...
 
T & SetNumTexCoordSet (const UInt8 NumSets)
 Sets the number of texture coordintate sets. More...
 
T & SetOrientation (const Quaternion &Ori)
 Sets an orientation baked into the resulting mesh. More...
 
T & SetOrientation (const Real X, const Real Y, const Real Z, const Real W)
 Sets an orientation baked into the resulting mesh. More...
 
T & SetPosition (const Vector3 &Loc)
 Sets a translation baked into the resulting mesh. More...
 
T & SetPosition (const Real X, const Real Y, const Real Z)
 Sets a translation baked into the resulting mesh. More...
 
T & SetScale (const Vector3 &Scaling)
 Sets a scale baked into the resulting mesh. More...
 
T & SetScale (const Real Scaling)
 Sets a uniform scale baked into the resulting mesh. More...
 
T & SetScale (const Real X, const Real Y, const Real Z)
 Sets a scale baked into the resulting mesh. More...
 
T & SetSwitchUV (Boole SwitchUV)
 Sets whether to switch U and V texture coordinates. More...
 
T & SetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom)
 Sets the texture rectangle. More...
 
T & SetUTile (const Real uTile)
 Sets the U Tile. More...
 
T & SetVTile (const Real vTile)
 Sets the V Tile. More...
 

Protected Member Functions

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

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

Detailed Description

template<typename T>
class Mezzanine::Graphics::Procedural::MeshGenerator< T >

A base class containing all of the utilities needed for a mesh generator.

Definition at line 87 of file meshgenerator.h.

Member Enumeration Documentation

A convenience enum used to describe boolean options for a generator.

Enumerator
GO_EnableNormals 

Whether or not to produce normals when generating a mesh.

GO_SwitchUV 

Whether or not to swap the UV compontents when generating a mesh.

GO_Transform 

Whether or not a transform has been defined and is to be used.

Definition at line 91 of file meshgenerator.h.

Member Function Documentation

template<typename T>
void Mezzanine::Graphics::Procedural::MeshGenerator< T >::AddPoint ( TriangleBuffer Buffer,
const Vector3 Loc,
const Vector3 Norm,
const Vector2 UV 
) const
inlineprotected

Adds a new point to a triangle buffer, using the format defined for that MeshGenerator.

Parameters
BufferThe triangle buffer to update.
LocThe location of the new point.
Normthe normal of the new point.
UVthe uv texcoord of the new point.

Definition at line 128 of file meshgenerator.h.

template<typename T>
virtual void Mezzanine::Graphics::Procedural::MeshGenerator< T >::AddToTriangleBuffer ( TriangleBuffer Buffer) const
pure virtual
template<typename T>
TriangleBuffer Mezzanine::Graphics::Procedural::MeshGenerator< T >::BuildTriangleBuffer ( ) const
inline

Creates a TriangleBuffer with the the vertices and indices as configured in this generator.

Returns
Returns a new TriangleBuffer with the generated vertices and indices of this generator.

Definition at line 186 of file meshgenerator.h.

template<typename T>
Mesh* Mezzanine::Graphics::Procedural::MeshGenerator< T >::GenerateMesh ( const String MeshName,
const String MeshGroup,
const String MatName,
const String MatGroup 
) const
inline

Generates the mesh.

Parameters
MeshNameThe name to give to the generated mesh.
MeshGroupThe asset group to place the mesh in.
MatNameThe name of the material to apply to the mesh.
MatGroupThe asset group where the material can be found.
Returns
Returns a pointer to the newly created Mesh.

Definition at line 177 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::ResetTransforms ( )
inline

Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values.

Returns
Returns a reference to this.

Definition at line 342 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetEnableNormals ( Boole  EnableNormals)
inline

Sets whether normals are enabled or not.

Remarks
Default normals value is true.
Parameters
EnableNormalsTrue to generate normals as points are added to the mesh, false otherwise.
Returns
Returns a reference to this.

Definition at line 244 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetNumTexCoordSet ( const UInt8  NumSets)
inline

Sets the number of texture coordintate sets.

Remarks
Default NumTexCoordSet value is "1".
Parameters
NumSetsThe number of texture coordinate sets to use.
Returns
Returns a reference to this.

Definition at line 234 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetOrientation ( const Quaternion Ori)
inline

Sets an orientation baked into the resulting mesh.

Parameters
OriThe rotation to apply to a generated mesh.
Returns
Returns a reference to this.

Definition at line 293 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetOrientation ( const Real  X,
const Real  Y,
const Real  Z,
const Real  W 
)
inline

Sets an orientation baked into the resulting mesh.

Parameters
XThe X component of the Axis.
YThe Y component of the Axis.
ZThe Z component of the Axis.
WRotation on the Axis X, Y and Z defined.
Returns
Returns a reference to this.

Definition at line 305 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetPosition ( const Vector3 Loc)
inline

Sets a translation baked into the resulting mesh.

Parameters
LocThe amount of translation to be applied on each axis.
Returns
Returns a reference to this.

Definition at line 273 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetPosition ( const Real  X,
const Real  Y,
const Real  Z 
)
inline

Sets a translation baked into the resulting mesh.

Parameters
XThe amount of translation to be applied on the X axis.
YThe amount of translation to be applied on the Y axis.
ZThe amount of translation to be applied on the Z axis.
Returns
Returns a reference to this.

Definition at line 284 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetScale ( const Vector3 Scaling)
inline

Sets a scale baked into the resulting mesh.

Parameters
ScalingThe amount of scaling to apply on each axis to all meshes generated by this generator.
Returns
Returns a reference to this.

Definition at line 314 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetScale ( const Real  Scaling)
inline

Sets a uniform scale baked into the resulting mesh.

Parameters
ScalingThe amount of scaling to apply on each axis to all meshes generated by this generator.
Returns
Returns a reference to this.

Definition at line 323 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetScale ( const Real  X,
const Real  Y,
const Real  Z 
)
inline

Sets a scale baked into the resulting mesh.

Parameters
XThe amount of scaling to apply on the X axis to all meshes generated by this generator.
YThe amount of scaling to apply on the Y axis to all meshes generated by this generator.
ZThe amount of scaling to apply on the Z axis to all meshes generated by this generator.
Returns
Returns a reference to this.

Definition at line 334 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetSwitchUV ( Boole  SwitchUV)
inline

Sets whether to switch U and V texture coordinates.

Remarks
Default uvs value is false.
Parameters
SwitchUVTrue to swap the UV texture coordinates as points are added to the mesh, false otherwise.
Returns
Returns a reference to this.

Definition at line 257 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetTextureRectangle ( const Real  RectLeft,
const Real  RectRight,
const Real  RectTop,
const Real  RectBottom 
)
inline

Sets the texture rectangle.

Parameters
RectLeftThe texture coordinate for the left edge.
RectRightThe texture coordinate for the right edge.
RectTopThe texture coordinate for the top edge.
RectBottomThe texture coordinate for the bottom.
Returns
Returns a reference to this.

Definition at line 223 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetUTile ( const Real  uTile)
inline

Sets the U Tile.

Remarks
Default UTile value is "1".
Parameters
uTileThe number by which U texture coordinates are multiplied.
Returns
Returns a reference to this.

Definition at line 203 of file meshgenerator.h.

template<typename T>
T& Mezzanine::Graphics::Procedural::MeshGenerator< T >::SetVTile ( const Real  vTile)
inline

Sets the V Tile.

Remarks
Default VTile value is "1".
Parameters
vTileThe number by which V texture coordinates are multiplied.
Returns
Returns a reference to this.

Definition at line 212 of file meshgenerator.h.

Member Data Documentation

template<typename T>
UInt8 Mezzanine::Graphics::Procedural::MeshGenerator< T >::GeneratorOpts
protected

Storage for the boolean options to be used by this generator.

Definition at line 118 of file meshgenerator.h.

template<typename T>
UInt8 Mezzanine::Graphics::Procedural::MeshGenerator< T >::NumTexCoordSet
protected

The number of texture coordinate sets to include.

Definition at line 121 of file meshgenerator.h.

template<typename T>
Quaternion Mezzanine::Graphics::Procedural::MeshGenerator< T >::Orientation
protected

Orientation to apply the mesh.

Definition at line 100 of file meshgenerator.h.

template<typename T>
Vector3 Mezzanine::Graphics::Procedural::MeshGenerator< T >::Position
protected

Position to apply to the mesh.

Definition at line 103 of file meshgenerator.h.

template<typename T>
Vector3 Mezzanine::Graphics::Procedural::MeshGenerator< T >::Scale
protected

Scale to apply to the mesh.

Definition at line 106 of file meshgenerator.h.

template<typename T>
Real Mezzanine::Graphics::Procedural::MeshGenerator< T >::UTile
protected

U tile for texture coords generation.

Definition at line 112 of file meshgenerator.h.

template<typename T>
Vector2 Mezzanine::Graphics::Procedural::MeshGenerator< T >::UVOrigin
protected

Rectangle in which the texture coordinates will be placed.

Definition at line 109 of file meshgenerator.h.

template<typename T>
Real Mezzanine::Graphics::Procedural::MeshGenerator< T >::VTile
protected

V tile for texture coords generation.

Definition at line 115 of file meshgenerator.h.


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