This interface can be used to provide additional vertex data for the rendering.
When an object with this type is added as a child to a Mesh object in the scene graph, the renderer uses that object to obtain additional vertex data for the rendering (like vertex color, bone indices and weights). This interface is important when you want to use your own custom shader for rendering, which needs more data than the usual vertex data (position, normal, etc.).
Definition at line 209 of file renderer.h.
#include <renderer.h>
Classes |
|
struct | ComponentDescription |
This structure carries information about a
component.
More... |
|
struct | DirtyVertex |
This structure describes a dirty vertex.
More... |
|
Public Member Functions |
|
virtual int | ComponentCount (void) const |
Returns the number of different vertex
components this object has data for. |
|
virtual ComponentDescription | Component (int iIndex) const |
Returns the description of a given
component. |
|
virtual const void * | VertexData (unsigned int iVertexIndex, int iComponentIndex) const |
Returns the data for a given vertex and
component. |
|
virtual void | SetVertexData (unsigned int iVertexIndex, int iComponentIndex, unsigned int iDimensionIndex, const void *pValue) |
Sets the data for a given vertex, component,
and dimension. |
|
virtual QVector< DirtyVertex > & | DirtyVertexList (void) |
This function must return an array of vertex
indices whose data has been changed since the last call to this
function. |
virtual int ComponentCount | ( | void | ) | const [virtual] |
Returns the number of different vertex components this object has data for.
virtual ComponentDescription Component | ( | int | iIndex | ) | const [virtual] |
Returns the description of a given component.
[in] | iIndex | Index of the component. |
virtual const void* VertexData | ( | unsigned int | iVertexIndex, |
int | iComponentIndex | ||
) | const [virtual] |
Returns the data for a given vertex and component.
[in] | iVertexIndex | Index of the vertex. |
[in] | iComponentIndex | Index of the component. |
virtual void SetVertexData | ( | unsigned int | iVertexIndex, |
int | iComponentIndex, | ||
unsigned int | iDimensionIndex, | ||
const void * | pValue | ||
) | [virtual] |
Sets the data for a given vertex, component, and dimension.
For example, to set the 2nd element of the 1st component, for the 0th vertex: VertexDataProvider::ComponentDescription d = Component(1); if( d.m_eType == eFloat && d.m_iDimension >= 3 ) { float fNewValue = 1.0f;; SetVertexData( 0, 1, 2, (const void*)&fNewValue); }
[in] | iVertexIndex | Index of the vertex. |
[in] | iComponentIndex | Index of the component. |
[in] | iDimensionIndex | Index of the dimension. |
[in] | pValue | an element of type m_eType. |
virtual QVector<DirtyVertex>& DirtyVertexList | ( | void | ) | [virtual] |
This function must return an array of vertex indices whose data has been changed since the last call to this function.
There are two ways to update the buffers in the renderer object: