Module raytracer

Class RayList

java.lang.Object
de.grogra.ray.util.RayList

public final class RayList extends Object
This class represents a list of rays.
Author:
Ole Kniemeyer
  • Field Details

    • spectrumFactory

      public final Spectrum spectrumFactory
    • rays

      public Ray[] rays
      The array of light rays. The components with indices from 0 to size - 1 are the valid light rays.
  • Constructor Details

    • RayList

      public RayList()
    • RayList

      public RayList(int size)
    • RayList

      public RayList(Spectrum factory)
  • Method Details

    • setSize

      public void setSize(int size)
      Sets the size of the light ray array. The field size is set to size, and the array rays is enlarged if necessary so that it has length of at least size. If an enlargement is necessary, the existing array components are copied into the new array, and the newly added components are initialized with new instances of Ray.
      Parameters:
      size - the new size of the light ray array
    • getSize

      public int getSize()
    • size

      public int size()
    • clear

      public void clear()
    • lastRay

      public Ray lastRay()
    • nextRay

      public Ray nextRay()
    • appendRay

      public void appendRay(Ray lastRay)