#include <MGeometryExtractor.h>
class for extracting renderable geometry
Construct an instance of this class to populate buffers with vertex and indexing data. Buffers are filled based on the supplied requirements. Use the MIndexBufferDescriptor and MVertexBufferDescriptor classes to request a broad range of data types, formats, and content.
Buffers are filled in-place so you should request the primitive count and vertex count before filling the buffers. Use the count multiplied by the element stride to construct data buffers large enough to fill properly prior to calling one of the populate methods.
Public Member Functions | |
~MGeometryExtractor () | |
Destructor. | |
unsigned int | primitiveCount (const MHWRender::MIndexBufferDescriptor &indexDesc) const |
Returns the number of primitives (triangles, lines, points, etc.) that will be produced for the given indexing requirements. More... | |
MStatus | populateIndexBuffer (void *data, const unsigned int primitiveCount, const MHWRender::MIndexBufferDescriptor &indexDesc) const |
Fill a buffer with geometry indexing data. More... | |
unsigned int | vertexCount () const |
Returns the number of vertices that will be produced for the vertex requirement. More... | |
MStatus | populateVertexBuffer (void *data, const unsigned int vertexCount, const MHWRender::MVertexBufferDescriptor &bufferDesc) const |
Fill a buffer with vertex data. More... | |
MGeometryExtractor (const MHWRender::MGeometryRequirements &requirements, const MDagPath &path, const bool sharing=true, MStatus *status=NULL) | |
This method is obsolete. More... | |
Static Public Member Functions | |
static unsigned int | minimumBufferSize (unsigned int primitiveCount, MGeometry::Primitive primitive, unsigned int primitiveStride=0) |
Get the minimum buffer size required by populateIndexBuffer(). More... | |
MGeometryExtractor | ( | const MHWRender::MGeometryRequirements & | requirements, |
const MDagPath & | path, | ||
const bool | sharing = true , |
||
MStatus * | status = NULL |
||
) |
This method is obsolete.
[From Maya 2019]
[in] | requirements | |
[in] | path | |
[in] | sharing | |
[out] | status | Status code. |
unsigned int primitiveCount | ( | const MHWRender::MIndexBufferDescriptor & | indexDesc | ) | const |
Returns the number of primitives (triangles, lines, points, etc.) that will be produced for the given indexing requirements.
Call this method before calling populateIndexBuffer to determine the minimum size the buffer passed into populateIndexBuffer needs to be.
[in] | indexDesc | The description of the index buffer you request the count for. |
MStatus populateIndexBuffer | ( | void * | data, |
const unsigned int | primitiveCount, | ||
const MHWRender::MIndexBufferDescriptor & | indexDesc | ||
) | const |
Fill a buffer with geometry indexing data.
This method will use the information provided in the MIndexBufferDescriptor argument to populate the buffer with the desired indexing data. The descriptor will describe the surface index type, the primitive type, and the data type. The populateIndexBuffer method will generate a buffer that matches the request. The length of the buffer should be at least the as big as the value returned by minimumBufferSize().
[in] | data | The buffer you want filled. |
[in] | primitiveCount | The number of primitives you expect to be filled in the buffer. |
[in] | indexDesc | The description of the buffer you are requesting. |
unsigned int vertexCount | ( | ) | const |
Returns the number of vertices that will be produced for the vertex requirement.
Call this method before calling populateVertexBuffer to determine the minimum size the buffer passed into populateVertexBuffer needs to be.
MStatus populateVertexBuffer | ( | void * | data, |
const unsigned int | vertexCount, | ||
const MHWRender::MVertexBufferDescriptor & | bufferDesc | ||
) | const |
Fill a buffer with vertex data.
This method will use the information provided in the MVertexBufferDescriptor argument to populate the buffer with the desired vertex data. The descriptor will describe the buffer's name, semantic, and data type. The populateVertexBuffer method will supply a buffer that matches the request. The length of the buffer should be at least (vertexCount * bufferDesc.stride()).
values for normals, tangents and bitangents are all normalized.
[in] | data | The buffer you want filled. |
[in] | vertexCount | The vertex count you expect to be filled in the buffer. |
[in] | bufferDesc | The description of the buffer you are requesting. |
|
static |
Get the minimum buffer size required by populateIndexBuffer().
[in] | primitiveCount | The number of primitives. |
[in] | primitive | The primitive type |
[in] | primitiveStride | The number of control points in a patch when the type is kPatch. |