Osiris Framework
0.3
|
Mesh class in which colors can be defined for each vertex. More...
#include <OsirisSDK/OVertexColorMesh.h>
Public Member Functions | |
OVertexColorMesh () | |
Class constructor. | |
virtual | ~OVertexColorMesh () |
Class destructor. | |
void | addVertexColorData (float r, float g, float b, float alpha) |
Add color definition values for each vertex. More... | |
Public Member Functions inherited from OMesh | |
OMesh (OShaderProgram *program=NULL) | |
Class constructor. More... | |
virtual | ~OMesh () |
Class destructor. | |
void | setProgram (OShaderProgram *program) |
Sets a new shader program to be used to render the object. More... | |
OShaderProgram * | getProgram () |
Returns the shader program used to render the object. More... | |
int | vertexCount () const |
Returns the number of vertices. | |
int | faceCount () const |
Returns the number of faces. | |
void | addVertexData (float vx, float vy, float vz) |
Add a vertex. More... | |
void | addIndexData (GLuint vi, GLuint vj, GLuint vk) |
Define a single triangle by the vertex indices. More... | |
OVector3 | vertexData (int idx) const |
Access vertex data. More... | |
OVector3 | indexData (int idx) const |
Access index information. More... | |
void | init () |
Initializes the mesh buffers and shader attributes. More... | |
void | render (OMatrixStack *mtx) |
Starts the rendering process for the object. More... | |
void | setFaceCulling (bool enabled, CullFace face=CullFace_Undefined, CullFront front=CullFront_Undefined) |
Enables or disables face culling. More... | |
Protected Member Functions | |
void | setupAdditionalVertexArrays () |
Virtual method to be used by derived classes to set additional vertex data. | |
Protected Member Functions inherited from OMesh | |
virtual void | setupAdditionalShaderLocations () |
Virtual method to be used by derived classes to set additional shader parameters. | |
OMeshBuffer< float > * | vertexBuffer () |
Returns the mesh vertex buffer. More... | |
OMeshBuffer< GLuint > * | indexBuffer () |
Returns the mesh index buffer. More... | |
const OMeshBuffer< float > * | vertexBufferConst () const |
Read-only method to obtain the vertex buffer. More... | |
const OMeshBuffer< GLuint > * | indexBufferConst () const |
Read-only method to obtain the index buffer. More... | |
Additional Inherited Members | |
Public Types inherited from OMesh | |
enum | CullFace { CullFace_Undefined =-1, CullFace_Front =GL_FRONT, CullFace_Back =GL_BACK } |
Sets which face will be rendered when face culling is available. More... | |
enum | CullFront { CullFront_Undefined =-1, CullFront_CW =GL_CW, CullFront_CCW =GL_CCW } |
In order to be able to ascertain which face is the front when dealing with face culling, we use the order in which the vertices are laid on each triangle. More... | |
Mesh class in which colors can be defined for each vertex.
The surface color of each triangle will be an interpolation between the values set for each vertex.
void OVertexColorMesh::addVertexColorData | ( | float | r, |
float | g, | ||
float | b, | ||
float | alpha | ||
) |
Add color definition values for each vertex.
The colors should be set after all vertex where defined.
r | Red component value. |
g | Green component value. |
b | Blue component value. |
alpha | Alpha channel component value. |