Class DirectionalLight
java.lang.Object
|
+--Light
|
+--DirectionalLight
- public class DirectionalLight
- extends Light
DirectionalLight represents a light source that illuminates along
parallel rays.
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 |
Direction
public Vector Direction
- Stores the direction the light travels in.
DirectionalLight
public DirectionalLight()
- Create a default light.
DirectionalLight
public DirectionalLight(Vector v)
- Create a new directional light that shines along given
direction vector.
- Parameters:
v
- the direction of the light rays
read
public void read(SceneReader is)
throws java.io.IOException,
java.lang.NumberFormatException
- Read the light from the given source.
- 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.
- Overrides:
- read in class Light
write
public void write(SceneWriter os)
throws java.io.IOException
- Write the light to the given destination
- Parameters:
os
- The destination to write to- Throws:
- java.io.IOException - if the write fails.
- Overrides:
- write in class Light
print
public void print(SceneWriter os)
throws java.io.IOException
- Print a human readable version of the light definition to the
given destination
- Parameters:
os
- The destination to write to- Throws:
- java.io.IOException - if the write fails.
- Overrides:
- print in class Light