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.SinglePixelGridsensorThePixelGridwhere 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()Pointposition()Gets the point where the camera is located.Resolutionresolution()Gets the resolution of theCamera.Camerarotate(double pitch, double yaw, double roll)Create a new camera which is a rotation of this one by the given anglespitch,yawandroll.Camerashift(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, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
sensor
public final scene.camera.SinglePixelGrid sensorThePixelGridwhere all rays are shot from.
-
-
Constructor Details
-
Camera
Constructs a camera from the givenCameraSettings.- Parameters:
settings- TheCameraSettingscontaining 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
Pointwhere the camera is located.
-
shift
Create a new camera which is shifted by the givenNonZeroVector.- Parameters:
offset- TheNonZeroVectorby which to shift the camera.- Returns:
- A new
Camerashifted by the givenNonZeroVector.
-
rotate
Create a new camera which is a rotation of this one by the given anglespitch,yawandroll.- 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
Camerarotated by the given angles.
-
iterator
-