net.sf.j3d.threeD.raytracer.lighting
Class AmbientLight

java.lang.Object
  extended by net.sf.j3d.threeD.raytracer.lighting.AmbientLight
All Implemented Interfaces:
Light
Direct Known Subclasses:
DirectionalAmbientLight

public class AmbientLight
extends Object
implements Light

An AmbientLight object represents a light that is applied to all objects in the scene. The color and intensity of the light may by specified, but by default it is white light.

Author:
Mike Murray

Field Summary
 
Fields inherited from interface net.sf.j3d.threeD.raytracer.lighting.Light
castShadows
 
Constructor Summary
AmbientLight()
          Constructs an AmbientLight object with the default intensity and color.
AmbientLight(double intensity)
          Constructs an AmbientLight object with the specified intensity and default color.
AmbientLight(double intensity, RGB color)
          Constructs an AmbientLight object with the specified intensity and color.
 
Method Summary
 RGB getColor()
          Returns the color of this AmbientLight object as an RGB object.
 RGB getColorAt(Vector point)
          Returns the color of this AmbientLight object as an RGB object.
 double getIntensity()
          Returns the intensity of this AmbientLight object as a double value.
 void setColor(RGB color)
          Sets the color of this AmbientLight object to the color represented by the specified RGB object.
 void setIntensity(double intensity)
          Sets the intensity of this AmbientLight object.
 String toString()
          Returns "Ambient Light".
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AmbientLight

public AmbientLight()
Constructs an AmbientLight object with the default intensity and color.


AmbientLight

public AmbientLight(double intensity)
Constructs an AmbientLight object with the specified intensity and default color.


AmbientLight

public AmbientLight(double intensity,
                    RGB color)
Constructs an AmbientLight object with the specified intensity and color.

Method Detail

setIntensity

public void setIntensity(double intensity)
Sets the intensity of this AmbientLight object.

Specified by:
setIntensity in interface Light

setColor

public void setColor(RGB color)
Sets the color of this AmbientLight object to the color represented by the specified RGB object.

Specified by:
setColor in interface Light

getIntensity

public double getIntensity()
Returns the intensity of this AmbientLight object as a double value.

Specified by:
getIntensity in interface Light

getColor

public RGB getColor()
Returns the color of this AmbientLight object as an RGB object.

Specified by:
getColor in interface Light

getColorAt

public RGB getColorAt(Vector point)
Returns the color of this AmbientLight object as an RGB object.

Specified by:
getColorAt in interface Light

toString

public String toString()
Returns "Ambient Light".

Overrides:
toString in class Object