Package com.badlogic.gdx.graphics
Class PerspectiveCamera
- java.lang.Object
-
- com.badlogic.gdx.graphics.Camera
-
- com.badlogic.gdx.graphics.PerspectiveCamera
-
public class PerspectiveCamera extends Camera
A Camera with perspective projection.
-
-
Field Summary
Fields Modifier and Type Field Description float
fieldOfView
the field of view of the height, in degrees-
Fields inherited from class com.badlogic.gdx.graphics.Camera
combined, direction, far, frustum, invProjectionView, near, position, projection, up, view, viewportHeight, viewportWidth
-
-
Constructor Summary
Constructors Constructor Description PerspectiveCamera()
PerspectiveCamera(float fieldOfViewY, float viewportWidth, float viewportHeight)
Constructs a newPerspectiveCamera
with the given field of view and viewport size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
update()
Recalculates the projection and view matrix of this camera and theFrustum
planes.void
update(boolean updateFrustum)
Recalculates the projection and view matrix of this camera and theFrustum
planes ifupdateFrustum
is true.-
Methods inherited from class com.badlogic.gdx.graphics.Camera
getPickRay, getPickRay, lookAt, lookAt, normalizeUp, project, project, rotate, rotate, rotate, rotate, rotateAround, transform, translate, translate, unproject, unproject
-
-
-
-
Constructor Detail
-
PerspectiveCamera
public PerspectiveCamera()
-
PerspectiveCamera
public PerspectiveCamera(float fieldOfViewY, float viewportWidth, float viewportHeight)
Constructs a newPerspectiveCamera
with the given field of view and viewport size. The aspect ratio is derived from the viewport size.- Parameters:
fieldOfViewY
- 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
- the viewport widthviewportHeight
- the viewport height
-
-
Method Detail
-
update
public void update()
Description copied from class:Camera
Recalculates the projection and view matrix of this camera and theFrustum
planes. Use this after you've manipulated any of the attributes of the camera.
-
-