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 int
antialiasing()
Get the antialiasing level which will be used by the camera.CameraSettings
antialiasing(int antialiasing)
Specify the level of antialiasing to be used by the camera.CameraSettings
dimensions(double width, double height)
Specify the width and height of the view plane.double
distance()
Get the distance between theCamera
and the view plane.CameraSettings
distance(double distance)
Specify the distance between theCamera
and the view plane.NormalizedVector
front()
Get the direction theCamera
will be facing.CameraSettings
front(NormalizedVector front)
Specify the direction theCamera
will be facing.double
height()
Get the height of the view plane.CameraSettings
height(double height)
Specify the height of the view plane.Point
position()
Get the position where theCamera
will be placed.CameraSettings
position(Point position)
Specify the position where theCamera
will be placed.Resolution
resolution()
Get the resolution of theCamera
.CameraSettings
resolution(java.lang.String resolution)
Specify the resolution of theCamera
.CameraSettings
resolution(Resolution resolution)
Specify the resolution of theCamera
.int
sensorPixels()
Get the number of pixels along the x and y axes of theCamera
's sensor.CameraSettings
sensorPixels(int sensorPixels)
Specify the number of pixels along the x and y axes of theCamera
's sensor.double
sensorSize()
Get the size of the sensor of theCamera
.CameraSettings
sensorSize(double sensorSize)
Specify the size of theCamera
's sensor.NormalizedVector
up()
Get the direction theCamera
will consider "up".CameraSettings
up(NormalizedVector up)
Specify the direction theCamera
will consider "up".double
width()
Get the width of the view plane.CameraSettings
width(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 theCamera
will be placed. Default is the origin.- Parameters:
position
- ThePoint
where theCamera
will be placed.- Returns:
- This
CameraSettings
.
-
position
Get the position where theCamera
will be placed.- Returns:
- The position where the
Camera
will be placed.
-
front
Specify the direction theCamera
will be facing. Default is the positive y-axis.- Parameters:
front
- The direction theCamera
will be facing.- Returns:
- This
CameraSettings
.
-
front
Get the direction theCamera
will be facing.- Returns:
- The direction the
Camera
will be facing.
-
up
Specify the direction theCamera
will consider "up". Default is the positive z-axis.- Parameters:
up
- The direction to consider "up".- Returns:
- This
CameraSettings
.
-
up
Get the direction theCamera
will consider "up".- Returns:
- The direction the
Camera
will 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 theCamera
and the view plane. Default is 10 units.- Parameters:
distance
- The distance between theCamera
and the view plane.- Returns:
- This
CameraSettings
.
-
distance
public double distance()Get the distance between theCamera
and the view plane.- Returns:
- The distance between the
Camera
and 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.
-