Class RayTracer

java.lang.Object
rendering.raytracing.RayTracer
Direct Known Subclasses:
PhongRayTracer

public abstract class RayTracer
extends java.lang.Object
Classes which extend RayTracer are responsible for calculating the Colour at the intersections of a Ray in the Scene.
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected Scene scene
    The scene to trace each ray in.
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected RayTracer​(Scene scene)
    Construct a new RayTracer for the given Scene.
  • Method Summary

    Modifier and Type Method Description
    abstract Colour trace​(Ray ray)
    Trace the given ray to calculate the Colour that ray results in.
    Colour trace​(Ray... rays)
    Trace the given rays to calculate the average Colour the rays result in.

    Methods inherited from class java.lang.Object

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

    • scene

      protected final Scene scene
      The scene to trace each ray in.
  • Constructor Details

    • RayTracer

      protected RayTracer​(Scene scene)
      Construct a new RayTracer for the given Scene.
      Parameters:
      scene - The Scene to trace.
  • Method Details

    • trace

      public abstract Colour trace​(Ray ray)
      Trace the given ray to calculate the Colour that ray results in.
      Parameters:
      ray - The ray to trace in the scene.
      Returns:
      The Colour resulting from the trace of the ray.
    • trace

      public Colour trace​(Ray... rays)
      Trace the given rays to calculate the average Colour the rays result in.
      Parameters:
      rays - The rays to trace in the scene.
      Returns:
      The Colour resulting from the trace of the ray.