artofillusion.object
Class Light

java.lang.Object
  extended by artofillusion.object.Object3D
      extended by artofillusion.object.Light
Direct Known Subclasses:
DirectionalLight, PointLight, SpotLight

public abstract class Light
extends Object3D

Light is an abstract class which represents a light source in a scene.


Field Summary
static int TYPE_AMBIENT
          This value for the light type represents a light which adds to the ambient light in the region it affects.
static int TYPE_NORMAL
          This value for the light type represents a normal light, one which only illuminates faces pointed toward it and which casts shadows.
static int TYPE_SHADOWLESS
          This value for the light type represents a light which does not cast shadows.
 
Fields inherited from class artofillusion.object.Object3D
APPROXIMATELY, CANT_CONVERT, EXACTLY
 
Constructor Summary
Light()
           
Light(java.io.DataInputStream in, Scene theScene)
           
 
Method Summary
 RGBColor getColor()
          Get the color of the light.
 float getDecayRate()
          Get the decay rate of the light.
 float getIntensity()
          Get the intensity of the light.
abstract  void getLight(RGBColor light, Vec3 position)
          Get the attenuated light at a given position relative to the light source.
 int getType()
          Get the type of light this object represents.
 void setColor(RGBColor color)
          Set the color of the light.
 void setDecayRate(float rate)
          Set the decay rate of the light.
 void setIntensity(float intensity)
          Set the intensity of the light.
 void setParameters(RGBColor color, float intensity, int type, float decayRate)
          Set the parameters for this light.
 void setType(int type)
          Set the type of light this object represents.
 
Methods inherited from class artofillusion.object.Object3D
applyPoseKeyframe, canConvertToActor, canConvertToTriangleMesh, canSetMaterial, canSetTexture, configurePoseTrack, convertToTriangleMesh, copyObject, copyTextureAndMaterial, duplicate, edit, editGesture, editKeyframe, getAverageParameterValues, getBounds, getMaterial, getMaterialMapping, getParameters, getParameterValue, getParameterValues, getPosableObject, getPoseKeyframe, getProperties, getPropertyValue, getRenderingMesh, getSkeleton, getTexture, getTextureMapping, getWireframeMesh, isClosed, isEditable, readParameterValue, renderObject, sceneChanged, setMaterial, setParameters, setParameterValue, setParameterValues, setPropertyValue, setSize, setTexture, writeToFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NORMAL

public static final int TYPE_NORMAL
This value for the light type represents a normal light, one which only illuminates faces pointed toward it and which casts shadows.

See Also:
Constant Field Values

TYPE_SHADOWLESS

public static final int TYPE_SHADOWLESS
This value for the light type represents a light which does not cast shadows.

See Also:
Constant Field Values

TYPE_AMBIENT

public static final int TYPE_AMBIENT
This value for the light type represents a light which adds to the ambient light in the region it affects. This means that it does not cast shadows, and illuminates all surfaces equally regardless of whether or not they face toward the light.

See Also:
Constant Field Values
Constructor Detail

Light

public Light()

Light

public Light(java.io.DataInputStream in,
             Scene theScene)
      throws java.io.IOException,
             java.io.InvalidObjectException
Throws:
java.io.IOException
java.io.InvalidObjectException
Method Detail

setParameters

public void setParameters(RGBColor color,
                          float intensity,
                          int type,
                          float decayRate)
Set the parameters for this light.


getColor

public RGBColor getColor()
Get the color of the light.


setColor

public void setColor(RGBColor color)
Set the color of the light.


getIntensity

public float getIntensity()
Get the intensity of the light.


setIntensity

public void setIntensity(float intensity)
Set the intensity of the light.


getLight

public abstract void getLight(RGBColor light,
                              Vec3 position)
Get the attenuated light at a given position relative to the light source.


getDecayRate

public float getDecayRate()
Get the decay rate of the light.


setDecayRate

public void setDecayRate(float rate)
Set the decay rate of the light.


getType

public int getType()
Get the type of light this object represents. This is one of the constants TYPE_NORMAL, TYPE_SHADOWLESS, or TYPE_AMBIENT.


setType

public void setType(int type)
Set the type of light this object represents. This is one of the constants TYPE_NORMAL, TYPE_SHADOWLESS, or TYPE_AMBIENT.



Copyright © 1999-2011 by Peter Eastman.