public class MaterialDef
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
MaterialDef()
Serialization only.
|
|
MaterialDef(AssetManager assetManager,
java.lang.String name)
Creates a new material definition with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMaterialParam(VarType type,
java.lang.String name,
java.lang.Object value)
Adds a new material parameter.
|
void |
addMaterialParamTexture(VarType type,
java.lang.String name,
ColorSpace colorSpace,
Texture value)
Adds a new material parameter.
|
void |
addTechniqueDef(TechniqueDef technique)
Adds a new technique definition to this material definition.
|
AssetManager |
getAssetManager()
Returns the AssetManager passed in the constructor.
|
java.lang.String |
getAssetName()
Returns the asset key name of the asset from which this material
definition was loaded.
|
MatParam |
getMaterialParam(java.lang.String name)
Returns the material parameter with the given name.
|
java.util.Collection<MatParam> |
getMaterialParams()
Returns a collection of all material parameters declared in this
material definition.
|
java.lang.String |
getName()
The debug name of the material definition.
|
java.util.List<TechniqueDef> |
getTechniqueDefs(java.lang.String name)
Returns technique definitions with the given name.
|
java.util.Collection<java.lang.String> |
getTechniqueDefsNames() |
void |
setAssetName(java.lang.String assetName)
Set the asset key name.
|
protected MaterialDef()
public MaterialDef(AssetManager assetManager, java.lang.String name)
assetManager - The asset manager to use to load shadersname - The debug name of the material definitionpublic java.lang.String getAssetName()
public void setAssetName(java.lang.String assetName)
assetName - the asset key namepublic AssetManager getAssetManager()
public java.lang.String getName()
public void addMaterialParam(VarType type, java.lang.String name, java.lang.Object value)
type - Type of the parametername - Name of the parametervalue - Default value of the parameterpublic void addMaterialParamTexture(VarType type, java.lang.String name, ColorSpace colorSpace, Texture value)
type - Type of the parametername - Name of the parametercolorSpace - the color space of the texture required by this texture paramvalue - Default value of the parameterColorSpacepublic MatParam getMaterialParam(java.lang.String name)
name - The name of the parameter to retrievepublic java.util.Collection<MatParam> getMaterialParams()
Modifying the material parameters or the collection will lead to undefined results.
public void addTechniqueDef(TechniqueDef technique)
technique - The technique definition to add.public java.util.List<TechniqueDef> getTechniqueDefs(java.lang.String name)
name - The name of the technique definitions to findpublic java.util.Collection<java.lang.String> getTechniqueDefsNames()