tracer
Class IntersectionInfo

java.lang.Object
  extended by tracer.IntersectionInfo

public class IntersectionInfo
extends java.lang.Object

Used for returning information about intersections from Traceable.intersect.


Field Summary
 float distance
           
 boolean hit
           
 Vec3 location
           
 Vec3 normal
           
 Traceable object
           
 float u
           
 float v
           
 
Constructor Summary
IntersectionInfo(boolean hit)
          Constructor indicating there is no intersection.
IntersectionInfo(Vec3 location, Vec3 normal, float distance, Traceable object, float u, float v)
          Constructor indicating there was an intersection.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hit

public boolean hit

location

public Vec3 location

normal

public Vec3 normal

distance

public float distance

object

public Traceable object

u

public float u

v

public float v
Constructor Detail

IntersectionInfo

public IntersectionInfo(boolean hit)
Constructor indicating there is no intersection.

Parameters:
hit - Should be false. I know this is ugly, at least it saves us from having to type `new IntersectionInfo(false,null,null,0,null)' for indicating no hit.

IntersectionInfo

public IntersectionInfo(Vec3 location,
                        Vec3 normal,
                        float distance,
                        Traceable object,
                        float u,
                        float v)
Constructor indicating there was an intersection.

Parameters:
location - The location of the intersection
normal - The normal of the object at the point of intersection.
distance - The distance from ray origin to the intersection point.
object - The object that was hit. Supply `this' here from the intersect method of your Traceable.