Class Camera

  • All Implemented Interfaces:
    IOrientable

    public class Camera
    extends Frustum
    implements IOrientable
    The camera describes the eye point of the viewer looking at the scene.
    • Constructor Detail

      • Camera

        public Camera()
        Initializes a new instance of the Camera class.
      • Camera

        public Camera​(ProjectionType projectionType)
        Initializes a new instance of the Camera class.
        Parameters:
        projectionType - Projection type.
      • Camera

        public Camera​(java.lang.String name)
        Initializes a new instance of the Camera class.
        Parameters:
        name - Name.
      • Camera

        public Camera​(java.lang.String name,
                      ProjectionType projectionType)
        Initializes a new instance of the Camera class.
        Parameters:
        name - Name.
        projectionType - Projection type.
    • Method Detail

      • getApertureMode

        public ApertureMode getApertureMode()
        Gets the camera's aperture mode
      • setApertureMode

        public void setApertureMode​(ApertureMode value)
        Sets the camera's aperture mode
        Parameters:
        value - New value
      • setFieldOfView

        public void setFieldOfView​(double value)
        Sets the camera's field of view in degrees, this property is used only when ApertureMode is ApertureMode.HORIZONTAL or ApertureMode.VERTICAL
        Parameters:
        value - New value
      • getFieldOfViewX

        public double getFieldOfViewX()
        Gets the camera's horizontal field of view in degrees, this property is used only when ApertureMode is ApertureMode.HORIZ_AND_VERT
      • setFieldOfViewX

        public void setFieldOfViewX​(double value)
        Sets the camera's horizontal field of view in degrees, this property is used only when ApertureMode is ApertureMode.HORIZ_AND_VERT
        Parameters:
        value - New value
      • getFieldOfViewY

        public double getFieldOfViewY()
        Gets the camera's vertical field of view in degrees, this property is used only when ApertureMode is ApertureMode.HORIZ_AND_VERT
      • setFieldOfViewY

        public void setFieldOfViewY​(double value)
        Sets the camera's vertical field of view in degrees, this property is used only when ApertureMode is ApertureMode.HORIZ_AND_VERT
        Parameters:
        value - New value
      • getWidth

        public double getWidth()
        Gets the view plane's width measured in inches
      • setWidth

        public void setWidth​(double value)
        Sets the view plane's width measured in inches
        Parameters:
        value - New value
      • getHeight

        public double getHeight()
        Gets the view plane's height measured in inches
      • setHeight

        public void setHeight​(double value)
        Sets the view plane's height measured in inches
        Parameters:
        value - New value
      • getAspectRatio

        public double getAspectRatio()
        Gets the view plane aspect ratio.
      • setAspectRatio

        public void setAspectRatio​(double value)
        Sets the view plane aspect ratio.
        Parameters:
        value - New value
      • getMagnification

        public Vector2 getMagnification()
        Gets the maginification used in orthographic camera
      • setMagnification

        public void setMagnification​(Vector2 value)
        Sets the maginification used in orthographic camera
        Parameters:
        value - New value
      • getProjectionType

        public ProjectionType getProjectionType()
        Gets the camera's projection type. By default the perspective projection is used.
      • setProjectionType

        public void setProjectionType​(ProjectionType value)
        Sets the camera's projection type. By default the perspective projection is used.
        Parameters:
        value - New value
      • moveForward

        public void moveForward​(double distance)
        Move camera forward towards its direction or target.
        Parameters:
        distance - How long to move forward