com.jme3.material
Class MatParam

java.lang.Object
  extended by com.jme3.material.MatParam
All Implemented Interfaces:
Savable, java.lang.Cloneable
Direct Known Subclasses:
MatParamTexture

public class MatParam
extends java.lang.Object
implements Savable, java.lang.Cloneable

Describes a material parameter. This is used for both defining a name and type as well as a material parameter value.


Field Summary
protected  FixedFuncBinding ffBinding
           
protected  java.lang.String name
           
protected  java.lang.String prefixedName
           
protected  VarType type
           
protected  java.lang.Object value
           
 
Constructor Summary
MatParam()
          Serialization only.
MatParam(VarType type, java.lang.String name, java.lang.Object value, FixedFuncBinding ffBinding)
          Create a new material parameter.
 
Method Summary
 MatParam clone()
           
 boolean equals(java.lang.Object obj)
           
 FixedFuncBinding getFixedFuncBinding()
          Returns the fixed function binding.
 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()
           
 void read(JmeImporter im)
           
 void setValue(java.lang.Object value)
          Sets the value of this material parameter.
 java.lang.String toString()
           
 void write(JmeExporter ex)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected VarType type

name

protected java.lang.String name

prefixedName

protected java.lang.String prefixedName

value

protected java.lang.Object value

ffBinding

protected FixedFuncBinding ffBinding
Constructor Detail

MatParam

public MatParam(VarType type,
                java.lang.String name,
                java.lang.Object value,
                FixedFuncBinding ffBinding)
Create a new material parameter. For internal use only.


MatParam

public MatParam()
Serialization only. Do not use.

Method Detail

getFixedFuncBinding

public FixedFuncBinding getFixedFuncBinding()
Returns the fixed function binding.

Returns:
the fixed function binding.

getVarType

public VarType getVarType()
Returns the material parameter type.

Returns:
the material parameter type.

getName

public java.lang.String getName()
Returns the name of the material parameter.

Returns:
the name of the material parameter.

getPrefixedName

public java.lang.String getPrefixedName()
Returns the name with "m_" prefixed to it.

Returns:
the name with "m_" prefixed to it

getValue

public java.lang.Object 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

public void setValue(java.lang.Object value)
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

public java.lang.String 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

public MatParam clone()
Overrides:
clone in class java.lang.Object

write

public void write(JmeExporter ex)
           throws java.io.IOException
Specified by:
write in interface Savable
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Specified by:
read in interface Savable
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object