public class EulerPerspectiveCamera
extends com.badlogic.gdx.graphics.Camera
Camera.direction are ignored completely. However, this field will be updated appropriately
whenever the other rotation-related properties are recalculated (e.g. forward and rotation).
Camera methods which modify Camera.direction will all throw UnsupportedOperationException.
Camera direction is solely controlled by the yaw and pitch attributes added by this class.
Modification of position and orientation should all be performed via the provided methods: turn, pitch, move, etc.
These methods handle updating the internal Quaternion rotations and forward/target vectors. Modifying
Camera.position directly may result in odd behaviour.
As per usual with Camera classes in libgdx, make sure to call update() after you've manipulated any
attributes of the camera (position, orientation, viewport size, etc).| Modifier and Type | Field and Description |
|---|---|
float |
fieldOfView |
| Constructor and Description |
|---|
EulerPerspectiveCamera(float fieldOfView,
float viewportWidth,
float viewportHeight) |
| Modifier and Type | Method and Description |
|---|---|
com.badlogic.gdx.math.Vector3 |
getForward() |
float |
getPitch() |
com.badlogic.gdx.math.Quaternion |
getRotation() |
float |
getYaw() |
void |
lookAt(float x,
float y,
float z) |
void |
lookAt(com.badlogic.gdx.math.Vector3 target) |
void |
move(com.badlogic.gdx.math.Vector3 offset) |
void |
moveTo(float x,
float y,
float z) |
void |
moveTo(com.badlogic.gdx.math.Vector3 position) |
void |
normalizeUp() |
void |
orient(float yawDegrees,
float pitchDegrees) |
void |
orientTo(float yawDegrees,
float pitchDegrees) |
void |
pitch(float degrees) |
void |
pitchTo(float degrees) |
void |
rotate(float angle,
float axisX,
float axisY,
float axisZ) |
void |
rotate(com.badlogic.gdx.math.Matrix4 transform) |
void |
rotate(com.badlogic.gdx.math.Quaternion quat) |
void |
rotate(com.badlogic.gdx.math.Vector3 axis,
float angle) |
void |
rotateAround(com.badlogic.gdx.math.Vector3 point,
com.badlogic.gdx.math.Vector3 axis,
float angle) |
void |
transform(com.badlogic.gdx.math.Matrix4 transform) |
void |
translate(float x,
float y,
float z) |
void |
translate(com.badlogic.gdx.math.Vector3 vec) |
void |
turn(float degrees) |
void |
turnTo(float degrees) |
void |
update() |
void |
update(boolean updateFrustum) |
public EulerPerspectiveCamera(float fieldOfView,
float viewportWidth,
float viewportHeight)
public float getYaw()
public float getPitch()
public com.badlogic.gdx.math.Vector3 getForward()
public com.badlogic.gdx.math.Quaternion getRotation()
public void turn(float degrees)
public void turnTo(float degrees)
public void pitch(float degrees)
public void pitchTo(float degrees)
public void orient(float yawDegrees,
float pitchDegrees)
public void orientTo(float yawDegrees,
float pitchDegrees)
public void move(com.badlogic.gdx.math.Vector3 offset)
public void moveTo(com.badlogic.gdx.math.Vector3 position)
public void moveTo(float x,
float y,
float z)
public void update()
update in class com.badlogic.gdx.graphics.Camerapublic void update(boolean updateFrustum)
update in class com.badlogic.gdx.graphics.Camerapublic void translate(com.badlogic.gdx.math.Vector3 vec)
translate in class com.badlogic.gdx.graphics.Camerapublic void translate(float x,
float y,
float z)
translate in class com.badlogic.gdx.graphics.Camerapublic void transform(com.badlogic.gdx.math.Matrix4 transform)
transform in class com.badlogic.gdx.graphics.Camerapublic void rotateAround(com.badlogic.gdx.math.Vector3 point,
com.badlogic.gdx.math.Vector3 axis,
float angle)
rotateAround in class com.badlogic.gdx.graphics.Camerapublic void rotate(com.badlogic.gdx.math.Quaternion quat)
rotate in class com.badlogic.gdx.graphics.Camerapublic void rotate(com.badlogic.gdx.math.Matrix4 transform)
rotate in class com.badlogic.gdx.graphics.Camerapublic void rotate(com.badlogic.gdx.math.Vector3 axis,
float angle)
rotate in class com.badlogic.gdx.graphics.Camerapublic void rotate(float angle,
float axisX,
float axisY,
float axisZ)
rotate in class com.badlogic.gdx.graphics.Camerapublic void normalizeUp()
normalizeUp in class com.badlogic.gdx.graphics.Camerapublic void lookAt(com.badlogic.gdx.math.Vector3 target)
lookAt in class com.badlogic.gdx.graphics.Camerapublic void lookAt(float x,
float y,
float z)
lookAt in class com.badlogic.gdx.graphics.CameraCopyright © 2022. All rights reserved.