Class Camera<C extends Camera<C>>

java.lang.Object
rosequartz.gfx.Camera<C>
Type Parameters:
C - the type of the subclass (used for returning 'this')
All Implemented Interfaces:
Serializable, Cloneable, CameraConfiguration.CameraConfigurationHolder
Direct Known Subclasses:
OrthographicCamera, PerspectiveCamera

public abstract class Camera<C extends Camera<C>> extends Object implements CameraConfiguration.CameraConfigurationHolder, Serializable, Cloneable
Represents a game camera, responsible for calculating the needed transformations for your vertex positions.
See Also:
Serialized Form
  • Field Details

    • nearPlane

      public float nearPlane
    • farPlane

      public float farPlane
  • Constructor Details

    • Camera

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

    • setClipPlanes

      public C setClipPlanes(float near, float far)
      Sets the distances of the clip planes to the camera. The default values are near=0.1, far=100.
      Parameters:
      near - near clip plane distance to the camera
      far - far clip plane distance to the camera
      Returns:
      this
    • getProjectionMatrix

      public abstract Mat4 getProjectionMatrix()
      Calculates the projection matrix for the current values of the camera.
      Returns:
      projection matrix
    • getViewMatrix

      public Mat4 getViewMatrix()
      Calculates the view matrix for the current values of the camera.
      Returns:
      view matrix
    • getProjectionViewMatrix

      public Mat4 getProjectionViewMatrix()
      Calculates the projection-view matrix for the current values of the camera.
      Returns:
      projection-view matrix
    • setConfiguration

      public void setConfiguration(CameraConfiguration configuration)
      Description copied from interface: CameraConfiguration.CameraConfigurationHolder
      Sets the used camera configuration.
      Specified by:
      setConfiguration in interface CameraConfiguration.CameraConfigurationHolder
      Parameters:
      configuration - camera configuration
    • getConfiguration

      public CameraConfiguration getConfiguration()
      Description copied from interface: CameraConfiguration.CameraConfigurationHolder
      Gets the used camera configuration.
      Specified by:
      getConfiguration in interface CameraConfiguration.CameraConfigurationHolder
      Returns:
      camera configuration
    • clone

      public abstract C clone()
      Overrides:
      clone in class Object