Class Intersection

java.lang.Object
  extended by Intersection
Direct Known Subclasses:
AbstractIntersection

public abstract class Intersection
extends java.lang.Object

Represents information about where a ray reaches a surface.


Field Summary
static Intersection NONE
          Represents the null intersection - for when a ray doesn't meet any surface.
 
Constructor Summary
Intersection()
           
 
Method Summary
abstract  double getDistance()
          Returns the distance along the ray to the intersection; ie, how many times the direction vector should be added to the point to reach the surface.
abstract  Point getHitPoint()
          Returns the point on the surface where the ray hit.
abstract  Material getMaterial()
          Returns the material on the surface at the point the ray hit.
abstract  Vector getNormal()
          Returns a vector normal to the surface at the point where the ray hit, in the direction of the surface's exterior.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final Intersection NONE
Represents the null intersection - for when a ray doesn't meet any surface.

Constructor Detail

Intersection

public Intersection()
Method Detail

getDistance

public abstract double getDistance()
Returns the distance along the ray to the intersection; ie, how many times the direction vector should be added to the point to reach the surface. This number should always be at least 1.0.


getHitPoint

public abstract Point getHitPoint()
Returns the point on the surface where the ray hit.


getNormal

public abstract Vector getNormal()
Returns a vector normal to the surface at the point where the ray hit, in the direction of the surface's exterior.


getMaterial

public abstract Material getMaterial()
Returns the material on the surface at the point the ray hit.