Class OGLMaterial

java.lang.Object
com.blackrook.gloop.opengl.gl1.OGLMaterial

public class OGLMaterial extends Object
Material attribute for drawing geometry that interacts with light.
Author:
Matthew Tropiano
  • Field Details

  • Constructor Details

    • OGLMaterial

      public OGLMaterial()
      Creates a new material.
    • OGLMaterial

      public OGLMaterial(Color ambient, Color diffuse, Color specular, Color emissive, float shine)
      Creates a new material.
      Parameters:
      ambient - the material's ambient color.
      diffuse - the material's diffuse color.
      specular - the material's specular color.
      emissive - the material's emissive color.
      shine - the shininess factor.
  • Method Details

    • setAmbientColor

      public void setAmbientColor(Color ambient)
      Set up this material's ambient color.
      Parameters:
      ambient - the material's ambient color.
    • setAmbientColor

      public void setAmbientColor(float red, float green, float blue, float alpha)
      Set up this material's ambient color.
      Parameters:
      red - the material's ambient color, red component.
      green - the material's ambient color, green component.
      blue - the material's ambient color, blue component.
      alpha - the material's ambient color, alpha component.
    • setDiffuseColor

      public void setDiffuseColor(Color diffuse)
      Set up this material's diffuse color.
      Parameters:
      diffuse - the material's diffuse color.
    • setDiffuseColor

      public void setDiffuseColor(float red, float green, float blue, float alpha)
      Set up this material's diffuse color.
      Parameters:
      red - the material's ambient color, red component.
      green - the material's ambient color, green component.
      blue - the material's ambient color, blue component.
      alpha - the material's ambient color, alpha component.
    • setSpecularColor

      public void setSpecularColor(Color specular)
      Set up this material's specular color.
      Parameters:
      specular - the material's specular color.
    • setSpecularColor

      public void setSpecularColor(float red, float green, float blue, float alpha)
      Set up this material's specular color.
      Parameters:
      red - the material's ambient color, red component.
      green - the material's ambient color, green component.
      blue - the material's ambient color, blue component.
      alpha - the material's ambient color, alpha component.
    • setEmissionColor

      public void setEmissionColor(Color emission)
      Set up this material's emission color.
      Parameters:
      emission - the material's emission color.
    • setEmissionColor

      public void setEmissionColor(float red, float green, float blue, float alpha)
      Set up this material's emission color.
      Parameters:
      red - the material's ambient color, red component.
      green - the material's ambient color, green component.
      blue - the material's ambient color, blue component.
      alpha - the material's ambient color, alpha component.
    • setShininess

      public void setShininess(float shine)
      Set this material's shininess.
      Parameters:
      shine - the shininess factor.
    • getAmbientColor

      public Color getAmbientColor()
      Returns:
      this material's ambient color.
    • getDiffuseColor

      public Color getDiffuseColor()
      Returns:
      this material's diffuse color.
    • getSpecularColor

      public Color getSpecularColor()
      Returns:
      this material's specular color.
    • getEmissionColor

      public Color getEmissionColor()
      Returns:
      this material's emissive color.
    • getShininess

      public float getShininess()
      Returns:
      this material's shininess factor.