Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# Ogre::VertexData Class Reference

Summary class collecting together vertex source information. More...

`#include <OgreVertexIndexData.h>`

List of all members.

## Public Methods

| VertexData ()
| ~VertexData ()
VertexData * | clone (bool copyData=true) const
| Clones this vertex data, potentially including replicating any vertex buffers.
void | prepareForShadowVolume (void)
| Modifies the vertex data to be suitable for use for rendering shadow geometry.
void | reorganiseBuffers (VertexDeclaration *newDeclaration, BufferUsageList bufferUsage)
| Reorganises the data in the vertex buffers according to the new vertex declaration passed in.
void | reorganiseBuffers (VertexDeclaration *newDeclaration)
| Reorganises the data in the vertex buffers according to the new vertex declaration passed in.

## Public Attributes

VertexDeclaration * | vertexDeclaration
| Declaration of the vertex to be used in this operation.
VertexBufferBinding * | vertexBufferBinding
| The vertex buffer bindings to be used.
size_t | vertexStart
| The base vertex index to start from, if using unindexed geometry.
size_t | vertexCount
| The number of vertices used in this operation.
HardwareVertexBufferSharedPtr | hardwareShadowVolWBuffer
| Additional shadow volume vertex buffer storage.

## Private Methods

| VertexData (const VertexData &rhs)
| Protected copy constructor, to prevent misuse.
VertexData & | operator= (const VertexData &rhs)
| Protected operator=, to prevent misuse.

## Detailed Description

Summary class collecting together vertex source information.

Definition at line 39 of file OgreVertexIndexData.h.

## Constructor & Destructor Documentation

Ogre::VertexData::VertexData | ( | const VertexData & | rhs | ) | `[private]`

| Protected copy constructor, to prevent misuse. Definition at line 43 of file OgreVertexIndexData.h.

Ogre::VertexData::VertexData | ( |  | ) |

| Definition at line 39 of file OgreVertexIndexData.cpp. References vertexBufferBinding, vertexCount, vertexDeclaration, and vertexStart. Referenced by clone().

Ogre::VertexData::~VertexData | ( |  | ) |

| Definition at line 50 of file OgreVertexIndexData.cpp. References vertexBufferBinding, and vertexDeclaration.

## Member Function Documentation

VertexData * Ogre::VertexData::clone | ( | bool | copyData = true | ) | const

Clones this vertex data, potentially including replicating any vertex buffers.

Remarks:
  The caller is expected to delete the returned pointer when ready

Definition at line 58 of file OgreVertexIndexData.cpp.

References Ogre::VertexDeclaration::addElement(), Ogre::VertexBufferBinding::getBindings(), Ogre::VertexDeclaration::getElements(), Ogre::VertexBufferBinding::setBinding(), vertexBufferBinding, vertexCount, VertexData(), vertexDeclaration, and vertexStart.

Referenced by Ogre::Mesh::clone(), and Ogre::Entity::cloneVertexDataRemoveBlendInfo().

VertexData& Ogre::VertexData::operator= | ( | const VertexData & | rhs | ) | `[private]`

| Protected operator=, to prevent misuse. Definition at line 45 of file OgreVertexIndexData.h.

void Ogre::VertexData::prepareForShadowVolume | ( | void |  | ) |

Modifies the vertex data to be suitable for use for rendering shadow geometry.

Remarks:
  Preparing vertex data to generate a shadow volume involves firstly ensuring that the vertex buffer containing the positions is a standalone vertex buffer, with no other components in it. This method will therefore break apart any existing vertex buffers if position is sharing a vertex buffer. Secondly, it will double the size of this vertex buffer so that there are 2 copies of the position data for the mesh. The first half is used for the original, and the second half is used for the 'extruded' version. The vertex count used to render will remain the same though, so as not to add any overhead to regular rendering of the object. Both copies of the position are required in one buffer because shadow volumes stretch from the original mesh to the extruded version.

  It's important to appreciate that this method can fundamentally change the structure of your vertex buffers, although in reality they will be new buffers. As it happens, if other objects are using the original buffers then they will be unaffected because the reference counting will keep them intact. However, if you have made any assumptions about the structure of the vertex data in the buffers of this object, you may have to rethink them.

Definition at line 114 of file OgreVertexIndexData.cpp.

References Ogre::VertexElement::baseVertexPointerToElement(), Ogre::VertexDeclaration::findElementBySemantic(), Ogre::VertexBufferBinding::getBuffer(), Ogre::RenderSystem::getCapabilities(), Ogre::VertexDeclaration::getElements(), Ogre::VertexBufferBinding::getNextIndex(), Ogre::VertexElement::getOffset(), Ogre::VertexElement::getSize(), Ogre::VertexElement::getSource(), hardwareShadowVolWBuffer, Ogre::RenderSystemCapabilities::hasCapability(), Ogre::VertexDeclaration::modifyElement(), Ogre::Real, Ogre::RSC_VERTEX_PROGRAM, Ogre::VertexBufferBinding::setBinding(), vertexBufferBinding, vertexDeclaration, Ogre::VES_POSITION, and Ogre::VET_FLOAT3.

Referenced by Ogre::Mesh::prepareForShadowVolume().

void Ogre::VertexData::reorganiseBuffers | ( | VertexDeclaration * | newDeclaration | ) |

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.

Parameters:

  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.

Definition at line 434 of file OgreVertexIndexData.cpp.

References Ogre::BufferUsageList, Ogre::VertexDeclaration::findElementBySemantic(), Ogre::VertexDeclaration::findElementsBySource(), Ogre::VertexBufferBinding::getBuffer(), Ogre::VertexElement::getIndex(), Ogre::VertexDeclaration::getMaxSource(), Ogre::VertexElement::getSemantic(), reorganiseBuffers(), vertexBufferBinding, and vertexDeclaration.

void Ogre::VertexData::reorganiseBuffers | ( | VertexDeclaration * | newDeclaration,
|  | BufferUsageList | bufferUsage
| ) |

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.

Parameters:

  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.
  bufferUsages | 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.

Definition at line 307 of file OgreVertexIndexData.cpp.

References Ogre::VertexElement::baseVertexPointerToElement(), Ogre::BufferUsageList, Ogre::VertexDeclaration::closeGapsInSource(), Except, Ogre::VertexDeclaration::findElementBySemantic(), Ogre::VertexDeclaration::findElementsBySource(), Ogre::VertexBufferBinding::getBuffer(), Ogre::VertexDeclaration::getElements(), Ogre::VertexElement::getSize(), Ogre::VertexElement::getSource(), Ogre::VertexDeclaration::getVertexSize(), Ogre::VertexBufferBinding::setBinding(), vertexBufferBinding, vertexCount, and vertexDeclaration.

Referenced by reorganiseBuffers().

## Member Data Documentation

HardwareVertexBufferSharedPtr Ogre::VertexData::hardwareShadowVolWBuffer

Additional shadow volume vertex buffer storage.

Remarks:
  This additional buffer is only used where we have prepared this VertexData for use in shadow volume contruction, and where the current render system supports vertex programs. This buffer contains the 'w' vertex position component which will be used by that program to differentiate between extruded and non-extruded vertices. This 'w' component cannot be included in the original position buffer because DirectX does not allow 4-component positions in the fixed-function pipeline, and the original position buffer must still be usable for fixed-function rendering.

  Note that we don't store any vertex declaration or vertex buffer binding here becuase this can be reused in the shadow algorithm.

Definition at line 102 of file OgreVertexIndexData.h.

Referenced by Ogre::Entity::cloneVertexDataRemoveBlendInfo(), Ogre::Entity::EntityShadowRenderable::EntityShadowRenderable(), and prepareForShadowVolume().

VertexBufferBinding* Ogre::VertexData::vertexBufferBinding

The vertex buffer bindings to be used.

Remarks:
  Note that this is created for you on construction.

Definition at line 57 of file OgreVertexIndexData.h.

Referenced by Ogre::TerrainRenderable::_calculateNormals(), Ogre::BillboardSet::_createBuffers(), Ogre::TerrainRenderable::_generateVertexLighting(), Ogre::TerrainRenderable::_notifyCurrentCamera(), Ogre::BillboardSet::_notifyCurrentCamera(), Ogre::GLRenderSystem::_render(), Ogre::D3D9RenderSystem::_render(), Ogre::D3DRenderSystem::_render(), Ogre::ProgressiveMesh::addWorkingData(), Ogre::TempBlendedBufferInfo::bindTempCopies(), Ogre::BspLevel::buildQuake3Patches(), Ogre::Mesh::buildTangentVectors(), Ogre::EdgeListBuilder::buildTrianglesEdges(), Ogre::TTYGuiElement::checkMemoryAllocation(), Ogre::TextAreaGuiElement::checkMemoryAllocation(), clone(), Ogre::Entity::cloneVertexDataRemoveBlendInfo(), Ogre::Mesh::compileBoneAssignments(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::MeshManager::createPrefabPlane(), Ogre::Entity::EntityShadowRenderable::EntityShadowRenderable(), Ogre::Entity::extractTempBufferInfo(), Ogre::Frustum::Frustum(), Ogre::BorderPanelGuiElement::getCellUVString(), Ogre::TerrainRenderable::initialise(), Ogre::PanelGuiElement::initialise(), Ogre::BorderPanelGuiElement::initialise(), Ogre::PatchMesh::load(), Ogre::BspLevel::loadQuake3Level(), Ogre::EdgeListBuilder::log(), Ogre::Mesh::organiseTangentsBuffer(), prepareForShadowVolume(), Ogre::MeshSerializerImpl_v1_2::readGeometryColours(), Ogre::MeshSerializerImpl_v1_2::readGeometryNormals(), Ogre::MeshSerializerImpl_v1_2::readGeometryPositions(), Ogre::MeshSerializerImpl_v1_1::readGeometryTexCoords(), Ogre::MeshSerializerImpl_v1_2::readGeometryTexCoords(), Ogre::MeshSerializerImpl::readGeometryVertexBuffer(), Ogre::Entity::EntityShadowRenderable::rebindPositionBuffer(), Ogre::Rectangle2D::Rectangle2D(), reorganiseBuffers(), Ogre::BorderPanelGuiElement::setCellUV(), Ogre::Rectangle2D::setCorners(), Ogre::WireBoundingBox::setupBoundingBoxVertices(), Ogre::Mesh::softwareVertexBlend(), Ogre::TextAreaGuiElement::updateColours(), Ogre::Frustum::updateFrustum(), Ogre::TextAreaGuiElement::updateGeometry(), Ogre::PanelGuiElement::updatePositionGeometry(), Ogre::BorderPanelGuiElement::updatePositionGeometry(), Ogre::PanelGuiElement::updateTextureGeometry(), Ogre::TTYGuiElement::updateWindowGeometry(), VertexData(), Ogre::WireBoundingBox::WireBoundingBox(), Ogre::MeshSerializerImpl::writeGeometry(), and ~VertexData().

size_t Ogre::VertexData::vertexCount

The number of vertices used in this operation.

Definition at line 61 of file OgreVertexIndexData.h.

Referenced by Ogre::SubMesh::_compileBoneAssignments(), Ogre::Mesh::_compileBoneAssignments(), Ogre::BillboardSet::_createBuffers(), Ogre::RenderSystem::_render(), Ogre::GLRenderSystem::_render(), Ogre::D3D9RenderSystem::_render(), Ogre::D3DRenderSystem::_render(), Ogre::ProgressiveMesh::addWorkingData(), Ogre::Mesh::buildTangentVectors(), Ogre::MeshSerializerImpl::calcGeometrySize(), Ogre::MeshSerializerImpl::calcMeshSize(), Ogre::TTYGuiElement::checkAndSetUpdateGeometry(), Ogre::TTYGuiElement::checkMemoryAllocation(), Ogre::TextAreaGuiElement::checkMemoryAllocation(), clone(), Ogre::Mesh::compileBoneAssignments(), Ogre::ProgressiveMesh::computeAllCosts(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::MeshManager::createPrefabPlane(), Ogre::Entity::EntityShadowRenderable::EntityShadowRenderable(), Ogre::Frustum::Frustum(), Ogre::ShadowCaster::generateShadowVolume(), Ogre::BillboardSet::getRenderOperation(), Ogre::TerrainRenderable::initialise(), Ogre::PanelGuiElement::initialise(), Ogre::BorderPanelGuiElement::initialise(), Ogre::PatchMesh::load(), Ogre::BspLevel::loadQuake3Level(), Ogre::EdgeListBuilder::log(), Ogre::Mesh::organiseTangentsBuffer(), Ogre::ProgressiveMesh::ProgressiveMesh(), Ogre::MeshSerializerImpl_v1_2::readGeometry(), Ogre::MeshSerializerImpl::readGeometry(), Ogre::MeshSerializerImpl_v1_2::readGeometryColours(), Ogre::MeshSerializerImpl_v1_2::readGeometryNormals(), Ogre::MeshSerializerImpl_v1_2::readGeometryPositions(), Ogre::MeshSerializerImpl_v1_1::readGeometryTexCoords(), Ogre::MeshSerializerImpl_v1_2::readGeometryTexCoords(), Ogre::MeshSerializerImpl::readGeometryVertexBuffer(), Ogre::Rectangle2D::Rectangle2D(), reorganiseBuffers(), Ogre::Mesh::softwareVertexBlend(), Ogre::TextAreaGuiElement::updateGeometry(), Ogre::PanelGuiElement::updateTextureGeometry(), VertexData(), Ogre::WireBoundingBox::WireBoundingBox(), and Ogre::MeshSerializerImpl::writeGeometry().

VertexDeclaration* Ogre::VertexData::vertexDeclaration

Declaration of the vertex to be used in this operation.

Remarks:
  Note that this is created for you on construction.

Definition at line 53 of file OgreVertexIndexData.h.

Referenced by Ogre::TerrainRenderable::_calculateNormals(), Ogre::BillboardSet::_createBuffers(), Ogre::TerrainRenderable::_generateVertexLighting(), Ogre::GLRenderSystem::_render(), Ogre::D3D9RenderSystem::_render(), Ogre::D3DRenderSystem::_render(), Ogre::ProgressiveMesh::addWorkingData(), Ogre::Mesh::buildTangentVectors(), Ogre::EdgeListBuilder::buildTrianglesEdges(), Ogre::MeshSerializerImpl::calcGeometrySize(), Ogre::TTYGuiElement::checkMemoryAllocation(), Ogre::TextAreaGuiElement::checkMemoryAllocation(), clone(), Ogre::Entity::cloneVertexDataRemoveBlendInfo(), Ogre::Mesh::compileBoneAssignments(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::MeshManager::createPrefabPlane(), Ogre::Entity::EntityShadowRenderable::EntityShadowRenderable(), Ogre::Entity::extractTempBufferInfo(), Ogre::Frustum::Frustum(), Ogre::TTYGuiElement::initialise(), Ogre::TextAreaGuiElement::initialise(), Ogre::TerrainRenderable::initialise(), Ogre::PanelGuiElement::initialise(), Ogre::BorderPanelGuiElement::initialise(), Ogre::PatchMesh::load(), Ogre::BspLevel::loadQuake3Level(), Ogre::EdgeListBuilder::log(), Ogre::Mesh::organiseTangentsBuffer(), prepareForShadowVolume(), Ogre::MeshSerializerImpl_v1_2::readGeometryColours(), Ogre::MeshSerializerImpl_v1_2::readGeometryNormals(), Ogre::MeshSerializerImpl_v1_2::readGeometryPositions(), Ogre::MeshSerializerImpl_v1_1::readGeometryTexCoords(), Ogre::MeshSerializerImpl_v1_2::readGeometryTexCoords(), Ogre::MeshSerializerImpl::readGeometryVertexBuffer(), Ogre::MeshSerializerImpl::readGeometryVertexElement(), Ogre::Rectangle2D::Rectangle2D(), reorganiseBuffers(), Ogre::Mesh::softwareVertexBlend(), Ogre::Mesh::suggestTangentVectorBuildParams(), Ogre::PanelGuiElement::updateTextureGeometry(), VertexData(), Ogre::WireBoundingBox::WireBoundingBox(), Ogre::MeshSerializerImpl::writeGeometry(), and ~VertexData().

size_t Ogre::VertexData::vertexStart

The base vertex index to start from, if using unindexed geometry.

Definition at line 59 of file OgreVertexIndexData.h.

Referenced by Ogre::BillboardSet::_createBuffers(), Ogre::GLRenderSystem::_render(), Ogre::D3D9RenderSystem::_render(), Ogre::D3DRenderSystem::_render(), Ogre::TTYGuiElement::checkAndSetUpdateGeometry(), clone(), Ogre::MeshManager::createCurvedPlane(), Ogre::Entity::EntityShadowRenderable::EntityShadowRenderable(), Ogre::Frustum::Frustum(), Ogre::BillboardSet::getRenderOperation(), Ogre::TTYGuiElement::initialise(), Ogre::TextAreaGuiElement::initialise(), Ogre::TerrainRenderable::initialise(), Ogre::PanelGuiElement::initialise(), Ogre::BorderPanelGuiElement::initialise(), Ogre::PatchMesh::load(), Ogre::BspLevel::loadQuake3Level(), Ogre::MeshSerializerImpl_v1_2::readGeometry(), Ogre::MeshSerializerImpl::readGeometry(), Ogre::Rectangle2D::Rectangle2D(), VertexData(), and Ogre::WireBoundingBox::WireBoundingBox().

The documentation for this class was generated from the following files:

- OgreVertexIndexData.h
- OgreVertexIndexData.cpp

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:46 2004