OGRE
1.12.13
Object-Oriented Graphics Rendering Engine
|
collects together all the vertex-related information used to render geometry. More...
#include <OgreVertexIndexData.h>
Classes | |
struct | HardwareAnimationData |
Struct used to hold hardware morph / pose vertex data information. More... | |
Public Types | |
typedef std::vector< HardwareAnimationData > | HardwareAnimationDataList |
Public Member Functions | |
VertexData (HardwareBufferManagerBase *mgr=0) | |
Constructor. More... | |
VertexData (VertexDeclaration *dcl, VertexBufferBinding *bind) | |
Constructor. More... | |
~VertexData () | |
ushort | allocateHardwareAnimationElements (ushort count, bool animateNormals) |
Allocate elements to serve a holder of morph / pose target data for hardware morphing / pose blending. More... | |
VertexData * | clone (bool copyData=true, HardwareBufferManagerBase *mgr=0) const |
Clones this vertex data, potentially including replicating any vertex buffers. More... | |
void | closeGapsInBindings (void) |
Remove any gaps in the vertex buffer bindings. More... | |
void | convertPackedColour (VertexElementType srcType, VertexElementType destType) |
Convert all packed colour values (VET_COLOUR_*) in buffers used to another type. More... | |
void | prepareForShadowVolume (void) |
Modifies the vertex data to be suitable for use for rendering shadow geometry. More... | |
void | removeUnusedBuffers (void) |
Remove all vertex buffers that never used by the vertex declaration. More... | |
void | reorganiseBuffers (VertexDeclaration *newDeclaration, const BufferUsageList &bufferUsage, HardwareBufferManagerBase *mgr=0) |
Reorganises the data in the vertex buffers according to the new vertex declaration passed in. More... | |
void | reorganiseBuffers (VertexDeclaration *newDeclaration, HardwareBufferManagerBase *mgr=0) |
Reorganises the data in the vertex buffers according to the new vertex declaration passed in. More... | |
Public Attributes | |
HardwareVertexBufferSharedPtr | hardwareShadowVolWBuffer |
Additional shadow volume vertex buffer storage. More... | |
HardwareAnimationDataList | hwAnimationDataList |
VertexElements used for hardware morph / pose animation. More... | |
size_t | hwAnimDataItemsUsed |
Number of hardware animation data items used. More... | |
bool | mDeleteDclBinding |
Whether this class should delete the declaration and binding. More... | |
VertexBufferBinding * | vertexBufferBinding |
Defines which vertex buffers are bound to which sources. More... | |
size_t | vertexCount |
The number of vertices to process in this particular rendering group. More... | |
VertexDeclaration * | vertexDeclaration |
Declaration of the the format of the vertex input. More... | |
size_t | vertexStart |
The position in the bound buffers to start reading vertex data from. This allows you to use a single buffer for many different renderables. More... | |
collects together all the vertex-related information used to render geometry.
The RenderOperation requires a pointer to a VertexData object, and it is also used in Mesh and SubMesh to store the vertex positions, normals, texture coordinates etc. VertexData can either be used alone (in order to render unindexed geometry, where the stream of vertices defines the triangles), or in combination with IndexData where the triangles are defined by indexes which refer to the entries in VertexData. It’s worth noting that you don’t necessarily have to use VertexData to store your applications geometry; all that is required is that you can build a VertexData structure when it comes to rendering. This is pretty easy since all of VertexData’s members are pointers, so you could maintain your vertex buffers and declarations in alternative structures if you like, so long as you can convert them for rendering.
typedef std::vector<HardwareAnimationData> Ogre::VertexData::HardwareAnimationDataList |
Ogre::VertexData::VertexData | ( | HardwareBufferManagerBase * | mgr = 0 | ) |
Constructor.
mgr | Optional HardwareBufferManager from which to create resources |
Ogre::VertexData::VertexData | ( | VertexDeclaration * | dcl, |
VertexBufferBinding * | bind | ||
) |
Constructor.
dcl | The VertexDeclaration to use |
bind | The VertexBufferBinding to use |
Ogre::VertexData::~VertexData | ( | ) |
VertexData* Ogre::VertexData::clone | ( | bool | copyData = true , |
HardwareBufferManagerBase * | mgr = 0 |
||
) | const |
Clones this vertex data, potentially including replicating any vertex buffers.
copyData | Whether to create new vertex buffers too or just reference the existing ones |
mgr | If supplied, the buffer manager through which copies should be made |
void Ogre::VertexData::prepareForShadowVolume | ( | void | ) |
Modifies the vertex data to be suitable for use for rendering shadow geometry.
void Ogre::VertexData::reorganiseBuffers | ( | VertexDeclaration * | newDeclaration, |
const BufferUsageList & | bufferUsage, | ||
HardwareBufferManagerBase * | mgr = 0 |
||
) |
Reorganises the data in the vertex buffers according to the new vertex declaration passed in.
Note that new vertex buffers are created and written to, so if the buffers being referenced by this vertex data object are also used by others, then the original buffers will not be damaged by this operation. Once this operation has completed, the new declaration passed in will overwrite the current one.
newDeclaration | The vertex declaration which will be used for the reorganised buffer state. Note that the new declaration must not include any elements which do not already exist in the current declaration; you can drop elements by excluding them from the declaration if you wish, however. |
bufferUsage | Vector of usage flags which indicate the usage options for each new vertex buffer created. The indexes of the entries must correspond to the buffer binding values referenced in the declaration. |
mgr | Optional pointer to the manager to use to create new declarations and buffers etc. If not supplied, the HardwareBufferManager singleton will be used |
void Ogre::VertexData::reorganiseBuffers | ( | VertexDeclaration * | newDeclaration, |
HardwareBufferManagerBase * | mgr = 0 |
||
) |
Reorganises the data in the vertex buffers according to the new vertex declaration passed in.
Note that new vertex buffers are created and written to, so if the buffers being referenced by this vertex data object are also used by others, then the original buffers will not be damaged by this operation. Once this operation has completed, the new declaration passed in will overwrite the current one. This version of the method derives the buffer usages from the existing buffers, by using the 'most flexible' usage from the equivalent sources.
newDeclaration | The vertex declaration which will be used for the reorganised buffer state. Note that the new delcaration must not include any elements which do not already exist in the current declaration; you can drop elements by excluding them from the declaration if you wish, however. |
mgr | Optional pointer to the manager to use to create new declarations and buffers etc. If not supplied, the HardwareBufferManager singleton will be used |
void Ogre::VertexData::closeGapsInBindings | ( | void | ) |
Remove any gaps in the vertex buffer bindings.
void Ogre::VertexData::removeUnusedBuffers | ( | void | ) |
Remove all vertex buffers that never used by the vertex declaration.
void Ogre::VertexData::convertPackedColour | ( | VertexElementType | srcType, |
VertexElementType | destType | ||
) |
Convert all packed colour values (VET_COLOUR_*) in buffers used to another type.
srcType | The source colour type to assume if the ambiguous VET_COLOUR is encountered. |
destType | The destination colour type, must be VET_COLOUR_ABGR or VET_COLOUR_ARGB. |
Allocate elements to serve a holder of morph / pose target data for hardware morphing / pose blending.
VertexDeclaration* Ogre::VertexData::vertexDeclaration |
Declaration of the the format of the vertex input.
Note that this is created for you on construction.
VertexBufferBinding* Ogre::VertexData::vertexBufferBinding |
Defines which vertex buffers are bound to which sources.
Note that this is created for you on construction.
bool Ogre::VertexData::mDeleteDclBinding |
Whether this class should delete the declaration and binding.
size_t Ogre::VertexData::vertexStart |
The position in the bound buffers to start reading vertex data from. This allows you to use a single buffer for many different renderables.
size_t Ogre::VertexData::vertexCount |
The number of vertices to process in this particular rendering group.
HardwareAnimationDataList Ogre::VertexData::hwAnimationDataList |
VertexElements used for hardware morph / pose animation.
size_t Ogre::VertexData::hwAnimDataItemsUsed |
Number of hardware animation data items used.
HardwareVertexBufferSharedPtr Ogre::VertexData::hardwareShadowVolWBuffer |
Additional shadow volume vertex buffer storage.