Package scene.camera
Class Camera
java.lang.Object
scene.camera.Camera
public class Camera extends java.lang.Object implements java.lang.Iterable<Pixel<Ray[]>>
-
Field Summary
Fields Modifier and Type Field Description scene.camera.SinglePixelGrid
sensor
ThePixelGrid
where all rays are shot from. -
Constructor Summary
Constructors Constructor Description Camera()
Default constructor for camera.Camera(CameraSettings settings)
Constructs a camera from the givenCameraSettings
. -
Method Summary
Modifier and Type Method Description java.util.Iterator<Pixel<Ray[]>>
iterator()
Point
position()
Gets the point where the camera is located.Resolution
resolution()
Gets the resolution of theCamera
.Camera
rotate(double pitch, double yaw, double roll)
Create a new camera which is a rotation of this one by the given anglespitch
,yaw
androll
.Camera
shift(NonZeroVector offset)
Create a new camera which is shifted by the givenNonZeroVector
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
sensor
public final scene.camera.SinglePixelGrid sensorThePixelGrid
where all rays are shot from.
-
-
Constructor Details
-
Camera
Constructs a camera from the givenCameraSettings
.- Parameters:
settings
- TheCameraSettings
containing the data necessary to create the camera.
-
Camera
public Camera()Default constructor for camera.
-
-
Method Details
-
resolution
Gets the resolution of theCamera
.- Returns:
- The resolution of the
Camera
.
-
position
Gets the point where the camera is located.- Returns:
- the
Point
where the camera is located.
-
shift
Create a new camera which is shifted by the givenNonZeroVector
.- Parameters:
offset
- TheNonZeroVector
by which to shift the camera.- Returns:
- A new
Camera
shifted by the givenNonZeroVector
.
-
rotate
Create a new camera which is a rotation of this one by the given anglespitch
,yaw
androll
.- Parameters:
pitch
- The angle in radians to rotate about the left-right axis.yaw
- The angle in radians to rotate about the up-down axis.roll
- The angle in radians to rotate about the front-back axis.- Returns:
- A new
Camera
rotated by the given angles.
-
iterator
-