C++ API Reference: MGeometryIndexMapping Class Reference

A mapping of geometry index. More...

#include <MHWGeometry.h>

Public Member Functions

 MGeometryIndexMapping ()
 Constructor.
 
 ~MGeometryIndexMapping ()
 Destructor.
 
int geometryCount () const
 Get the number of geometry described by the mapping. More...
 
MDagPath dagPath (int geometryIdx) const
 Get the MDagPath of a geometry. More...
 
MObject component (int geometryIdx) const
 Get the component of a geometry. More...
 
int indexStart (int geometryIdx) const
 Get the index start of a geometry. More...
 
int indexLength (int geometryIdx) const
 Get the index length of a geometry. More...
 
int vertexStart (int geometryIdx) const
 Get the vertex start of the geometry. More...
 
int vertexLength (int geometryIdx) const
 Get the vertex length of the geometry. More...
 
MRenderItemsourceRenderItem (int geometryIdx) const
 Get the source render item. More...
 
void updateSource (int geometryIdx, int indexStart, int indexLength, int vertexStart, int vertexLength)
 Update an existing entry in an MGeometryIndexMapping. More...
 

Detailed Description

A mapping of geometry index.

This class represents the index mapping of the multiple objects concatenated into a single render item.

When multiple objects are compatible, their geometry can be consolidated into a single render item, to provide better performance by concatening their index and vertex buffers.

The Geometry Index Mapping can be used to get the indexing details of the concatenated geometries to be able to render them separately.

+ Examples:

Member Function Documentation

int geometryCount ( ) const

Get the number of geometry described by the mapping.

Returns
The number of geometry
+ Examples:
MDagPath dagPath ( int  geometryIdx) const

Get the MDagPath of a geometry.

Parameters
[in]geometryIdxThe index the geometry
Returns
The path to the instance of the object's geometry
+ Examples:
MObject component ( int  geometryIdx) const

Get the component of a geometry.

Parameters
[in]geometryIdxThe index the geometry
Returns
The component of the geometry. This will be null if there is no component
+ Examples:
int indexStart ( int  geometryIdx) const

Get the index start of a geometry.

The index start represents the offset of the geometry index data in the index buffer of the consolidated render item

Parameters
[in]geometryIdxThe index the geometry
Returns
The index start of the geometry
+ Examples:
int indexLength ( int  geometryIdx) const

Get the index length of a geometry.

The index length represents the length of the geometry index data in the index buffer of the consolidated render item

Parameters
[in]geometryIdxThe index the geometry
Returns
The index length of the geometry
+ Examples:
int vertexStart ( int  geometryIdx) const

Get the vertex start of the geometry.

The vertex start represents the offset in number of vertices of the geometry vertex data in the vertex buffer of the consolidated render item.

int vertexLength ( int  geometryIdx) const

Get the vertex length of the geometry.

The vertex length represents the length in number of vertices of the geometry vertex data in the vertex buffer of the consolidated render item.

MRenderItem * sourceRenderItem ( int  geometryIdx) const

Get the source render item.

Parameters
[in]geometryIdxThe index of the geometry
Returns
The render item
void updateSource ( int  geometryIdx,
int  indexStart,
int  indexLength,
int  vertexStart,
int  vertexLength 
)

Update an existing entry in an MGeometryIndexMapping.

This change is temporary and does not impact drawing until MRenderItem::setSourceIndexMapping() is called with the updated MGeometryIndexMapping.

Parameters
[in]geometryIdxThe index of the geometry
[in]indexStartThe new index start of the geometry
[in]indexLengthThe new index length of the geometry
[in]vertexStartThe new vertex start of the geometry
[in]vertexLengthThe new vertex length of the geometry

The documentation for this class was generated from the following files:
  • MHWGeometry.h
  • MHWGeometry.cpp