raytracer
Class Scene

java.lang.Object
  extended by raytracer.Scene

public class Scene
extends java.lang.Object


Constructor Summary
Scene()
          constructor
 
Method Summary
 void addLight(ILight light)
          add a light to the light list
 void addObject(IObject object)
          adds a object to the object list and if it is an emitter also to the luminaire list
 void addShaderOp(IShaderOp shaderop)
          add a shaderop to the shader
 void assignCamera(Camera camera)
          assigns the camera
 void assignRaycaster(Raycaster raycaster)
          assigns the raycaster
 IntersectionInfo calcIntersection(Ray ray)
          calculates the intersection of the scene with a ray
 IntersectionInfo calcOptimizedIntersection(Ray ray)
          calculates the intersection of the scene with the ray of the camera
 IntersectionInfo calcOptimizedShadowIntersection(Ray ray)
          calculates the intersection of the scene with the ray of the camera without shading
 IntersectionInfo calcShadowIntersection(Ray ray)
          calculates the intersection of the scene with a ray, without shading
 void clear()
          clears the list
 void computeDirectLighting(IntersectionInfo intersection, RayState rs, IBSDF brdf, RGBColor amount)
          compute the lighting condition at a intersection point
 Camera getCamera()
           
 Scene getCopy()
           
 ILight getLight(int num)
           
 int getNumLights()
           
 int getNumObjects()
           
 IObject getObject(int num)
           
 Raycaster getRaycaster()
           
 void resetObjectList()
          clear the object list
 void resetShadowObjectList()
          clear the shadow object list
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scene

public Scene()
constructor

Method Detail

clear

public void clear()
clears the list


assignCamera

public void assignCamera(Camera camera)
assigns the camera

Parameters:
camera -

assignRaycaster

public void assignRaycaster(Raycaster raycaster)
assigns the raycaster

Parameters:
raycaster -

getRaycaster

public Raycaster getRaycaster()
Returns:
raycaster

addObject

public void addObject(IObject object)
adds a object to the object list and if it is an emitter also to the luminaire list

Parameters:
object -

addLight

public void addLight(ILight light)
add a light to the light list

Parameters:
light -

addShaderOp

public void addShaderOp(IShaderOp shaderop)
add a shaderop to the shader

Parameters:
shaderop -

getCamera

public Camera getCamera()
Returns:
camera

getNumObjects

public int getNumObjects()
Returns:
the number of objects in the object list

getNumLights

public int getNumLights()
Returns:
the number of lights in the scene

getObject

public IObject getObject(int num)
Parameters:
num - number
Returns:
the object with number i

calcIntersection

public IntersectionInfo calcIntersection(Ray ray)
calculates the intersection of the scene with a ray

Parameters:
ray -
Returns:
intersection information

calcShadowIntersection

public IntersectionInfo calcShadowIntersection(Ray ray)
calculates the intersection of the scene with a ray, without shading

Parameters:
ray -
Returns:
intersection information

resetObjectList

public void resetObjectList()
clear the object list


resetShadowObjectList

public void resetShadowObjectList()
clear the shadow object list


calcOptimizedIntersection

public IntersectionInfo calcOptimizedIntersection(Ray ray)
calculates the intersection of the scene with the ray of the camera

Parameters:
ray -
Returns:
intersection information

calcOptimizedShadowIntersection

public IntersectionInfo calcOptimizedShadowIntersection(Ray ray)
calculates the intersection of the scene with the ray of the camera without shading

Parameters:
ray -
Returns:
intersection information

getLight

public ILight getLight(int num)
Parameters:
num -
Returns:
the light with number num

computeDirectLighting

public void computeDirectLighting(IntersectionInfo intersection,
                                  RayState rs,
                                  IBSDF brdf,
                                  RGBColor amount)
compute the lighting condition at a intersection point

Parameters:
intersection - the intersection information
rs - sate of the raytracer
brdf -
amount -

getCopy

public Scene getCopy()
Returns:
a copy of the scene