public class Camera
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
float |
xPos |
float |
xUp |
float |
xView |
float |
yPos |
float |
yUp |
float |
yView |
float |
zPos |
float |
zUp |
float |
zView |
Constructor and Description |
---|
Camera() |
Modifier and Type | Method and Description |
---|---|
float[] |
getLocationUpVector()
Returns an array of the camera's zoom coordinates
|
float[] |
getLocationVector()
Returns an array of the camera's position coordinates
|
float[] |
getLocationViewVector()
Returns an array of the camera's view coordinates
|
boolean |
hasChanged()
Let's us know if any of the camera's values have changed
|
void |
moveCameraXY(float tx,
float ty)
Pans the camera across the model
|
void |
moveCameraZ(float direction)
Calculates how far away the camera should be from the 3D model
|
void |
setChanged(boolean changed)
Used to indicate whether or not we want to let other objects
know the camera's value has changed
|
public float xPos
public float yPos
public float zPos
public float xView
public float yView
public float zView
public float xUp
public float yUp
public float zUp
public void moveCameraZ(float direction)
direction
- The zoom factor - (+) indicates moving towards the model
(-) indicates moving away from the modelpublic void moveCameraXY(float tx, float ty)
tx
- The x-translation, in screen pixel spacety
- The y-translation, in screen pixel spacepublic float[] getLocationVector()
public float[] getLocationViewVector()
public float[] getLocationUpVector()
public boolean hasChanged()
public void setChanged(boolean changed)
changed
- What the "changed" field should be set to