Class AbstractIntersection
java.lang.Object
Intersection
AbstractIntersection
public abstract class AbstractIntersection
- extends Intersection
Partial implementation of Intersection interface.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractIntersection
public AbstractIntersection(Ray incident,
double distance)
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