public class

Light

extends Object
java.lang.Object
   ↳ casmi.graphics.object.Light

Class Overview

Light object class. Wrapper of JOGL light

Summary

Public Constructors
Light()
Creates Light object.
Light(LightMode lightMode)
Creates Light object using lightMode.
Public Methods
float[] getAmbient()
Returns the parameter of the ambient light.
double getAngle()
Returns the spot light's angle.
float[] getDiffuse()
Returns the diffuse color of Light.
double getDirectionX()
Returns the x-direction of Light
double getDirectionY()
Returns the x-direction of Light
double getDirectionZ()
Returns the z-direction of Light
float[] getEmissive()
Returns the emissive color of Light.
int getIndex()
Returns the index of Light.
LightMode getLightMode()
Returns the LightMode
float[] getShininess()
Returns the shininess of Light.
float[] getSpecular()
Returns the specular color of Light.
void render(Graphics g)
void setAmbient(float[] ambient)
Sets the parameter of the ambient light.
void setAngle(double angle)
Sets the spot light's angle.
void setColor(Color color)
Sets the color of Light.
void setColor(ColorSet colorSet)
Sets the color of Light.
void setDiffuse(float[] diffuse)
Sets the diffuse color of Light.
void setDirection(double x, double y, double z)
Sets the direction of Light.
void setDirectionX(double directionX)
Sets the x-direction of Light
void setDirectionY(double directionY)
Sets the x-direction of Light
void setDirectionZ(double directionZ)
Sets the z-direction of Light
void setEmissive(float[] emissive)
Sets the emissive color of Light.
void setIndex(int index)
Sets the index of Light.
void setLightMode(LightMode lightMode)
Sets the LightMode
void setPosition(double x, double y, double z)
Sets the position of the Element in 3D.
void setPosition(Vector3D v)
Sets the position of the Element in 2D.
void setShininess(float[] shininess)
Sets the shininess of Light.
void setSpecular(float[] specular)
Sets the specular color of Light.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Light ()

Creates Light object.

public Light (LightMode lightMode)

Creates Light object using lightMode.

Parameters
lightMode The lightMode of this light.
See Also

Public Methods

public float[] getAmbient ()

Returns the parameter of the ambient light.

Returns
  • The parameter of the ambient light.

public double getAngle ()

Returns the spot light's angle.

Returns
  • The angle of the spot light.

public float[] getDiffuse ()

Returns the diffuse color of Light.

Returns
  • The diffuse color of Light.

public double getDirectionX ()

Returns the x-direction of Light

Returns
  • The x-direction of Light.

public double getDirectionY ()

Returns the x-direction of Light

Returns
  • The x-direction of Light.

public double getDirectionZ ()

Returns the z-direction of Light

Returns
  • The z-direction of Light.

public float[] getEmissive ()

Returns the emissive color of Light.

Returns
  • The emissive color of Light.

public int getIndex ()

Returns the index of Light.

Returns
  • The index of Light.

public LightMode getLightMode ()

Returns the LightMode

Returns
  • The LightMode of this Light.
See Also

public float[] getShininess ()

Returns the shininess of Light.

Returns
  • The shininess of Light.

public float[] getSpecular ()

Returns the specular color of Light.

Returns
  • The specular color of Light.

public void render (Graphics g)

public void setAmbient (float[] ambient)

Sets the parameter of the ambient light.

Parameters
ambient The parameter of the ambient light.

public void setAngle (double angle)

Sets the spot light's angle.

Parameters
angle The angle of the spot light.

public void setColor (Color color)

Sets the color of Light.

Parameters
color The color of Light.

public void setColor (ColorSet colorSet)

Sets the color of Light.

Parameters
colorSet The ColorSet of Light.

public void setDiffuse (float[] diffuse)

Sets the diffuse color of Light.

Parameters
diffuse The diffuse color of Light.

public void setDirection (double x, double y, double z)

Sets the direction of Light.

Parameters
x The x-direction of Light.
y The y-direction of Light.
z The z-direction of Light.

public void setDirectionX (double directionX)

Sets the x-direction of Light

Parameters
directionX The x-direction of Light.

public void setDirectionY (double directionY)

Sets the x-direction of Light

Parameters
directionY The y-direction of Light.

public void setDirectionZ (double directionZ)

Sets the z-direction of Light

Parameters
directionZ The z-direction of Light.

public void setEmissive (float[] emissive)

Sets the emissive color of Light.

Parameters
emissive The emissive color of Light.

public void setIndex (int index)

Sets the index of Light.

Parameters
index The index of Light.

public void setLightMode (LightMode lightMode)

Sets the LightMode

Parameters
lightMode The LightMode of this Light.
See Also

public void setPosition (double x, double y, double z)

Sets the position of the Element in 3D.

Parameters
x x-coordinate
y y-coordinate
z z-coordinate

public void setPosition (Vector3D v)

Sets the position of the Element in 2D.

Parameters
v the vertex of the position of the Element

public void setShininess (float[] shininess)

Sets the shininess of Light.

Parameters
shininess The shininess of Light.

public void setSpecular (float[] specular)

Sets the specular color of Light.

Parameters
specular The specular color of Light.