Class PointLight

java.lang.Object
  |
  +--Light
        |
        +--PointLight

public class PointLight
extends Light

PointLight represents a light sources that illuminates from a fixed origin


Field Summary
 Point Origin
          Stores the origin of the point light.
 
Fields inherited from class Light
Intensity
 
Constructor Summary
PointLight()
          Create a default light.
PointLight(Point p)
          Create a new point light that at the given point.
 
Method Summary
 void print(SceneWriter os)
          Print a human readable version of the light definition to the given destination
 void read(SceneReader is)
          Read the light from the given source
 void write(SceneWriter os)
          Write the light to the given destination
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Origin

public Point Origin
Stores the origin of the point light.

Constructor Detail

PointLight

public PointLight()
Create a default light.


PointLight

public PointLight(Point p)
Create a new point light that at the given point.

Parameters:
p - The position of the light.
Method Detail

read

public void read(SceneReader is)
          throws java.io.IOException,
                 java.lang.NumberFormatException
Read the light from the given source

Specified by:
read in class Light
Parameters:
is - The source to read from
Throws:
java.io.IOException - if the light can not be read
java.io.NumberFormatException - if there a number format error is encountered
java.lang.NumberFormatException

write

public void write(SceneWriter os)
           throws java.io.IOException
Write the light to the given destination

Specified by:
write in class Light
Parameters:
os - The destination to write to
Throws:
java.io.IOException - if the write fails.

print

public void print(SceneWriter os)
           throws java.io.IOException
Print a human readable version of the light definition to the given destination

Specified by:
print in class Light
Parameters:
os - The destination to write to
Throws:
java.io.IOException - if the write fails.