This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Materials Class

Unigine materials. This interface provides access to Unigine material manager functions.

To use this class, include the UnigineMaterials.h file.

Unigine::Materials Class

Members


virtual ~Materials ()

Virtual destructor.

static Materials * get ()

Return a pointer to the existing material manager.

Return value

Pointer to the existing material manager.

virtual int create (const char * name) const =0

Creates an empty material library.

Arguments

  • const char * name - Material library name.

Return value

1 if the material library is created successfully; otherwise, 0.

virtual int load (const char * name) const =0

Loads the material library from the file.

Arguments

  • const char * name - Material library name.

Return value

1 if the material library is loaded successfully; otherwise, 0.

virtual int save (const char * name) const =0

Saves the material library into the file.

Arguments

  • const char * name - Material library name.

Return value

1 if the material library is saved successfully; otherwise, 0.

virtual int clear (const char * name) const =0

Clears the material library by its name.

Arguments

  • const char * name - Material library name.

Return value

1 if the material library is cleared successfully; otherwise, 0.

virtual int getNumLibraries () const =0

Returns the number of loaded material libraries.

Return value

The number of loaded material libraries.

virtual const char * getLibraryName (int num) const =0

Returns the material library name.

Arguments

  • int num - Material library number.

Return value

The name of material library.

virtual int isLibraryEditable (int num) const =0

Returns the material library editable flag.

Arguments

  • int num - Material library number.

Return value

The editable flag.

virtual int isLibrary (const char * name) const =0

Checks the material library by its name.

Arguments

  • const char * name - Material library name.

Return value

1 if the material library exists; otherwise, 0.

virtual int findLibrary (const char * name) const =0

Finds the material library by its name.

Arguments

  • const char * name - Material library name.

Return value

Material library number.

virtual int getNumMaterials (int library) const =0

Returns the number of library materials.

Arguments

  • int library - Library number.

Return value

The number of library materials.

virtual MaterialPtr getMaterial (int library, int num) const =0

Returns the material.

Arguments

  • int library - Library number.
  • int num - Material number.

Return value

Material smart pointer.

virtual const char * getMaterialName (int library, int num) const =0

Returns the material name.

Arguments

  • int library - Library number.
  • int num - Material number.

Return value

The name of material.

virtual int isMaterial (const char * name) const =0

Checks the material by its name.

Arguments

  • const char * name - Material name.

Return value

1 if the material exists; otherwise, 0.

virtual MaterialPtr findMaterial (const char * name) const =0

Finds the material by its name.

Arguments

  • const char * name - Material name.

Return value

Material smart pointer.

virtual int findMaterialLibrary (const char * name) const =0

Finds the material library by material name.

Arguments

  • const char * name - Material name.

Return value

Material library number.

virtual int findMaterialLibrary (const MaterialPtr & material) const =0

Finds the material library by material name.

Arguments

  • const MaterialPtr & material - Material smart pointer.

Return value

Material library number.

virtual int findLibraryMaterial (int library, const char * name) const =0

Finds the material in the specified material library.

Arguments

  • int library - Library number.
  • const char * name - Material name.

Return value

Material number.

virtual int findLibraryMaterial (int library, const MaterialPtr & material) const =0

Finds the material in the specified material library.

Arguments

  • int library - Library number.
  • const MaterialPtr & material - Material smart pointer.

Return value

Material number.

virtual int cloneMaterial (const char * name, const char * new_library, const char * new_name) const =0

Clones material into the specified material library.

Arguments

  • const char * name - Material name.
  • const char * new_library - New material library name.
  • const char * new_name - New material name.

Return value

1 if the material is cloned successfully; otherwise, 0.

virtual int inheritMaterial (const char * name, const char * new_library, const char * new_name) const =0

Inherits material into the specified material library.

Arguments

  • const char * name - Material name.
  • const char * new_library - New material library name.
  • const char * new_name - New material name.

Return value

1 if the material is inherited successfully; otherwise, 0.

virtual int moveMaterial (const char * name, const char * new_library, const char * new_name) const =0

Moves material into the specified material library.

Arguments

  • const char * name - Material name.
  • const char * new_library - New material library name.
  • const char * new_name - New material name.

Return value

1 if the material is moved successfully; otherwise, 0.

virtual int removeMaterial (const char * name) const =0

Removes material by its name.

Arguments

  • const char * name - Material name.

Return value

1 if the material is removed successfully; otherwise, 0.

virtual int replaceMaterial (const char * name, const char * new_name) const =0

Replaces material with a new one.

Arguments

  • const char * name - Name of the material to be replaced.
  • const char * new_name - Name of the new material.

Return value

1 if the material is replaced successfully; otherwise, 0.

virtual int replaceMaterial (const MaterialPtr & material, const char * new_name) const =0

Replaces material with a new one.

Arguments

  • const MaterialPtr & material - Smart pointer to the material to be replaced.
  • const char * new_name - Name of the new material.

Return value

1 if the material is replaced successfully; otherwise, 0.
Last update: 2017-07-03
Build: ()