Class RaytracingCamera


public class RaytracingCamera extends TexturedRectangle
Raytracing camera that renders a scene to a texture. It is represented on the scene as a textured rectangle showing the raytraced view.
  • Field Details

    • SIZE

      public static final int SIZE
      Size of the camera view in world units.
      See Also:
    • IMAGE_SIZE

      public static final int IMAGE_SIZE
      Size of the rendered image in pixels.
      See Also:
  • Constructor Details

    • RaytracingCamera

      public RaytracingCamera(Camera camera, double zoom)
      Creates a raytracing camera at the specified camera position.
      Parameters:
      camera - the camera to use for the view
      zoom - the zoom level
  • Method Details

    • getCameraView

      public CameraView getCameraView()
      Returns the camera view used for ray tracing.
      Returns:
      the camera view
    • getSprite

      public BufferedImage getSprite(String ref) throws IOException
      Loads a sprite image from the classpath.
      Parameters:
      ref - the resource path
      Returns:
      the loaded image
      Throws:
      IOException - if the image cannot be loaded