Class AbstractIntersection

java.lang.Object
  extended by Intersection
      extended by AbstractIntersection

public abstract class AbstractIntersection
extends Intersection

Partial implementation of Intersection interface.


Field Summary
 
Fields inherited from class Intersection
NONE
 
Constructor Summary
AbstractIntersection(Ray incident, double distance)
           
 
Method Summary
 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.
 Point getHitPoint()
          Returns the point on the surface where the ray hit.
 Ray getIncidentRay()
           
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 Intersection
getMaterial
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractIntersection

public AbstractIntersection(Ray incident,
                            double distance)
Method Detail

getDistance

public double getDistance()
Description copied from class: Intersection
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.

Specified by:
getDistance in class Intersection

getIncidentRay

public Ray getIncidentRay()

getHitPoint

public Point getHitPoint()
Description copied from class: Intersection
Returns the point on the surface where the ray hit.

Specified by:
getHitPoint in class Intersection

getNormal

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

Specified by:
getNormal in class Intersection