Package scene.camera
Class CameraSettings
java.lang.Object
scene.camera.CameraSettings
public class CameraSettings
extends java.lang.Object
A settings class to simplify the construction of
Camera objects.-
Constructor Summary
Constructors Constructor Description CameraSettings()Default constructor for CameraSettings.CameraSettings(Camera camera)Construct a camera settings with the values of a givenCamera. -
Method Summary
Modifier and Type Method Description intantialiasing()Get the antialiasing level which will be used by the camera.CameraSettingsantialiasing(int antialiasing)Specify the level of antialiasing to be used by the camera.CameraSettingsdimensions(double width, double height)Specify the width and height of the view plane.doubledistance()Get the distance between theCameraand the view plane.CameraSettingsdistance(double distance)Specify the distance between theCameraand the view plane.NormalizedVectorfront()Get the direction theCamerawill be facing.CameraSettingsfront(NormalizedVector front)Specify the direction theCamerawill be facing.doubleheight()Get the height of the view plane.CameraSettingsheight(double height)Specify the height of the view plane.Pointposition()Get the position where theCamerawill be placed.CameraSettingsposition(Point position)Specify the position where theCamerawill be placed.Resolutionresolution()Get the resolution of theCamera.CameraSettingsresolution(java.lang.String resolution)Specify the resolution of theCamera.CameraSettingsresolution(Resolution resolution)Specify the resolution of theCamera.intsensorPixels()Get the number of pixels along the x and y axes of theCamera's sensor.CameraSettingssensorPixels(int sensorPixels)Specify the number of pixels along the x and y axes of theCamera's sensor.doublesensorSize()Get the size of the sensor of theCamera.CameraSettingssensorSize(double sensorSize)Specify the size of theCamera's sensor.NormalizedVectorup()Get the direction theCamerawill consider "up".CameraSettingsup(NormalizedVector up)Specify the direction theCamerawill consider "up".doublewidth()Get the width of the view plane.CameraSettingswidth(double width)Specify the width of the view plane.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
CameraSettings
public CameraSettings()Default constructor for CameraSettings. -
CameraSettings
Construct a camera settings with the values of a givenCamera.- Parameters:
camera- The camera to take the values from.
-
-
Method Details
-
position
Specify the position where theCamerawill be placed. Default is the origin.- Parameters:
position- ThePointwhere theCamerawill be placed.- Returns:
- This
CameraSettings.
-
position
Get the position where theCamerawill be placed.- Returns:
- The position where the
Camerawill be placed.
-
front
Specify the direction theCamerawill be facing. Default is the positive y-axis.- Parameters:
front- The direction theCamerawill be facing.- Returns:
- This
CameraSettings.
-
front
Get the direction theCamerawill be facing.- Returns:
- The direction the
Camerawill be facing.
-
up
Specify the direction theCamerawill consider "up". Default is the positive z-axis.- Parameters:
up- The direction to consider "up".- Returns:
- This
CameraSettings.
-
up
Get the direction theCamerawill consider "up".- Returns:
- The direction the
Camerawill consider "up".
-
width
Specify the width of the view plane. Default is 19.2 units.- Parameters:
width- The width of the view plane.- Returns:
- This
CameraSettings.
-
width
public double width()Get the width of the view plane.- Returns:
- This
CameraSettings.
-
height
Specify the height of the view plane. Default is 10.8 units.- Parameters:
height- The height of the view plane.- Returns:
- This
CameraSettings.
-
height
public double height()Get the height of the view plane.- Returns:
- The height of the view plane.
-
dimensions
Specify the width and height of the view plane. This is an alternative to callingwidth(double)andheight(double)separately.- Parameters:
width- The width of the view plane.height- The height of the view plane.- Returns:
- This
CameraSettings.
-
distance
Specify the distance between theCameraand the view plane. Default is 10 units.- Parameters:
distance- The distance between theCameraand the view plane.- Returns:
- This
CameraSettings.
-
distance
public double distance()Get the distance between theCameraand the view plane.- Returns:
- The distance between the
Cameraand the view plane.
-
resolution
Specify the resolution of theCamera. Default is 1080p.- Parameters:
resolution- The resolution of theCamera.- Returns:
- This
CameraSettings.
-
resolution
Specify the resolution of theCamera. Default is 1080p. This is an alternative to callingresolution(Resolution).- Parameters:
resolution- The resolution of theCamera.- Returns:
- This
CameraSettings.
-
resolution
Get the resolution of theCamera.- Returns:
- The resolution.
-
sensorSize
Specify the size of theCamera's sensor. The larger the size, the shorter the focal range.- Parameters:
sensorSize- The size for the sensor.- Returns:
- This
CameraSettings.
-
sensorSize
public double sensorSize()Get the size of the sensor of theCamera.- Returns:
- The sensor size.
-
sensorPixels
Specify the number of pixels along the x and y axes of theCamera's sensor.- Parameters:
sensorPixels- The number of pixels for the sensor.- Returns:
- This
CameraSettings.
-
sensorPixels
public int sensorPixels()Get the number of pixels along the x and y axes of theCamera's sensor.- Returns:
- The number of pixels for the sensor's x and y axes.
-
antialiasing
Specify the level of antialiasing to be used by the camera. 1 means no antialiasing, 2 is moderate, 3 gives in decent results with acceptable computation cost.- Parameters:
antialiasing- The level of antialiasing to be used by the camera.- Returns:
- This
CameraSettings.
-
antialiasing
public int antialiasing()Get the antialiasing level which will be used by the camera.- Returns:
- The antialiasing level.
-