Package com.jme3.material
Class MatParam
java.lang.Object
com.jme3.material.MatParam
- Direct Known Subclasses:
MatParamOverride
,MatParamTexture
Describes a material parameter. This is used for both defining a name and type
as well as a material parameter value.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
getName()
Returns the name of the material parameter.Returns the name with "m_" prefixed to it.getValue()
Returns the value of this material parameter.Returns the material parameter value as it would appear in a J3M file.Returns the material parameter type.int
hashCode()
boolean
void
read
(JmeImporter im) void
setTypeCheckEnabled
(boolean v) Enable type check for this param.void
Sets the value of this material parameter.toString()
void
write
(JmeExporter ex)
-
Field Details
-
type
-
name
-
prefixedName
-
value
-
typeCheck
protected boolean typeCheck
-
-
Constructor Details
-
MatParam
Create a new material parameter. For internal use only.- Parameters:
type
- the type of the parametername
- the desired parameter namevalue
- the desired parameter value (alias created)
-
MatParam
protected MatParam()Serialization only. Do not use.
-
-
Method Details
-
isTypeCheckEnabled
public boolean isTypeCheckEnabled() -
setTypeCheckEnabled
public void setTypeCheckEnabled(boolean v) Enable type check for this param. When type check is enabled a RuntimeException is thrown if an object of the wrong type is passed to setValue.- Parameters:
v
- (default = true)
-
getVarType
Returns the material parameter type.- Returns:
- the material parameter type.
-
getName
Returns the name of the material parameter.- Returns:
- the name of the material parameter.
-
getPrefixedName
Returns the name with "m_" prefixed to it.- Returns:
- the name with "m_" prefixed to it
-
getValue
Returns the value of this material parameter.Material parameters that are used for material definitions will not have a value, unless there's a default value declared in the definition.
- Returns:
- the value of this material parameter.
-
setValue
Sets the value of this material parameter.It is assumed the value is of the same
type
as this material parameter.- Parameters:
value
- the value of this material parameter.
-
getValueAsString
Returns the material parameter value as it would appear in a J3M file. E.g.MaterialParameters { ABC : 1 2 3 4 }
Assuming "ABC" is a Vector4 parameter, then the value "1 2 3 4" would be returned by this method.- Returns:
- material parameter value as it would appear in a J3M file.
-
clone
-
write
- Specified by:
write
in interfaceSavable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-