Package rosequartz.gfx
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCamera(CameraConfiguration configuration)Creates a new Camera from a CameraConfiguration -
Method Summary
Modifier and TypeMethodDescriptionabstract Cclone()Gets the used camera configuration.abstract Mat4Calculates the projection matrix for the current values of the camera.Calculates the projection-view matrix for the current values of the camera.Calculates the view matrix for the current values of the camera.setClipPlanes(float near, float far)Sets the distances of the clip planes to the camera.voidsetConfiguration(CameraConfiguration configuration)Sets the used camera configuration.
-
Field Details
-
nearPlane
public float nearPlane -
farPlane
public float farPlane
-
-
Constructor Details
-
Camera
Creates a new Camera from a CameraConfiguration- Parameters:
configuration- configuration of the camera
-
-
Method Details
-
setClipPlanes
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 camerafar- far clip plane distance to the camera- Returns:
- this
-
getProjectionMatrix
Calculates the projection matrix for the current values of the camera.- Returns:
- projection matrix
-
getViewMatrix
Calculates the view matrix for the current values of the camera.- Returns:
- view matrix
-
getProjectionViewMatrix
Calculates the projection-view matrix for the current values of the camera.- Returns:
- projection-view matrix
-
setConfiguration
Description copied from interface:CameraConfiguration.CameraConfigurationHolderSets the used camera configuration.- Specified by:
setConfigurationin interfaceCameraConfiguration.CameraConfigurationHolder- Parameters:
configuration- camera configuration
-
getConfiguration
Description copied from interface:CameraConfiguration.CameraConfigurationHolderGets the used camera configuration.- Specified by:
getConfigurationin interfaceCameraConfiguration.CameraConfigurationHolder- Returns:
- camera configuration
-
clone
-