Package geometries

Class Geometry

java.lang.Object
geometries.Geometry
All Implemented Interfaces:
Intersectible
Direct Known Subclasses:
Cylinder, Plane, Polygon, Sphere, Tube

public abstract class Geometry
extends java.lang.Object
implements Intersectible
Represents a three dimensional shape
  • Field Summary

    Fields
    Modifier and Type Field Description
    Material material
    The material of this geometry.
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected Geometry​(Material material)
    Construct a new Geometry with the given material.
  • Method Summary

    Modifier and Type Method Description
    protected Intersection intersection​(Point point)
    Create an intersection object with this geometry and the given Point.
    abstract NormalizedVector normal​(Point point)
    Calculates the normal to the Geometry at the given Point.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface geometries.Intersectible

    boundary, intersect
  • Field Details

    • material

      public final Material material
      The material of this geometry.
  • Constructor Details

    • Geometry

      protected Geometry​(Material material)
      Construct a new Geometry with the given material.
      Parameters:
      material - The Material the geometry is made from.
  • Method Details

    • normal

      public abstract NormalizedVector normal​(Point point)
      Calculates the normal to the Geometry at the given Point. If the given Point is not on the surface of the Geometry the resulting behaviour is undefined.
      Parameters:
      point - The Point at which to calculate the normal.
      Returns:
      A NormalizedVector perpendicular to the surface of the shape at the given Point.
    • intersection

      protected Intersection intersection​(Point point)
      Create an intersection object with this geometry and the given Point.
      Parameters:
      point - The point at which the intersection occurs.
      Returns:
      An Intersection with this geometry at the given point.