Package geometries

Class Intersection

java.lang.Object
geometries.Intersection

public class Intersection
extends java.lang.Object
This class represents an intersection between a ray and a geometry.
  • Field Summary

    Fields
    Modifier and Type Field Description
    Geometry geometry
    The geometry which the ray intersects.
    Point point
    The point at which the intersection occurs.
  • Constructor Summary

    Constructors
    Constructor Description
    Intersection​(Geometry geometry, Point point)
    Construct an intersection at some point with some geometry.
  • Method Summary

    Modifier and Type Method Description
    NormalizedVector normal()
    Calculate the normal of the intersected geometry at the intersection point.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • geometry

      public final Geometry geometry
      The geometry which the ray intersects.
    • point

      public final Point point
      The point at which the intersection occurs.
  • Constructor Details

    • Intersection

      public Intersection​(Geometry geometry, Point point)
      Construct an intersection at some point with some geometry.
      Parameters:
      geometry - The geometry which the ray intersects.
      point - The point at which the intersection occurs.
  • Method Details

    • normal

      public NormalizedVector normal()
      Calculate the normal of the intersected geometry at the intersection point.
      Returns:
      The normal of the intersection.