MIndexBufferDescriptor describes an indexing scheme.
More...
#include <MHWGeometry.h>
MIndexBufferDescriptor describes an indexing scheme.
This class represents a description of an indexing scheme. It provides the indexing type (including custom named types), primitive type, primitive stride (for use with patch primitives), and component information.
- Examples:
- cgFx/cgfxShaderNode.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderOverride.cpp, geometryReplicator/geometryReplicator.cpp, glslShader/GLSLShaderOverride.cpp, gpuCache/CacheWriter.cpp, and hwPhongShader/hwPhongShader.cpp.
Constructor with arguments.
- Parameters
-
[in] | type | The indexing type describing what the buffer is used for. |
[in] | name | Used to describe the type when the type argument is kCustom. |
[in] | primitive | A description of the input layout for each drawable. |
[in] | primitiveStride | The number of control points per patch when the primitive type is kPatch. |
[in] | component | The components to use when building the index buffer. If this is MObject::kNullObj the index buffer represents the whole object. |
[in] | dataType | The data type the buffer will hold. |
Get the name used to describe the type when the type() returns kCustom.
- Returns
- The name to use as the custom type.
Set the name used to describe the type when the type() is set to kCustom.
- Parameters
-
[in] | val | The name to use as the custom type. |
MIndexBufferDescriptor::IndexType indexType |
( |
| ) |
const |
Get the indexing type describing what the buffer is used for.
- Returns
- The indexing type describing what the buffer is used for.
void setIndexType |
( |
MIndexBufferDescriptor::IndexType |
val | ) |
|
Set the indexing type describing what the buffer is used for.
- Parameters
-
[in] | val | The indexing type describing what the buffer is used for. |
Get the primitive describing the input layout for each drawable.
- Returns
- The primitive describing the input layout for each drawable.
Set the primitive describing the input layout for each drawable.
- Parameters
-
[in] | val | The primitive describing the input layout for each drawable. |
unsigned int primitiveStride |
( |
| ) |
const |
Get the number of points per primitive.
- Returns
- The stride of the primitive;
void setPrimitiveStride |
( |
unsigned int |
stride | ) |
|
Set the number of control points used for patch primitives.
Setting this value is only meaningful when primitive() is set to kPatch.
- Parameters
-
[in] | stride | The stride of the patch primitive; |
Get the components associated with the index buffer.
Note that only one type of component (edge, face, etc) can be associated with a given index buffer.
if ( component.hasFn(MFn::kSingleIndexedComponent) ) { MFnSingleIndexedComponent fnVtxComp( component ); int len = fnVtxComp.elementCount(); for ( int i = 0; i < len; i++ ) { int idx = fnVtxComp.element(i); } }
- Returns
- The component. If this returns MObject::kNullObj the index buffer represents the whole object.
void setComponent |
( |
MObject |
component | ) |
|
Set the components to use when building the index buffer.
- Parameters
-
[in] | component | The component. If this is MObject::kNullObj the index buffer represents the whole object. |
Get the type of data expected to be in the index buffer.
- Returns
- The type of data the buffer is to contain.
Set the type of data expected to be in the index buffer.
- Parameters
-
[in] | dataType | The type of data to fill the buffer with. |
The documentation for this class was generated from the following files:
- MHWGeometry.h
- MHWGeometry.cpp