java.lang.Object
xyz.jeremynoesen.pseudo3d.core.graphics.Camera

public class Camera
extends java.lang.Object
Camera used to determine where and how to render a Scene
  • Constructor Summary

    Constructors
    Constructor Description
    Camera()
    Create a new default Camera
    Camera​(Camera camera)
    Copy constructor for Camera
    Camera​(Vector position, Vector offset, float sensorSize, float fieldOfView, float viewDistance, float zoom, float rotation)
    Create a new Camera with set position, sensor size, field of view, view distance, zoom, rotation, and offset
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)
    Check if a Camera is equal to this one
    float getFieldOfView()
    Get the field of view in degrees
    Vector getOffset()
    Get the offset of the render from the center of the window
    Vector getPosition()
    Get the position of the Camera in the Scene
    float getRotation()
    Get the rotation of the Camera
    float getSensorSize()
    Get the sensor size of the Camera in pixels
    float getViewDistance()
    Get the view distance for the Camera
    float getZoom()
    Get the zoom for the Camera
    Camera setFieldOfView​(float fieldOfView)
    Set the Camera's field of view
    Camera setOffset​(Vector offset)
    Set the offset of the render from the center of the window
    Camera setPosition​(Vector position)
    Set the Camera's position in the Scene
    Camera setRotation​(float rotation)
    Set the rotation of the Camera
    Camera setSensorSize​(float sensorSize)
    Set the Camera sensor size in pixels
    Camera setViewDistance​(float viewDistance)
    Set the view distance for the Camera
    Camera setZoom​(float zoom)
    Set the zoom for the Camera

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Camera

      public Camera()
      Create a new default Camera
    • Camera

      public Camera​(Vector position, Vector offset, float sensorSize, float fieldOfView, float viewDistance, float zoom, float rotation)
      Create a new Camera with set position, sensor size, field of view, view distance, zoom, rotation, and offset
      Parameters:
      position - Camera position in Scene
      sensorSize - Camera sensor size
      fieldOfView - Field of view in degrees
      viewDistance - View distance in grid units
      zoom - Camera zoom
      rotation - Rotation of Camera in degrees
      offset - Position of Camera in window
    • Camera

      public Camera​(Camera camera)
      Copy constructor for Camera
      Parameters:
      camera - Camera to copy
  • Method Details

    • getFieldOfView

      public float getFieldOfView()
      Get the field of view in degrees
      Returns:
      Field of view in degrees
    • setFieldOfView

      public Camera setFieldOfView​(float fieldOfView)
      Set the Camera's field of view
      Parameters:
      fieldOfView - Field of view in degrees
      Returns:
      This Camera
    • getPosition

      public Vector getPosition()
      Get the position of the Camera in the Scene
      Returns:
      Position of the Camera in the Scene
    • setPosition

      public Camera setPosition​(Vector position)
      Set the Camera's position in the Scene
      Parameters:
      position - Position Vector
      Returns:
      This Camera
    • getOffset

      public Vector getOffset()
      Get the offset of the render from the center of the window
      Returns:
      Render offset
    • setOffset

      public Camera setOffset​(Vector offset)
      Set the offset of the render from the center of the window
      Parameters:
      offset - Render offset in pixels
      Returns:
      This Camera
    • getSensorSize

      public float getSensorSize()
      Get the sensor size of the Camera in pixels
      Returns:
      Sensor size in pixels
    • setSensorSize

      public Camera setSensorSize​(float sensorSize)
      Set the Camera sensor size in pixels
      Parameters:
      sensorSize - New sensor size
      Returns:
      This Camera
    • getViewDistance

      public float getViewDistance()
      Get the view distance for the Camera
      Returns:
      View distance
    • setViewDistance

      public Camera setViewDistance​(float viewDistance)
      Set the view distance for the Camera
      Parameters:
      viewDistance - New view distance
      Returns:
      This Camera
    • getZoom

      public float getZoom()
      Get the zoom for the Camera
      Returns:
      Zoom
    • setZoom

      public Camera setZoom​(float zoom)
      Set the zoom for the Camera
      Parameters:
      zoom - New zoom
      Returns:
      This Camera
    • getRotation

      public float getRotation()
      Get the rotation of the Camera
      Returns:
      Rotation of Camera in degrees counter-clock-wise
    • setRotation

      public Camera setRotation​(float rotation)
      Set the rotation of the Camera
      Parameters:
      rotation - Rotation of Camera in degrees counter-clock-wise
      Returns:
      This Camera
    • equals

      public boolean equals​(java.lang.Object o)
      Check if a Camera is equal to this one
      Overrides:
      equals in class java.lang.Object
      Parameters:
      o - Camera to check
      Returns:
      True if the Camera is equal to this Camera