Class Scene

java.lang.Object
  extended by Scene

public class Scene
extends java.lang.Object

Represents a scene, including both the surfaces and the light sources in the scene.


Constructor Summary
Scene()
           
 
Method Summary
 void add(Surface toAdd)
          Adds the given surface into this scene.
 void addLight(Point source)
          Adds a light at the given poin into this scene with full brightness.
 double getAmbient()
          Returns the brightness of the scene's ambient light.
 java.util.List<Point> getLights()
          Returns an unmodifiable list holding the locations of all lights in the scene.
 boolean inShadow(Point query, Point light)
          Returns true if there are any surfaces in the scene between the given point and the given light source.
 void setAmbient(double value)
          Sets the brightness of the scene's ambient light.
 Intersection traceRay(Ray query)
          Determines the closest intersection of the given ray with the scene that lies at least 1 unit away - ie, where the difference between hit point and the ray's origin is at least as long as the ray's direction vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scene

public Scene()
Method Detail

add

public void add(Surface toAdd)
Adds the given surface into this scene.


addLight

public void addLight(Point source)
Adds a light at the given poin into this scene with full brightness.


getLights

public java.util.List<Point> getLights()
Returns an unmodifiable list holding the locations of all lights in the scene.


setAmbient

public void setAmbient(double value)
Sets the brightness of the scene's ambient light.


getAmbient

public double getAmbient()
Returns the brightness of the scene's ambient light.


traceRay

public Intersection traceRay(Ray query)
Determines the closest intersection of the given ray with the scene that lies at least 1 unit away - ie, where the difference between hit point and the ray's origin is at least as long as the ray's direction vector.


inShadow

public boolean inShadow(Point query,
                        Point light)
Returns true if there are any surfaces in the scene between the given point and the given light source.