OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
Ogre currently does not support deinterleaved vertex buffers. More...
#include <OgreVertexBufferDownloadHelper.h>
Classes | |
struct | DownloadData |
Public Member Functions | |
const DownloadDataArray & | getDownloadData () const |
void | map (uint8 const **outDataPtrs) |
Maps the buffers that have been downloaded with queueDownload. More... | |
void | queueDownload (const VertexArrayObject *vao, const VertexElementSemanticFullArray &semanticsToDownload, size_t elementStart=0, size_t elementCount=0) |
Creates AsyncTickets to download GPU -> CPU the requested VertexElementSemantics from one or multiple vertex buffers in a Vao. More... | |
void | unmap () |
Static Public Member Functions | |
static Vector3 | getNormal (uint8 const *srcData, VertexElement2 vertexElement) |
static Vector4 | getVector4 (uint8 const *srcData, VertexElement2 vertexElement) |
Ogre currently does not support deinterleaved vertex buffers.
However it may in the future. Retrieving vertex data out of one or multiple buffers can be tricky.
This class helps with that issue.
|
inline |
|
inlinestatic |
References Ogre::v1::VertexElement::getBaseType(), Ogre::v1::VertexElement::getTypeSize(), Ogre::VertexElement2::mType, Ogre::Bitwise::snorm16ToFloat(), Ogre::VET_HALF2, Ogre::VET_SHORT4_SNORM, Ogre::Quaternion::w, Ogre::Quaternion::x, Ogre::Quaternion::xAxis(), Ogre::Quaternion::y, and Ogre::Quaternion::z.
|
inlinestatic |
void Ogre::VertexBufferDownloadHelper::map | ( | uint8 const ** | outDataPtrs | ) |
Maps the buffers that have been downloaded with queueDownload.
and outputs the pointers in outDataPtrs.
outDataPtrs | The vertex data that was requested. outDataPtrs must have enough size, which is the number of semantics that was requested to queueDownload (i.e. semanticsToDownload.size()) |
None, some, or all elements in outDataPtrs[i] may alias each other, e.g. outDataPtrs[0] == outDataPtrs[1] is possible, and that just means that both vertex elements are present interleaved the same vertex buffer.
If outDataPtrs[i] is a nullptr that means the semantic was not found in the Vao.
void Ogre::VertexBufferDownloadHelper::queueDownload | ( | const VertexArrayObject * | vao, |
const VertexElementSemanticFullArray & | semanticsToDownload, | ||
size_t | elementStart = 0 , |
||
size_t | elementCount = 0 |
||
) |
Creates AsyncTickets to download GPU -> CPU the requested VertexElementSemantics from one or multiple vertex buffers in a Vao.
vao | Vao to download from |
semanticsToDownload | Semantics from the Vao to download |
elementStart | Offset to start, in the vertex buffer. |
elementCount | Number of vertices to download. When 0, we download all that remains. |
void Ogre::VertexBufferDownloadHelper::unmap | ( | ) |