67 #ifndef _graphicsproceduralmeshgenerator_h
68 #define _graphicsproceduralmeshgenerator_h
72 #include "quaternion.h"
74 #include "Graphics/Procedural/Mesh/trianglebuffer.h"
131 Buffer.
AddVertex(this->Position + this->Orientation * (this->Scale * Loc));
138 Buffer.
SetNormal(this->Orientation * Norm);
146 { Buffer.
SetTextureCoord( this->UVOrigin.
X + UV.
Y * this->UTile, this->UVOrigin.Y + UV.
X * this->VTile ); }
149 { Buffer.
SetTextureCoord( this->UVOrigin.
X + UV.
X * this->UTile, this->UVOrigin.Y + UV.
Y * this->VTile ); }
155 Orientation(0,0,0,1),
206 return static_cast<T&
>(*this);
215 return static_cast<T&
>(*this);
225 this->UVOrigin.
SetValues(RectTop,RectLeft);
226 this->UTile = RectRight - RectLeft;
227 this->VTile = RectBottom - RectTop;
228 return static_cast<T&
>(*this);
236 this->NumTexCoordSet = NumSets;
237 return static_cast<T&
>(*this);
246 if( EnableNormals ) {
251 return static_cast<T&
>(*this);
264 return static_cast<T&
>(*this);
275 this->Position = Loc;
277 return static_cast<T&
>(*this);
288 return static_cast<T&
>(*this);
295 this->Orientation = Ori;
297 return static_cast<T&
>(*this);
309 return static_cast<T&
>(*this);
316 this->Scale = Scaling;
318 return static_cast<T&
>(*this);
325 this->Scale.
SetValues(Scaling,Scaling,Scaling);
327 return static_cast<T&
>(*this);
338 return static_cast<T&
>(*this);
345 this->Position.
Zero();
348 return static_cast<T&
>(*this);
bool Boole
Generally acts a single bit, true or false.
T & SetVTile(const Real vTile)
Sets the V Tile.
UInt8 NumTexCoordSet
The number of texture coordinate sets to include.
A convenience buffer that stores vertices and indices of a mesh to be generated.
TriangleBuffer & SetTextureCoord(const Real U, const Real V)
Sets the texture coordinates of the current vertex.
T & SetScale(const Real Scaling)
Sets a uniform scale baked into the resulting mesh.
This class is used to check and modify the properties of a graphics mesh.
T & SetScale(const Vector3 &Scaling)
Sets a scale baked into the resulting mesh.
TriangleBuffer & SetNormal(const Vector3 &Norm)
Sets the normal of the current vertex.
virtual ~MeshGenerator()
Class destructor.
uint8_t UInt8
An 8-bit unsigned integer.
Mesh * GenerateMesh(const String &MeshName, const String &MeshGroup, const String &MatName="", const String &MatGroup="") const
Builds a Mesh from this buffer.
Vector3 Scale
Scale to apply to the mesh.
Mesh * GenerateMesh(const String &MeshName, const String &MeshGroup, const String &MatName, const String &MatGroup) const
Generates the mesh.
float Real
A Datatype used to represent a real floating point number.
T & SetPosition(const Vector3 &Loc)
Sets a translation baked into the resulting mesh.
T & SetOrientation(const Quaternion &Ori)
Sets an orientation baked into the resulting mesh.
Whether or not to swap the UV compontents when generating a mesh.
void SetValues(const Real &X, const Real &Y, const Real &Z, const Real &W)
Sets the individual values of this quaterion directly.
Real Y
Coordinate on the Y vector.
Vector3 Position
Position to apply to the mesh.
Real X
Coordinate on the X vector.
This is used to represent a point on a 2 dimentional area, such as a screen.
T & SetSwitchUV(Boole SwitchUV)
Sets whether to switch U and V texture coordinates.
A base class containing all of the utilities needed for a mesh generator.
void SetValues(const Real &x, const Real &y)
Sets the X and Y values of this vector2.
void SetValues(const Real &X, const Real &Y, const Real &Z)
Manually sets all the members of this vector3.
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.
Real VTile
V tile for texture coords generation.
TriangleBuffer BuildTriangleBuffer() const
Creates a TriangleBuffer with the the vertices and indices as configured in this generator.
T & ResetTransforms()
Resets all transforms (orientation, position and scale) that would have been applied to the mesh to t...
This is used to represent a point in space, or a vector through space.
virtual void AddToTriangleBuffer(TriangleBuffer &Buffer) const =0
Adds the vertices and indices as configured in this generator to a triangle buffer.
T & SetNumTexCoordSet(const UInt8 NumSets)
Sets the number of texture coordintate sets.
void Zero()
Sets all the members of this vector3 to zero.
void SetIdentity()
Sets default/identity values to the members of this quaternion.
Whether or not a transform has been defined and is to be used.
T & SetPosition(const Real X, const Real Y, const Real Z)
Sets a translation baked into the resulting mesh.
The bulk of the engine components go in this namspace.
T & SetScale(const Real X, const Real Y, const Real Z)
Sets a scale baked into the resulting mesh.
Whether or not to produce normals when generating a mesh.
T & SetUTile(const Real uTile)
Sets the U Tile.
T & SetOrientation(const Real X, const Real Y, const Real Z, const Real W)
Sets an orientation baked into the resulting mesh.
UInt8 GeneratorOpts
Storage for the boolean options to be used by this generator.
Real UTile
U tile for texture coords generation.
This is used to store information about rotation in 3d space.
GeneratorOptions
A convenience enum used to describe boolean options for a generator.
T & SetTextureRectangle(const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom)
Sets the texture rectangle.
std::string String
A datatype used to a series of characters.
Quaternion Orientation
Orientation to apply the mesh.
MeshGenerator()
Class constructor.
TriangleBuffer & AddVertex(const Vertex &Vert)
Adds a premade Vertex to the buffer.
Vector2 UVOrigin
Rectangle in which the texture coordinates will be placed.
T & SetEnableNormals(Boole EnableNormals)
Sets whether normals are enabled or not.