A MeshBuffers wrapper that provides a convenient API to define the mesh content. More...
#include <Mesh.h>
Public Member Functions | |
Mesh (MeshMode m, MeshUsage usage, int vertexCount=4, int indiceCount=4) | |
Creates a new mesh. | |
Mesh (ptr< MeshBuffers > target, MeshMode m, MeshUsage usage, int vertexCount=4, int indiceCount=4) | |
Creates a new mesh. | |
virtual | ~Mesh () |
Deletes this mesh. | |
MeshMode | getMode () const |
Returns the interpretation mode of the vertices of this mesh. | |
int | getVertexCount () const |
Returns the number of vertices in this mesh. | |
vertex | getVertex (int i) const |
Returns a vertex of this mesh. | |
int | getIndiceCount () const |
Returns the number of indices of this mesh. | |
GLint | getPrimitiveRestart () const |
Returns the vertex index used for primitive restart. | |
GLint | getPatchVertices () const |
Returns the number of vertices per patch in this mesh, if getMode() is PATCHES. | |
ptr< MeshBuffers > | getBuffers () const |
Returns the MeshBuffers wrapped by this Mesh instance. | |
void | addAttributeType (int id, int size, AttributeType type, bool norm) |
Declares an attribute of the vertices of this mesh. | |
void | setCapacity (int vertexCount, int indiceCount) |
Sets the capacity of the vertex and indice array of this mesh. | |
void | addVertex (const vertex &v) |
Adds a vertex to this mesh. | |
void | addVertices (const vertex *v, int count) |
Adds vertices this mesh. | |
void | addIndice (index i) |
Adds an indice to this mesh. | |
void | setMode (MeshMode mode) |
Sets the interpretation mode of the vertices of this mesh. | |
void | setVertex (int i, const vertex &v) |
Changes a vertex of this mesh. | |
void | setIndice (int i, index ind) |
Changes an indice of this mesh. | |
void | setPrimitiveRestart (GLint restart) |
Sets the vertex index used for primitive restart. | |
void | setPatchVertices (GLint vertices) |
Sets the number of vertices per patch in this mesh, if getMode() is PATCHES. | |
void | clear () |
Removes all the vertices and indices of this mesh. | |
void | clearBuffers () |
Clears the MeshBuffers. |
A MeshBuffers wrapper that provides a convenient API to define the mesh content.
vertex | the type of the vertices of this mesh. | |
index | the type of the indices of this mesh. |
ork::Mesh< vertex, index >::Mesh | ( | MeshMode | m, | |
MeshUsage | usage, | |||
int | vertexCount = 4 , |
|||
int | indiceCount = 4 | |||
) | [inline] |
Creates a new mesh.
m | how the list of vertices of this mesh must be interpreted. | |
usage | how the data should be handled. | |
vertexCount | the initial capacity of the vertex array. | |
indiceCount | the initial capacity of the indice array. |
ork::Mesh< vertex, index >::Mesh | ( | ptr< MeshBuffers > | target, | |
MeshMode | m, | |||
MeshUsage | usage, | |||
int | vertexCount = 4 , |
|||
int | indiceCount = 4 | |||
) | [inline] |
Creates a new mesh.
target | the mesh buffers wrapped by this mesh. | |
m | how the list of vertices of this mesh must be interpreted. | |
usage | how the data should be handled. | |
vertexCount | the initial capacity of the vertex array. | |
indiceCount | the initial capacity of the indice array. |
Deletes this mesh.
void ork::Mesh< vertex, index >::addAttributeType | ( | int | id, | |
int | size, | |||
AttributeType | type, | |||
bool | norm | |||
) | [inline] |
Declares an attribute of the vertices of this mesh.
id | a vertex attribute index. | |
size | the number of components in attributes of this kind. | |
type | the type of each component in attributes of this kind. | |
norm | if the attribute components must be normalized to 0..1. |
void ork::Mesh< vertex, index >::addIndice | ( | index | i | ) | [inline] |
Adds an indice to this mesh.
i | a vertex index. |
void ork::Mesh< vertex, index >::addVertex | ( | const vertex & | v | ) | [inline] |
Adds a vertex to this mesh.
v | a vertex. |
void ork::Mesh< vertex, index >::addVertices | ( | const vertex * | v, | |
int | count | |||
) | [inline] |
Adds vertices this mesh.
v | a pointer to a vertex array. | |
count | number of vertices |
void ork::Mesh< vertex, index >::clear | ( | ) | [inline] |
Removes all the vertices and indices of this mesh.
void ork::Mesh< vertex, index >::clearBuffers | ( | ) | [inline] |
Clears the MeshBuffers.
ptr< MeshBuffers > ork::Mesh< vertex, index >::getBuffers | ( | ) | const [inline] |
Returns the MeshBuffers wrapped by this Mesh instance.
int ork::Mesh< vertex, index >::getIndiceCount | ( | ) | const [inline] |
Returns the number of indices of this mesh.
MeshMode ork::Mesh< vertex, index >::getMode | ( | ) | const [inline] |
Returns the interpretation mode of the vertices of this mesh.
GLint ork::Mesh< vertex, index >::getPatchVertices | ( | ) | const [inline] |
Returns the number of vertices per patch in this mesh, if getMode() is PATCHES.
GLint ork::Mesh< vertex, index >::getPrimitiveRestart | ( | ) | const [inline] |
Returns the vertex index used for primitive restart.
-1 means no restart.
vertex ork::Mesh< vertex, index >::getVertex | ( | int | i | ) | const [inline] |
Returns a vertex of this mesh.
i | a vertex index. |
int ork::Mesh< vertex, index >::getVertexCount | ( | ) | const [inline] |
Returns the number of vertices in this mesh.
void ork::Mesh< vertex, index >::setCapacity | ( | int | vertexCount, | |
int | indiceCount | |||
) | [inline] |
Sets the capacity of the vertex and indice array of this mesh.
Does nothing if the provided sizes are smaller than the current ones.
vertexCount | the new vertex array capacity. | |
indiceCount | the new indice array capacity. |
void ork::Mesh< vertex, index >::setIndice | ( | int | i, | |
index | ind | |||
) | [inline] |
Changes an indice of this mesh.
void ork::Mesh< vertex, index >::setMode | ( | MeshMode | mode | ) | [inline] |
Sets the interpretation mode of the vertices of this mesh.
void ork::Mesh< vertex, index >::setPatchVertices | ( | GLint | vertices | ) | [inline] |
Sets the number of vertices per patch in this mesh, if getMode() is PATCHES.
void ork::Mesh< vertex, index >::setPrimitiveRestart | ( | GLint | restart | ) | [inline] |
Sets the vertex index used for primitive restart.
-1 means no restart.
void ork::Mesh< vertex, index >::setVertex | ( | int | i, | |
const vertex & | v | |||
) | [inline] |
Changes a vertex of this mesh.