de.javagl.utils.obj.impl
Class DefaultMtl

java.lang.Object
  extended by de.javagl.utils.obj.impl.DefaultMtl
All Implemented Interfaces:
Mtl

public class DefaultMtl
extends Object
implements Mtl

Default implementation of an Mtl (material)


Constructor Summary
DefaultMtl(String name)
          Creates a new material with the given name
 
Method Summary
 boolean equals(Object obj)
           
 float getD()
          Returns the opacity of the material
 FloatTuple getKa()
          Returns the ambient component of the material
 FloatTuple getKd()
          Returns the diffuse component of the material
 FloatTuple getKs()
          Returns the specular component of the material
 String getMapKd()
          Returns the name of the diffuse map of the material, or null if it has not map.
 String getName()
          Return the name of the material
 float getNs()
          Returns the shininess of the material.
 int hashCode()
           
 void setD(float d)
          Set the opacity of this material
 void setKa(float ka0, float ka1, float ka2)
          Set the ambient part of this material
 void setKd(float kd0, float kd1, float kd2)
          Set the diffuse part of this material
 void setKs(float ks0, float ks1, float ks2)
          Set the specular part of this material
 void setMapKd(String mapKd)
          Set the diffuse map name of this material
 void setNs(float ns)
          Set the shininess of this material
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMtl

public DefaultMtl(String name)
Creates a new material with the given name

Parameters:
name - The name of this material
Method Detail

getName

public String getName()
Description copied from interface: Mtl
Return the name of the material

Specified by:
getName in interface Mtl
Returns:
The name of the material

setKa

public void setKa(float ka0,
                  float ka1,
                  float ka2)
Set the ambient part of this material

Parameters:
ka0 - The ambient component 0
ka1 - The ambient component 1
ka2 - The ambient component 2

getKa

public FloatTuple getKa()
Description copied from interface: Mtl
Returns the ambient component of the material

Specified by:
getKa in interface Mtl
Returns:
The ambient component of the material

setKs

public void setKs(float ks0,
                  float ks1,
                  float ks2)
Set the specular part of this material

Parameters:
ks0 - The specular component 0
ks1 - The specular component 1
ks2 - The specular component 2

getKs

public FloatTuple getKs()
Description copied from interface: Mtl
Returns the specular component of the material

Specified by:
getKs in interface Mtl
Returns:
The specular component of the material

setKd

public void setKd(float kd0,
                  float kd1,
                  float kd2)
Set the diffuse part of this material

Parameters:
kd0 - The diffuse component 0
kd1 - The diffuse component 1
kd2 - The diffuse component 2

getKd

public FloatTuple getKd()
Description copied from interface: Mtl
Returns the diffuse component of the material

Specified by:
getKd in interface Mtl
Returns:
The diffuse component of the material

setMapKd

public void setMapKd(String mapKd)
Set the diffuse map name of this material

Parameters:
mapKd - The diffuse map name of this material

getMapKd

public String getMapKd()
Description copied from interface: Mtl
Returns the name of the diffuse map of the material, or null if it has not map.

Specified by:
getMapKd in interface Mtl
Returns:
The name of the diffuse map of the material

setNs

public void setNs(float ns)
Set the shininess of this material

Parameters:
ns - The shininess of this material

getNs

public float getNs()
Description copied from interface: Mtl
Returns the shininess of the material.

Specified by:
getNs in interface Mtl
Returns:
The shininess of the material.

setD

public void setD(float d)
Set the opacity of this material

Parameters:
d - The opacity of this material

getD

public float getD()
Description copied from interface: Mtl
Returns the opacity of the material

Specified by:
getD in interface Mtl
Returns:
The opacity of the material.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object