public class MatParam extends java.lang.Object implements Savable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name |
protected java.lang.String |
prefixedName |
protected VarType |
type |
protected boolean |
typeCheck |
protected java.lang.Object |
value |
Modifier | Constructor and Description |
---|---|
protected |
MatParam()
Serialization only.
|
|
MatParam(VarType type,
java.lang.String name,
java.lang.Object value)
Create a new material parameter.
|
Modifier and Type | Method and Description |
---|---|
MatParam |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getName()
Returns the name of the material parameter.
|
java.lang.String |
getPrefixedName()
Returns the name with "m_" prefixed to it.
|
java.lang.Object |
getValue()
Returns the value of this material parameter.
|
java.lang.String |
getValueAsString()
Returns the material parameter value as it would appear in a J3M
file.
|
VarType |
getVarType()
Returns the material parameter type.
|
int |
hashCode() |
boolean |
isTypeCheckEnabled() |
void |
read(JmeImporter im) |
void |
setTypeCheckEnabled(boolean v)
Enable type check for this param.
|
void |
setValue(java.lang.Object value)
Sets the value of this material parameter.
|
java.lang.String |
toString() |
void |
write(JmeExporter ex) |
protected VarType type
protected java.lang.String name
protected java.lang.String prefixedName
protected java.lang.Object value
protected boolean typeCheck
public MatParam(VarType type, java.lang.String name, java.lang.Object value)
type
- the type of the parametername
- the desired parameter namevalue
- the desired parameter value (alias created)protected MatParam()
public boolean isTypeCheckEnabled()
public void setTypeCheckEnabled(boolean v)
v
- (default = true)public VarType getVarType()
public java.lang.String getName()
public java.lang.String getPrefixedName()
public java.lang.Object getValue()
Material parameters that are used for material definitions will not have a value, unless there's a default value declared in the definition.
public void setValue(java.lang.Object value)
It is assumed the value is of the same type
as this material parameter.
value
- the value of this material parameter.public java.lang.String getValueAsString()
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.
public MatParam clone()
clone
in class java.lang.Object
public void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object