Class OrthographicCamera

java.lang.Object
rosequartz.gfx.Camera<OrthographicCamera>
rosequartz.gfx.OrthographicCamera
All Implemented Interfaces:
Serializable, Cloneable, CameraConfiguration.CameraConfigurationHolder

public final class OrthographicCamera extends Camera<OrthographicCamera> implements Serializable
Represents a camera with orthographic projection, primarily used in 2D games. All points of an object appear to be the same distance from the camera.
See Also:
Serialized Form
  • Field Details

    • left

      public float left
    • top

      public float top
    • bottom

      public float bottom
  • Constructor Details

    • OrthographicCamera

      public OrthographicCamera(CameraConfiguration configuration)
      Creates a new OrthographicCamera from a CameraConfiguration.
      Parameters:
      configuration - configuration of the camera
  • Method Details

    • setBounds

      public OrthographicCamera setBounds(float left, float right, float bottom, float top)
      Sets the bounds of the camera. The default bounds are left=-1, right=1, top=1, bottom=-1.
      Parameters:
      left - coordinate of the left edge of the camera
      right - coordinate of the right edge of the camera
      top - coordinate of the top edge of the camera
      bottom - coordinate of the bottom edge of the camera
      Returns:
      this
    • getProjectionMatrix

      public Mat4 getProjectionMatrix()
      Description copied from class: Camera
      Calculates the projection matrix for the current values of the camera.
      Specified by:
      getProjectionMatrix in class Camera<OrthographicCamera>
      Returns:
      projection matrix
    • clone

      public OrthographicCamera clone()
      Specified by:
      clone in class Camera<OrthographicCamera>
    • toString

      public String toString()
      Overrides:
      toString in class Object