raytracer
Class Raycaster

java.lang.Object
  extended by raytracer.Raycaster

public class Raycaster
extends java.lang.Object


Constructor Summary
Raycaster(Scene scene, int maxrecursiondepth, Shader shader, double minI)
          constructor
 
Method Summary
 boolean castOptimizedShadowRay(Ray ray, double howfar, RGBColor color)
          a version of castRay without shading, optimized
 boolean castRay(Ray ray, RGBColor color, RayState rs)
          casts a ray in direction of ray, sets the color and intersection info
 boolean castShadowRay(Ray ray, double howfar, RGBColor color)
          a version of castRay without shading
 Raycaster getCopy()
          copies the raycaster
 int getRecursionDepth()
           
 Scene getScene()
           
 Shader getShader()
           
 void setRecursionDepth(int depth)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Raycaster

public Raycaster(Scene scene,
                 int maxrecursiondepth,
                 Shader shader,
                 double minI)
constructor

Parameters:
scene -
maxrecursiondepth - maximum recursion depth
shader -
minI - minimum importance
Method Detail

getRecursionDepth

public int getRecursionDepth()
Returns:
the max recursion depth

setRecursionDepth

public void setRecursionDepth(int depth)
Parameters:
depth - the max recursion depth

getScene

public Scene getScene()
Returns:
scene

getShader

public Shader getShader()
Returns:
shader

castRay

public boolean castRay(Ray ray,
                       RGBColor color,
                       RayState rs)
casts a ray in direction of ray, sets the color and intersection info

Parameters:
ray -
color -
rs - state of the raytracer
Returns:
did the ray hit something

castShadowRay

public boolean castShadowRay(Ray ray,
                             double howfar,
                             RGBColor color)
a version of castRay without shading

Parameters:
ray -
howfar - howfar to the light source
color -
Returns:
does object blocks the way to the light

castOptimizedShadowRay

public boolean castOptimizedShadowRay(Ray ray,
                                      double howfar,
                                      RGBColor color)
a version of castRay without shading, optimized

Parameters:
ray -
howfar - howfar to the light source
color -
Returns:
does object blocks the way to the light

getCopy

public Raycaster getCopy()
copies the raycaster

Returns:
a copy of the raycaster