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

A generator class for a sphere mesh where all triangles are the same size. More...

#include <icospheregenerator.h>

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

Public Member Functions

 IcoSphereGenerator (const Real Radius, const Whole Iterations=2)
 Class constructor. More...
 
virtual ~IcoSphereGenerator ()
 Class destructor.
 
virtual void AddToTriangleBuffer (TriangleBuffer &Buffer) const
 Adds the vertices and indices as configured in this generator to a triangle buffer. More...
 
IcoSphereGeneratorSetNumIterations (const Whole Iterations)
 Sets the number of iterations needed to build the sphere mesh. More...
 
IcoSphereGeneratorSetRadius (const Real Radius)
 Sets the radius of the sphere.

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< IcoSphereGenerator >
 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...
 
IcoSphereGeneratorResetTransforms ()
 Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More...
 
IcoSphereGeneratorSetEnableNormals (Boole EnableNormals)
 Sets whether normals are enabled or not. More...
 
IcoSphereGeneratorSetNumTexCoordSet (const UInt8 NumSets)
 Sets the number of texture coordintate sets. More...
 
IcoSphereGeneratorSetOrientation (const Quaternion &Ori)
 Sets an orientation baked into the resulting mesh. More...
 
IcoSphereGeneratorSetOrientation (const Real X, const Real Y, const Real Z, const Real W)
 Sets an orientation baked into the resulting mesh. More...
 
IcoSphereGeneratorSetPosition (const Vector3 &Loc)
 Sets a translation baked into the resulting mesh. More...
 
IcoSphereGeneratorSetPosition (const Real X, const Real Y, const Real Z)
 Sets a translation baked into the resulting mesh. More...
 
IcoSphereGeneratorSetScale (const Vector3 &Scaling)
 Sets a scale baked into the resulting mesh. More...
 
IcoSphereGeneratorSetScale (const Real Scaling)
 Sets a uniform scale baked into the resulting mesh. More...
 
IcoSphereGeneratorSetScale (const Real X, const Real Y, const Real Z)
 Sets a scale baked into the resulting mesh. More...
 
IcoSphereGeneratorSetSwitchUV (Boole SwitchUV)
 Sets whether to switch U and V texture coordinates. More...
 
IcoSphereGeneratorSetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom)
 Sets the texture rectangle. More...
 
IcoSphereGeneratorSetUTile (const Real uTile)
 Sets the U Tile. More...
 
IcoSphereGeneratorSetVTile (const Real vTile)
 Sets the V Tile. More...
 

Protected Attributes

Whole NumIterations
 The number of iterations needed to build the sphere mesh. More...
 
Real SphereRadius
 The radius of the sphere. More...
 
- Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< IcoSphereGenerator >
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< IcoSphereGenerator >
enum  GeneratorOptions
 A convenience enum used to describe boolean options for a generator.
 
- Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< IcoSphereGenerator >
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 sphere mesh where all triangles are the same size.

Definition at line 82 of file icospheregenerator.h.

Constructor & Destructor Documentation

Mezzanine::Graphics::Procedural::IcoSphereGenerator::IcoSphereGenerator ( const Real  Radius,
const Whole  Iterations = 2 
)

Class constructor.

Parameters
RadiusThe radius of the sphere.
IterationsThe number of iterations needed to build the sphere mesh.

Definition at line 81 of file icospheregenerator.cpp.

Member Function Documentation

void Mezzanine::Graphics::Procedural::IcoSphereGenerator::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.

Step 1 : Generate icosahedron

Step 2 : tessellate

Step 3 : generate texcoords

Step 4 : fix texcoords

Step 5 : realize

Implements Mezzanine::Graphics::Procedural::MeshGenerator< IcoSphereGenerator >.

Definition at line 92 of file icospheregenerator.cpp.

IcoSphereGenerator & Mezzanine::Graphics::Procedural::IcoSphereGenerator::SetNumIterations ( const Whole  Iterations)

Sets the number of iterations needed to build the sphere mesh.

Remarks
At only a single iteration, this generator will create an icosahedron. Each iteration quadrupels the number of faces than the previous. This controls the resolution of the sphere, and ramps up quickly.
Exceptions
Ifthe number of iterations is set to 0, a PARAMETERS_EXCEPTION will be thrown.
Parameters
IterationsThe number of iterations needed to build the sphere mesh.
Returns
Returns a reference to this.

Definition at line 274 of file icospheregenerator.cpp.

IcoSphereGenerator & Mezzanine::Graphics::Procedural::IcoSphereGenerator::SetRadius ( const Real  Radius)

Sets the radius of the sphere.

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

Parameters
RadiusThe radius of the sphere.
Returns
Returns a reference to this.

Definition at line 265 of file icospheregenerator.cpp.

Member Data Documentation

Whole Mezzanine::Graphics::Procedural::IcoSphereGenerator::NumIterations
protected

The number of iterations needed to build the sphere mesh.

Definition at line 90 of file icospheregenerator.h.

Real Mezzanine::Graphics::Procedural::IcoSphereGenerator::SphereRadius
protected

The radius of the sphere.

Definition at line 87 of file icospheregenerator.h.


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