Package scene.camera

Class CameraSettings

java.lang.Object
scene.camera.CameraSettings

public class CameraSettings
extends java.lang.Object
A settings class to simplify the construction of Camera objects.
  • Constructor Details

    • CameraSettings

      public CameraSettings()
      Default constructor for CameraSettings.
    • CameraSettings

      public CameraSettings​(Camera camera)
      Construct a camera settings with the values of a given Camera.
      Parameters:
      camera - The camera to take the values from.
  • Method Details

    • position

      public CameraSettings position​(Point position)
      Specify the position where the Camera will be placed. Default is the origin.
      Parameters:
      position - The Point where the Camera will be placed.
      Returns:
      This CameraSettings.
    • position

      public Point position()
      Get the position where the Camera will be placed.
      Returns:
      The position where the Camera will be placed.
    • front

      public CameraSettings front​(NormalizedVector front)
      Specify the direction the Camera will be facing. Default is the positive y-axis.
      Parameters:
      front - The direction the Camera will be facing.
      Returns:
      This CameraSettings.
    • front

      public NormalizedVector front()
      Get the direction the Camera will be facing.
      Returns:
      The direction the Camera will be facing.
    • up

      public CameraSettings up​(NormalizedVector up)
      Specify the direction the Camera will consider "up". Default is the positive z-axis.
      Parameters:
      up - The direction to consider "up".
      Returns:
      This CameraSettings.
    • up

      public NormalizedVector up()
      Get the direction the Camera will consider "up".
      Returns:
      The direction the Camera will consider "up".
    • width

      public CameraSettings width​(double width)
      Specify the width of the view plane. Default is 19.2 units.
      Parameters:
      width - The width of the view plane.
      Returns:
      This CameraSettings.
    • width

      public double width()
      Get the width of the view plane.
      Returns:
      This CameraSettings.
    • height

      public CameraSettings height​(double height)
      Specify the height of the view plane. Default is 10.8 units.
      Parameters:
      height - The height of the view plane.
      Returns:
      This CameraSettings.
    • height

      public double height()
      Get the height of the view plane.
      Returns:
      The height of the view plane.
    • dimensions

      public CameraSettings dimensions​(double width, double height)
      Specify the width and height of the view plane. This is an alternative to calling width(double) and height(double) separately.
      Parameters:
      width - The width of the view plane.
      height - The height of the view plane.
      Returns:
      This CameraSettings.
    • distance

      public CameraSettings distance​(double distance)
      Specify the distance between the Camera and the view plane. Default is 10 units.
      Parameters:
      distance - The distance between the Camera and the view plane.
      Returns:
      This CameraSettings.
    • distance

      public double distance()
      Get the distance between the Camera and the view plane.
      Returns:
      The distance between the Camera and the view plane.
    • resolution

      public CameraSettings resolution​(Resolution resolution)
      Specify the resolution of the Camera. Default is 1080p.
      Parameters:
      resolution - The resolution of the Camera.
      Returns:
      This CameraSettings.
    • resolution

      public CameraSettings resolution​(java.lang.String resolution)
      Specify the resolution of the Camera. Default is 1080p. This is an alternative to calling resolution(Resolution).
      Parameters:
      resolution - The resolution of the Camera.
      Returns:
      This CameraSettings.
    • resolution

      public Resolution resolution()
      Get the resolution of the Camera.
      Returns:
      The resolution.
    • sensorSize

      public CameraSettings sensorSize​(double sensorSize)
      Specify the size of the Camera's sensor. The larger the size, the shorter the focal range.
      Parameters:
      sensorSize - The size for the sensor.
      Returns:
      This CameraSettings.
    • sensorSize

      public double sensorSize()
      Get the size of the sensor of the Camera.
      Returns:
      The sensor size.
    • sensorPixels

      public CameraSettings sensorPixels​(int sensorPixels)
      Specify the number of pixels along the x and y axes of the Camera's sensor.
      Parameters:
      sensorPixels - The number of pixels for the sensor.
      Returns:
      This CameraSettings.
    • sensorPixels

      public int sensorPixels()
      Get the number of pixels along the x and y axes of the Camera's sensor.
      Returns:
      The number of pixels for the sensor's x and y axes.
    • antialiasing

      public CameraSettings antialiasing​(int antialiasing)
      Specify the level of antialiasing to be used by the camera. 1 means no antialiasing, 2 is moderate, 3 gives in decent results with acceptable computation cost.
      Parameters:
      antialiasing - The level of antialiasing to be used by the camera.
      Returns:
      This CameraSettings.
    • antialiasing

      public int antialiasing()
      Get the antialiasing level which will be used by the camera.
      Returns:
      The antialiasing level.