DigitalSpaces::DIOGREVertexData Struct Reference
[Ogre]

#include <OGREInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.


Detailed Description

Todo:
Need to flesh this out, because the physics implementation will need it

Public Member Functions

DIOGREVertexDeclarationGetVertexDeclaration ()
 Declaration of the vertex to be used in this operation.
DIOGREVertexBufferBindingGetVertexBufferBinding ()
 The vertex buffer bindings to be used.
unsigned long GetVertexStart ()
 The base vertex index to start from.
unsigned long GetVertexCount ()
 The number of vertices used in this operation.
void PrepareForShadowVolume (void)
 Modifies the vertex data to be suitable for use for rendering shadow geometry.
DIOGREHardwareVertexBufferGetHardwareShadowVolWBuffer ()
 Additional shadow volume vertex buffer storage.
void ReorganiseBuffers (DIOGREVertexDeclaration *newDeclaration)
 Reorganises the data in the vertex buffers according to the new vertex declaration passed in.

Member Function Documentation

DIOGREVertexDeclaration* DigitalSpaces::DIOGREVertexData::GetVertexDeclaration (  ) 

Declaration of the vertex to be used in this operation.

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

DIOGREVertexBufferBinding* DigitalSpaces::DIOGREVertexData::GetVertexBufferBinding (  ) 

The vertex buffer bindings to be used.

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

unsigned long DigitalSpaces::DIOGREVertexData::GetVertexStart (  ) 

The base vertex index to start from.

unsigned long DigitalSpaces::DIOGREVertexData::GetVertexCount (  ) 

The number of vertices used in this operation.

void DigitalSpaces::DIOGREVertexData::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.

DIOGREHardwareVertexBuffer* DigitalSpaces::DIOGREVertexData::GetHardwareShadowVolWBuffer (  ) 

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.

void DigitalSpaces::DIOGREVertexData::ReorganiseBuffers ( DIOGREVertexDeclaration 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.

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


The documentation for this struct was generated from the following file:

Generated on Sun Aug 31 17:46:32 2008 for Digital Spaces by  doxygen 1.5.6