tracer
Class Ray

java.lang.Object
  extended by tracer.Ray

public class Ray
extends java.lang.Object

Represents a ray: a ray can `trace' itself, calculating a color.


Field Summary
 Vec3 direction
           
 Vec3 origin
           
 
Constructor Summary
Ray(Vec3 o, Vec3 d)
           
 
Method Summary
 boolean hit(Traceable ignoreObject)
          Checks if the ray (origin + t*direction) hits the scene with 0 <= t <= 1.
 Vec3 localLight(IntersectionInfo info, Light light, Vec3 color)
          Calculates the local light term, given an IntersectionInfo and a Light.
 float omega(float t)
          produceert de waarde van kleine omega in de perlin noise bereking
 int phi(int t, int n, Material mat)
           
 Vec3 textureMap(IntersectionInfo info)
           
 Vec3 trace(Traceable currentObject, int maxReflectionsLeft)
          Does the actual `raytracing'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

origin

public Vec3 origin

direction

public Vec3 direction
Constructor Detail

Ray

public Ray(Vec3 o,
           Vec3 d)
Method Detail

omega

public float omega(float t)
produceert de waarde van kleine omega in de perlin noise bereking

Parameters:
t - de waarde waarvoor de kleine omega moet worden berekend
Returns:
de waarde van kleine omega

phi

public int phi(int t,
               int n,
               Material mat)

localLight

public Vec3 localLight(IntersectionInfo info,
                       Light light,
                       Vec3 color)
Calculates the local light term, given an IntersectionInfo and a Light. This method does not do an occlusion test; do this yourself (e.g. using a shadow feeler).


trace

public Vec3 trace(Traceable currentObject,
                  int maxReflectionsLeft)
Does the actual `raytracing'. Returns the color this ray `hits.'

Parameters:
currentObject - This object is ignored in the intersection tests; in effect, this object is `invisible' to the ray. This is useful for reflection rays and shadow feelers: it avoids precision-errors by just ignoring the object you've just bounced off of. If all objects are convex (which they are in this tracer) this is actually not a hack but completely correct.
maxReflectionsLeft - Maximum recursion depth for reflection calculations .

textureMap

public Vec3 textureMap(IntersectionInfo info)

hit

public boolean hit(Traceable ignoreObject)
Checks if the ray (origin + t*direction) hits the scene with 0 <= t <= 1.

Parameters:
ignoreObject - Similar to trace's currentObject parameter.
See Also:
trace.