67 #ifndef _graphicsproceduralconegenerator_cpp
68 #define _graphicsproceduralconegenerator_cpp
70 #include "Graphics/Procedural/Mesh/conegenerator.h"
72 #include "MathTools/mathtools.h"
84 NumSegCircle(SegCircle),
85 NumSegHeight(SegHeight)
112 Real x0 = r0 * cosf( j * deltaAngle );
113 Real z0 = r0 * sinf( j * deltaAngle );
121 if( i != this->NumSegHeight && j != this->NumSegCircle ) {
122 Buffer.
AddIndex( Offset + this->NumSegCircle + 2 );
124 Buffer.
AddIndex( Offset + this->NumSegCircle + 1 );
125 Buffer.
AddIndex( Offset + this->NumSegCircle + 2 );
149 if( j != this->NumSegCircle ) {
Real ConeRadius
The radius of the cone.
ConeGenerator & SetHeight(const Real Height)
Sets the height of the cone. the height is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown...
Vector3 GetNormal() const
This returns the normal for this relative to the origin.
virtual void AddToTriangleBuffer(TriangleBuffer &Buffer) const
Adds the vertices and indices as configured in this generator to a triangle buffer.
A convenience buffer that stores vertices and indices of a mesh to be generated.
ConeGenerator & SetNumSegHeight(const Whole SegHeight)
Sets the number of segments on the height. the number of segments is set to 0, a PARAMETERS_EXCEPTION...
void SetFromAxisAngle(const Real &Angle, const Vector3 &Axis)
Generates and sets the values of this quaternion to describe a rotation from an axis and angle on tha...
#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.
This implements the exception hiearchy for Mezzanine.
A generator class for a cone mesh.
float Real
A Datatype used to represent a real floating point number.
ConeGenerator & SetRadius(const Real Radius)
Sets the base radius. the radius is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown...
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.
Whole NumSegCircle
The resolution of the circular component of the cone.
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.
Whole NumSegHeight
The number of segments in the cones length.
Thrown when parameters are checked at runtime and found invalid.
Real ConeHeight
The height of the cone.
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.
ConeGenerator & SetNumSegCircle(const Whole SegCircle)
Sets the number of segments on the side of the base. the number of segments is less than three...
This is used to store information about rotation in 3d space.
virtual ~ConeGenerator()
Class destructor.
ConeGenerator(const Real Radius, const Real Height, const Whole SegCircle=16, const Whole SegHeight=1)
Class constructor.
static Vector3 Neg_Unit_Y()
Gets a vector representing the negative Y unit of a Vector3.