Package com.jme3.material
Class MaterialDef
java.lang.Object
com.jme3.material.MaterialDef
Describes a J3MD (Material definition).
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedSerialization only.MaterialDef(AssetManager assetManager, String name) Creates a new material definition with the given name.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddMaterialParam(VarType type, String name, Object value) Adds a new material parameter.voidaddMaterialParamTexture(VarType type, String name, ColorSpace colorSpace, Texture value) Adds a new material parameter.voidaddTechniqueDef(TechniqueDef technique) Adds a new technique definition to this material definition.Returns the AssetManager passed in the constructor.Returns the asset key name of the asset from which this material definition was loaded.getMaterialParam(String name) Returns the material parameter with the given name.Returns a collection of all material parameters declared in this material definition.getName()The debug name of the material definition.getTechniqueDefs(String name) Returns technique definitions with the given name.voidsetAssetName(String assetName) Set the asset key name.
- 
Constructor Details- 
MaterialDefprotected MaterialDef()Serialization only. Do not use.
- 
MaterialDefCreates a new material definition with the given name.- Parameters:
- assetManager- The asset manager to use to load shaders
- name- The debug name of the material definition
 
 
- 
- 
Method Details- 
getAssetNameReturns the asset key name of the asset from which this material definition was loaded.- Returns:
- Asset key name of the j3md file
 
- 
setAssetNameSet the asset key name.- Parameters:
- assetName- the asset key name
 
- 
getAssetManagerReturns the AssetManager passed in the constructor.- Returns:
- the AssetManager passed in the constructor.
 
- 
getNameThe debug name of the material definition.- Returns:
- debug name of the material definition.
 
- 
addMaterialParamAdds a new material parameter.- Parameters:
- type- Type of the parameter
- name- Name of the parameter
- value- Default value of the parameter
 
- 
addMaterialParamTexturepublic void addMaterialParamTexture(VarType type, String name, ColorSpace colorSpace, Texture value) Adds a new material parameter.- Parameters:
- type- Type of the parameter
- name- Name of the parameter
- colorSpace- the color space of the texture required by this texture param
- value- Default value of the parameter
- See Also:
 
- 
getMaterialParamReturns the material parameter with the given name.- Parameters:
- name- The name of the parameter to retrieve
- Returns:
- The material parameter, or null if it does not exist.
 
- 
getMaterialParamsReturns a collection of all material parameters declared in this material definition.Modifying the material parameters or the collection will lead to undefined results. - Returns:
- All material parameters declared in this definition.
 
- 
addTechniqueDefAdds a new technique definition to this material definition.- Parameters:
- technique- The technique definition to add.
 
- 
getTechniqueDefsReturns technique definitions with the given name.- Parameters:
- name- The name of the technique definitions to find
- Returns:
- The technique definitions, or null if cannot be found.
 
- 
getTechniqueDefsNames- Returns:
- the list of all the technique definitions names.
 
 
-