Class Camera
java.lang.Object
xyz.jeremynoesen.pseudo3d.core.graphics.Camera
public class Camera
extends java.lang.Object
Camera used to determine where and how to render a Scene
-
Constructor Summary
Constructors Constructor Description Camera()
Create a new default CameraCamera(Camera camera)
Copy constructor for CameraCamera(Vector position, Vector offset, float sensorSize, float fieldOfView, float viewDistance, float zoom, float rotation)
Create a new Camera with set position, sensor size, field of view, view distance, zoom, rotation, and offset -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object o)
Check if a Camera is equal to this onefloat
getFieldOfView()
Get the field of view in degreesVector
getOffset()
Get the offset of the render from the center of the windowVector
getPosition()
Get the position of the Camera in the Scenefloat
getRotation()
Get the rotation of the Camerafloat
getSensorSize()
Get the sensor size of the Camera in pixelsfloat
getViewDistance()
Get the view distance for the Camerafloat
getZoom()
Get the zoom for the CameraCamera
setFieldOfView(float fieldOfView)
Set the Camera's field of viewCamera
setOffset(Vector offset)
Set the offset of the render from the center of the windowCamera
setPosition(Vector position)
Set the Camera's position in the SceneCamera
setRotation(float rotation)
Set the rotation of the CameraCamera
setSensorSize(float sensorSize)
Set the Camera sensor size in pixelsCamera
setViewDistance(float viewDistance)
Set the view distance for the CameraCamera
setZoom(float zoom)
Set the zoom for the CameraMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Camera
public Camera()Create a new default Camera -
Camera
public Camera(Vector position, Vector offset, float sensorSize, float fieldOfView, float viewDistance, float zoom, float rotation)Create a new Camera with set position, sensor size, field of view, view distance, zoom, rotation, and offset- Parameters:
position
- Camera position in ScenesensorSize
- Camera sensor sizefieldOfView
- Field of view in degreesviewDistance
- View distance in grid unitszoom
- Camera zoomrotation
- Rotation of Camera in degreesoffset
- Position of Camera in window
-
Camera
Copy constructor for Camera- Parameters:
camera
- Camera to copy
-
-
Method Details
-
getFieldOfView
public float getFieldOfView()Get the field of view in degrees- Returns:
- Field of view in degrees
-
setFieldOfView
Set the Camera's field of view- Parameters:
fieldOfView
- Field of view in degrees- Returns:
- This Camera
-
getPosition
Get the position of the Camera in the Scene- Returns:
- Position of the Camera in the Scene
-
setPosition
Set the Camera's position in the Scene- Parameters:
position
- Position Vector- Returns:
- This Camera
-
getOffset
Get the offset of the render from the center of the window- Returns:
- Render offset
-
setOffset
Set the offset of the render from the center of the window- Parameters:
offset
- Render offset in pixels- Returns:
- This Camera
-
getSensorSize
public float getSensorSize()Get the sensor size of the Camera in pixels- Returns:
- Sensor size in pixels
-
setSensorSize
Set the Camera sensor size in pixels- Parameters:
sensorSize
- New sensor size- Returns:
- This Camera
-
getViewDistance
public float getViewDistance()Get the view distance for the Camera- Returns:
- View distance
-
setViewDistance
Set the view distance for the Camera- Parameters:
viewDistance
- New view distance- Returns:
- This Camera
-
getZoom
public float getZoom()Get the zoom for the Camera- Returns:
- Zoom
-
setZoom
Set the zoom for the Camera- Parameters:
zoom
- New zoom- Returns:
- This Camera
-
getRotation
public float getRotation()Get the rotation of the Camera- Returns:
- Rotation of Camera in degrees counter-clock-wise
-
setRotation
Set the rotation of the Camera- Parameters:
rotation
- Rotation of Camera in degrees counter-clock-wise- Returns:
- This Camera
-
equals
public boolean equals(java.lang.Object o)Check if a Camera is equal to this one- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- Camera to check- Returns:
- True if the Camera is equal to this Camera
-