C4 Engine
C4 Engine API Documentation

Geometry::GetMaterialObject

Defined in:  C4Geometries.h
Returns a material object.
Prototype

MaterialObject *GetMaterialObject(int32 index) const;

Parameters
index The index of the material slot from which to retrieve a material object.
Description
The GetMaterialObject function returns one of the material objects assigned to a geometry node. For a geometry having n materials, the index parameter should be an integer between 0 and n − 1. If no material object has been assigned for the specified index, then this function returns nullptr.

The number of material slots can be determined using the Geometry::GetMaterialCount function.
See Also

MaterialObject

Geometry::SetMaterialObject

Geometry::GetMaterialCount

Geometry::SetMaterialCount