67 #ifndef _graphicsproceduralcylindergenerator_cpp
68 #define _graphicsproceduralcylindergenerator_cpp
70 #include "Graphics/Procedural/Mesh/cylindergenerator.h"
72 #include "MathTools/mathtools.h"
82 CylinderRadius(Radius),
83 CylinderHeight(Height),
84 NumSegCircle(SegCircle),
85 NumSegHeight(SegHeight),
124 if( i != this->NumSegHeight ) {
125 Buffer.
AddIndex(Offset + this->NumSegCircle + 1);
127 Buffer.
AddIndex(Offset + this->NumSegCircle);
128 Buffer.
AddIndex(Offset + this->NumSegCircle + 1);
145 Real x0 = cosf( j * deltaAngle );
146 Real z0 = sinf( j * deltaAngle );
159 CenterIndex = Offset;
166 Real x0 = cosf( j * deltaAngle );
167 Real z0 = sinf( j * deltaAngle );
Real CylinderHeight
The height of the cylinder.
bool Boole
Generally acts a single bit, true or false.
CylinderGenerator & SetHeight(const Real Height)
Sets the number of segments along the height of the cylinder. the height is set to 0 or less...
A convenience buffer that stores vertices and indices of a mesh to be generated.
CylinderGenerator & SetRadius(const Real Radius)
Sets the radius of the cylinder. the radius is set to 0 or less, a PARAMETERS_EXCEPTION will be throw...
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
void EstimateIndexCount(const Whole IndexCount)
Gives an estimation of the number of indices needed for this triangle buffer.
void RebaseOffset()
Rebase index offset.
int Integer
A datatype used to represent any integer close to.
CylinderGenerator & SetNumSegHeight(const Whole SegHeight)
Sets the number of segments along the height of the cylinder. the number of segments is set to 0...
This implements the exception hiearchy for Mezzanine.
CylinderGenerator & SetNumSegCircle(const Whole SegCircle)
Sets the number of segments when rotating around the cylinder's axis. the number of segments is less ...
A generator class for a cylinder mesh with flat ends.
float Real
A Datatype used to represent a real floating point number.
void EstimateVertexCount(const Whole VertexCount)
Gives an estimation of the number of vertices need for this triangle buffer.
This is used to represent a point on a 2 dimentional area, such as a screen.
static Vector3 Unit_Y()
Gets a vector representing the Y unit of a Vector3.
virtual void AddToTriangleBuffer(TriangleBuffer &Buffer) const
Adds the vertices and indices as configured in this generator to a triangle buffer.
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.
Thrown when parameters are checked at runtime and found invalid.
TriangleBuffer & AddIndex(const Integer Index)
Adds an index to the index buffer.
This is used to represent a point in space, or a vector through space.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
CylinderGenerator(const Real Radius, const Real Height, const Whole SegCircle=16, const Whole SegHeight=1, const Boole Capped=true)
Class constructor.
Boole CapEnds
Whether or not the ends of the cylinder will be generated/closed.
CylinderGenerator & SetCapped(const Boole Capped)
Sets whether the cylinder has endings or not.
Real CylinderRadius
The radius of the cylinder.
Whole NumSegCircle
The resolution of the circular component of the cylinder.
virtual ~CylinderGenerator()
Class destructor.
static Vector3 Neg_Unit_Y()
Gets a vector representing the negative Y unit of a Vector3.
Whole NumSegHeight
The number of segments in the cylinders length.