APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.graphics

public Class PerspectiveCamera

extends Camera
Class Inheritance
Imports
com.badlogic.gdx.math.Matrix4, .Vector3

A Camera with perspective projection.
Author
mzechner

Field Summary

Modifier and TypeField and Description
public float
fieldOfView

the field of view of the height, in degrees

pack-priv final Vector3
Inherited from com.badlogic.gdx.graphics.Camera:
combineddirectionfarfrustuminvProjectionViewnearpositionprojectionupviewviewportHeightviewportWidth

Constructor Summary

AccessConstructor and Description
public
public
PerspectiveCamera(float
the field of view of the height, in degrees, the field of view for the width will be calculated according to the aspect ratio.
fieldOfViewY
,
float
the viewport width
viewportWidth
,
float
the viewport height
viewportHeight
)

Constructs a new PerspectiveCamera with the given field of view and viewport size.

Method Summary

Modifier and TypeMethod and Description
public void
update()

Implements abstract com.badlogic.gdx.graphics.Camera.update.

Recalculates the projection and view matrix of this camera and the Frustum planes.

public void
update(boolean updateFrustum)

Implements abstract com.badlogic.gdx.graphics.Camera.update.

Recalculates the projection and view matrix of this camera and the Frustum planes if updateFrustum is true.

Inherited from com.badlogic.gdx.graphics.Camera:
getPickRaygetPickRaylookAtlookAtnormalizeUpprojectprojectrotaterotaterotaterotaterotateAroundtransformtranslatetranslateunprojectunproject

Field Detail

fieldOfViewback to summary
public float fieldOfView

the field of view of the height, in degrees

tmpback to summary
pack-priv final Vector3 tmp

Constructor Detail

PerspectiveCameraback to summary
public PerspectiveCamera()
PerspectiveCameraback to summary
public PerspectiveCamera(float fieldOfViewY, float viewportWidth, float viewportHeight)

Constructs a new PerspectiveCamera with the given field of view and viewport size. The aspect ratio is derived from the viewport size.

Parameters
fieldOfViewY:float

the field of view of the height, in degrees, the field of view for the width will be calculated according to the aspect ratio.

viewportWidth:float

the viewport width

viewportHeight:float

the viewport height

Method Detail

updateback to summary
public void update()

Implements abstract com.badlogic.gdx.graphics.Camera.update.

Doc from com.badlogic.gdx.graphics.Camera.update.

Recalculates the projection and view matrix of this camera and the Frustum planes. Use this after you've manipulated any of the attributes of the camera.

Annotations
@Override
updateback to summary
public void update(boolean updateFrustum)

Implements abstract com.badlogic.gdx.graphics.Camera.update.

Doc from com.badlogic.gdx.graphics.Camera.update.

Recalculates the projection and view matrix of this camera and the Frustum planes if updateFrustum is true. Use this after you've manipulated any of the attributes of the camera.

Annotations
@Override