Bouncy Castle Rendering Toolkit 1.0

org.bouncycastle.graphics.rt.objects
Class DirectionalLight

java.lang.Object
  |
  +--org.bouncycastle.graphics.rt.objects.DirectionalLight
All Implemented Interfaces:
Light

public class DirectionalLight
extends java.lang.Object
implements Light

a directional light - the basic spotlight. This defines a light with as a point source with the light being shined on objects that fall within the cone described by the lights outside angle and direction.

By default is affects all objects unless the addAffected method is used, in which case it only affects those objects specified.

Example:

      <DirectionalLight location="0, 0, 0" direction="0, 0, -1" color="0.8, 0.7, 1"/>
 

Document Type Definition:

     <!ENTITY %Float    "CDATA">
     <!ENTITY %Color3f  "CDATA">
     <!ENTITY %Point3f  "CDATA">
     <!ENTITY %Vector3f "CDATA">

     <!ELEMENT DirectionalLight EMPTY>
     <!ATTLIST DirectionalLight
         color        %Color3f;  "1, 1, 1"
         location     %Vector3f; "0, 0, 1"
         direction    %Point3f;  "0, 0, 1"
         angle        %Float;    "45"
         innerAngle   %Float;    "45">
 


Constructor Summary
DirectionalLight(Point3f loc, Vector3f dir, double angle, Color3f col)
          basic constructor - no penumbra.
DirectionalLight(Point3f loc, Vector3f dir, double angle, double innerAngle, Color3f col)
          basic constructor.
 
Method Summary
 void addAffected(Renderable obj)
           
static Light getInstance(RMLReader in)
          build a directional light from an RML file.
 LightData getLightData(Hit hit, Illuminated world)
           
 void setShadows(boolean shadows)
          set whether or not this light can be occluded.
 void transform(Transform trans)
          transform the location of the light.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectionalLight

public DirectionalLight(Point3f loc,
                        Vector3f dir,
                        double angle,
                        double innerAngle,
                        Color3f col)
basic constructor.
Parameters:
loc - the location of the light source.
dir - axis of the cone of influence for the light.
angle - the spread (in degrees) of the cone of influence.
innerAngle - angle at which the "penumbra" starts.
col - the color of the incoming light.

DirectionalLight

public DirectionalLight(Point3f loc,
                        Vector3f dir,
                        double angle,
                        Color3f col)
basic constructor - no penumbra.
Parameters:
loc - the location of the light source.
dir - axis of the cone of influence for the light.
angle - the spread (in degrees) of the cone of influence.
col - the color of the incoming light.
Method Detail

getInstance

public static Light getInstance(RMLReader in)
                         throws java.io.IOException
build a directional light from an RML file.

setShadows

public void setShadows(boolean shadows)
set whether or not this light can be occluded.
Specified by:
setShadows in interface Light

transform

public void transform(Transform trans)
transform the location of the light.
Specified by:
transform in interface Light

addAffected

public void addAffected(Renderable obj)
Specified by:
addAffected in interface Light

getLightData

public LightData getLightData(Hit hit,
                              Illuminated world)
Specified by:
getLightData in interface Light

Bouncy Castle Rendering Toolkit 1.0