Class Intersection

java.lang.Object
  extended by Intersection

public class Intersection
extends java.lang.Object

Holds information about where a ray intersects with a surface in the world.


Constructor Summary
Intersection(double dist, Surface surf, Ray normal)
          Constructs an Intersection object holding the given information.
 
Method Summary
 double getDistance()
          Returns the ``distance'' along the viewing ray that the surface appears.
 Ray getNormalRay()
          Returns the ray normal to the surface at this intersection point.
 Surface getSurface()
          Returns the surface at this intersection point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Intersection

public Intersection(double dist,
                    Surface surf,
                    Ray normal)
Constructs an Intersection object holding the given information.

Parameters:
dist - the distance along the viewing ray that the surface appears.
surf - the surface that it intersects.
normal - the ray normal to the surface at this point of intersection.
Method Detail

getDistance

public double getDistance()
Returns the ``distance'' along the viewing ray that the surface appears. The documentation for Surface's getDistanceFrom method defines what this distance is.

Returns:
the ``distance'' along the viewing ray to this intersection.

getSurface

public Surface getSurface()
Returns the surface at this intersection point.

Returns:
the surface at this intersection point.

getNormalRay

public Ray getNormalRay()
Returns the ray normal to the surface at this intersection point. This normal ray will start at the intersection point, and its direction will be perpendicular to the tangent to the surface at this point.

Returns:
the ray normal to the surface at this intersection point.