Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
MeshMaterial Class Reference

MeshMaterial: a mesh material for MeshRenderers. More...

#include <MeshMaterial.h>

Inherits Material.

Public Types

enum class  MaterialType
 Material types, there are mainly two types of materials. More...
 
enum class  InstanceMaterialType
 Instanced Material types, there are mainly two types of materials. More...
 

Public Member Functions

MaterialType getMaterialType () const
 Get material type.
 
virtual Materialclone () const override
 Clone this material.
 
- Public Member Functions inherited from Material
std::string getName () const
 returns the material name
 
void setName (std::string_view name)
 sets the material name
 
TechniquegetTechniqueByName (std::string_view name)
 Returns a Technique by its name.
 
TechniquegetTechniqueByIndex (ssize_t index)
 Returns a Technique by index.
 
TechniquegetTechnique () const
 Returns the Technique used by the Material.
 
const Vector< Technique * > & getTechniques () const
 Returns the list of Techniques.
 
ssize_t getTechniqueCount () const
 Returns the number of Techniques in the Material.
 
void addTechnique (Technique *technique)
 Adds a Technique into the Material.
 
void setTechnique (std::string_view techniqueName)
 Sets the current technique.
 
void setPrimitiveType (ax::backend::PrimitiveType primitive)
 Set material primitive draw type.
 
ax::backend::PrimitiveType getPrimitiveType () const
 Get material primitive draw type.
 
void setTransparent (bool value)
 Enable material transparent rendering.
 
bool isTransparent () const
 Is material transparent?
 
void setForce2DQueue (bool value)
 Enable material 2D queue rendering.
 
bool isForce2DQueue () const
 Is material in 2D render queue?
 
- Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
 
void release ()
 Releases the ownership immediately.
 
Objectautorelease ()
 Releases the ownership sometime soon automatically.
 
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
 
virtual ~Object ()
 Destructor.
 

Static Public Member Functions

static MeshMaterialcreateBuiltInMaterial (MaterialType type, bool skinned)
 Create built in material from material type.
 
static MeshMaterialcreateWithFilename (std::string_view path)
 Create material with file name, it creates material from cache if it is previously loaded.
 
static MeshMaterialcreateWithProgramState (backend::ProgramState *programState)
 Create material with a ProgramState.
 
static void createBuiltInMaterial ()
 Create all built-in materials.
 
static void releaseBuiltInMaterial ()
 Release all built-in materials.
 
static void releaseCachedMaterial ()
 Release all cached materials.
 
- Static Public Member Functions inherited from Material
static MaterialcreateWithFilename (std::string_view path)
 Creates a Material using the data from the Properties object defined at the specified URL, where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>" (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional).
 
static MaterialcreateWithProgramState (backend::ProgramState *programState)
 Creates a Material with a GLProgramState.
 
static MaterialcreateWithProperties (Properties *materialProperties)
 Creates a material from the specified properties object.
 

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 

Detailed Description

MeshMaterial: a mesh material for MeshRenderers.

Member Enumeration Documentation

◆ MaterialType

enum class MaterialType
strong

Material types, there are mainly two types of materials.

Built-in materials and Custom materials.

◆ InstanceMaterialType

enum class InstanceMaterialType
strong

Instanced Material types, there are mainly two types of materials.

Built-in materials and Custom materials.

Member Function Documentation

◆ getMaterialType()

MaterialType getMaterialType ( ) const
inline

Get material type.

Returns
Material type

◆ createBuiltInMaterial()

static MeshMaterial * createBuiltInMaterial ( MaterialType type,
bool skinned )
static

Create built in material from material type.

Parameters
typeMaterial type
skinnedHas hardware skinning?
Returns
An autorelease material object

◆ createWithFilename()

static MeshMaterial * createWithFilename ( std::string_view path)
static

Create material with file name, it creates material from cache if it is previously loaded.

Parameters
pathPath of material file
Returns
An autorelease material object

◆ createWithProgramState()

static MeshMaterial * createWithProgramState ( backend::ProgramState * programState)
static

Create material with a ProgramState.

Parameters
programStateGLProgramState instance
Returns
An autorelease material object

The documentation for this class was generated from the following file: