de.rico.engine.material
Class Material

java.lang.Object
  extended by de.rico.engine.material.Material

public class Material
extends java.lang.Object

This class is used to represent materials

Author:
Frank Bruns

Constructor Summary
Material()
          Creates a new material with OpenGL standard material values
Material(Color4f ambient, Color4f diffuse)
          Creates a new material with the specified ambient and diffuse colors
 
Method Summary
 Color4f getAmbient()
          Returns the material's ambient RGBA color.
 Color4f getDiffuse()
          Returns the material's diffuse RGBA color.
 Color4f getEmission()
          Returns the emission material RGBA color
 float getShininess()
          Returns the material's shininess value
 Color4f getSpecular()
          Returns the material's specular RGBA color
 void setAmbient(Color4f ambient)
          Sets the material's ambient color to the specified values
 void setAmbient(float red, float green, float blue, float alpha)
          Sets the material's ambient color to the specified parameters.
 void setDiffuse(Color4f diffuse)
          Sets the material's color to the specified values
 void setDiffuse(float red, float green, float blue, float alpha)
          Sets the material's diffuse color to the specified parameters.
 void setEmission(float red, float green, float blue, float alpha)
          Sets the material's emission RGBA color
 void setShininess(float value)
          Sets the material's shininess.
 void setSpecular(float red, float green, float blue, float alpha)
          Sets the material's specular RGBA color
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Material

public Material()
Creates a new material with OpenGL standard material values


Material

public Material(Color4f ambient,
                Color4f diffuse)
Creates a new material with the specified ambient and diffuse colors

Parameters:
ambient - ambient color
diffuse - diffuse color
Method Detail

getDiffuse

public Color4f getDiffuse()
Returns the material's diffuse RGBA color.

Returns:
diffuse material color

setDiffuse

public void setDiffuse(float red,
                       float green,
                       float blue,
                       float alpha)
Sets the material's diffuse color to the specified parameters.

Parameters:
red - amount of red
green - amount of green
blue - amount of blue
alpha - alpha-value

setDiffuse

public void setDiffuse(Color4f diffuse)
Sets the material's color to the specified values

Parameters:
diffuse - diffuse color

getAmbient

public Color4f getAmbient()
Returns the material's ambient RGBA color.

Returns:
diffuse material color

setAmbient

public void setAmbient(float red,
                       float green,
                       float blue,
                       float alpha)
Sets the material's ambient color to the specified parameters.

Parameters:
red - amount of red
green - amount of green
blue - amount of blue
alpha - alpha-value

setAmbient

public void setAmbient(Color4f ambient)
Sets the material's ambient color to the specified values

Parameters:
ambient - float array with ambient color

getEmission

public Color4f getEmission()
Returns the emission material RGBA color

Returns:
emission material color

setEmission

public void setEmission(float red,
                        float green,
                        float blue,
                        float alpha)
Sets the material's emission RGBA color

Parameters:
red - amount of red
green - amount of green
blue - amount of blue
alpha - alpha-value

getSpecular

public Color4f getSpecular()
Returns the material's specular RGBA color

Returns:
material's specular color

setSpecular

public void setSpecular(float red,
                        float green,
                        float blue,
                        float alpha)
Sets the material's specular RGBA color

Parameters:
red - amount of red
green - amount of green
blue - amount of blue
alpha - alpha-value

getShininess

public float getShininess()
Returns the material's shininess value

Returns:
shininess value

setShininess

public void setShininess(float value)
Sets the material's shininess.

Parameters:
value - shininess factor

toString

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