IMaterialManager

IMaterialManager interface provide access to the material manager implemented in 3DEngine. More...

#include

Public Types

enum ELoadingFlags { ELoadingFlagsPreviewMode = BIT(0) }
Loading flags.

Public Member Functions

virtual void GetMemoryUsage (ICrySizer *pSizer) const =0
virtual IMaterial * CreateMaterial (const char *sMtlName, int nMtlFlags=0)=0
virtual void RenameMaterial (IMaterial *pMtl, const char *sNewName)=0
virtual IMaterial * FindMaterial (const char *sMtlName) const =0
Finds named material.
virtual IMaterial * LoadMaterial (const char *sMtlName, bool bMakeIfNotFound=true, bool bNonremovable=false, unsigned long nLoadingFlags=0)=0
virtual IMaterial * LoadMaterialFromXml (const char *sMtlName, XmlNodeRef mtlNode)=0
Loads material from xml.
virtual IMaterial * CloneMaterial (IMaterial *pMtl, int nSubMtl=-1)=0
virtual void CopyMaterial (IMaterial *pMtlSrc, IMaterial *pMtlDest, EMaterialCopyFlags flags)=0
Copy single material.
virtual IMaterial * CloneMultiMaterial (IMaterial *pMtl, const char *sSubMtlName=0)=0
virtual void SetListener (IMaterialManagerListener *pListener)=0
virtual IMaterial * GetDefaultMaterial ()=0
Retrieve a default engine material.
virtual IMaterial * GetDefaultTerrainLayerMaterial ()=0
Retrieve a default engine material for terrain layer.
virtual IMaterial * GetDefaultLayersMaterial ()=0
Retrieve a default engine material with material layers presets.
virtual IMaterial * GetDefaultHelperMaterial ()=0
Retrieve a default engine material for drawing helpers.
virtual ISurfaceType * GetSurfaceTypeByName (const char *sSurfaceTypeName, const char *sWhy=NULL)=0
Retrieve surface type by name.
virtual int GetSurfaceTypeIdByName (const char *sSurfaceTypeName, const char *sWhy=NULL)=0
virtual ISurfaceType * GetSurfaceType (int nSurfaceTypeId, const char *sWhy=NULL)=0
Retrieve surface type by unique surface type id.
virtual ISurfaceTypeManager * GetSurfaceTypeManager ()=0
Retrieve interface to surface type manager.
virtual IMaterial * LoadCGFMaterial (const char *szMaterialName, const char *szCgfFilename, unsigned long nLoadingFlags=0)=0
virtual void GetLoadedMaterials (IMaterial **pData, uint32 &nObjCount) const =0
For statistics - call once to get the count (pData==0), again to get the data(pData!=0).
virtual void SetAltMaterialSuffix (const char *pSuffix)=0
virtual void RefreshMaterialRuntime ()=0
Updates material data in the renderer.

Detailed Description

IMaterialManager interface provide access to the material manager implemented in 3DEngine.

Member Function Documentation

◆ CloneMaterial()

virtual IMaterial* IMaterialManager::CloneMaterial ( IMaterial * pMtl,
int nSubMtl = -1
)
pure virtual

Clone single material or multi sub material.

Parameters
nSubMtlWhen negative all sub materials of MultiSubMtl are cloned, if positive only specified slot is cloned.

◆ CloneMultiMaterial()

virtual IMaterial* IMaterialManager::CloneMultiMaterial ( IMaterial * pMtl,
const char * sSubMtlName = 0
)
pure virtual

Clone MultiSubMtl material.

Parameters
sSubMtlNameName of the sub-material to clone, if NULL all submaterial are cloned.

◆ CreateMaterial()

virtual IMaterial* IMaterialManager::CreateMaterial ( const char * sMtlName,
int nMtlFlags = 0
)
pure virtual

Creates a new material object and register it with the material manager

Returns
Newly created object derived from IMaterial.

◆ LoadCGFMaterial()

virtual IMaterial* IMaterialManager::LoadCGFMaterial ( const char * szMaterialName,
const char * szCgfFilename,
unsigned long nLoadingFlags = 0
)
pure virtual

Get IMaterial pointer for a material referenced by a .cgf file.

Parameters
nLoadingFlagsZero, or a bitwise combination of the enum items from ELoadingFlags.

◆ LoadMaterial()

virtual IMaterial* IMaterialManager::LoadMaterial ( const char * sMtlName,
bool bMakeIfNotFound = true,
bool bNonremovable = false,
unsigned long nLoadingFlags = 0
)
pure virtual

Loads material.

Parameters
nLoadingFlagsZero or a bitwise combination of the values defined in ELoadingFlags.

◆ RenameMaterial()

virtual void IMaterialManager::RenameMaterial ( IMaterial * pMtl,
const char * sNewName
)
pure virtual

Rename a material object.

Note
Do not use IMaterial::SetName directly.
Parameters
pMtlPointer to a material object.
sNewNameNew name to assign to the material.

◆ SetAltMaterialSuffix()

virtual void IMaterialManager::SetAltMaterialSuffix ( const char * pSuffix)
pure virtual

Sets a suffix that will be appended onto every requested material to try and find an alternative version.

Parameters
pSuffixSet this to null to stop returning alternates.

◆ SetListener()

virtual void IMaterialManager::SetListener ( IMaterialManagerListener * pListener)
pure virtual

Associate a special listener callback with material manager inside 3DEngine. This listener callback is used primerly by the editor.