Class AbstractCamera

    • Field Detail

      • logger

        protected static final Logger.Log logger
      • angleEdgeRad

        protected float angleEdgeRad
        Angle from the center to the corner of the screen in scene coordinates, in radians
      • ar

        protected float ar
        Aspect ratio
      • distance

        protected double distance
        Distance of camera to center
      • closest

        protected IFocus closest
        Closest entity to camera
      • camera

        public com.badlogic.gdx.graphics.PerspectiveCamera camera
        The main camera
      • camLeft

        protected com.badlogic.gdx.graphics.PerspectiveCamera camLeft
        Stereoscopic mode cameras
      • camRight

        protected com.badlogic.gdx.graphics.PerspectiveCamera camRight
        Stereoscopic mode cameras
      • cameras

        protected com.badlogic.gdx.graphics.PerspectiveCamera[] cameras
        Vector with all perspective cameras
      • projection

        protected Matrix4d projection
      • fovFactor

        public float fovFactor
      • closestStar

        protected IStarFocus closestStar
        The closest star to the camera
    • Constructor Detail

      • AbstractCamera

        public AbstractCamera​(CameraManager parent)
    • Method Detail

      • updateAngleEdge

        public void updateAngleEdge​(int width,
                                    int height)
        Specified by:
        updateAngleEdge in interface ICamera
      • getAngleEdge

        public float getAngleEdge​(int width,
                                  int height,
                                  float angle)
      • getAngleEdge

        public float getAngleEdge()
        Description copied from interface: ICamera
        Gets the angle of the edge of the screen, diagonally. It assumes the vertical angle is the field of view and corrects the horizontal using the aspect ratio. It depends on the viewport size and the field of view itself.
        Specified by:
        getAngleEdge in interface ICamera
        Returns:
        The angle in radians.
      • render

        public void render​(int rw,
                           int rh)
        Specified by:
        render in interface ICamera
      • computeVisibleFovs

        protected boolean computeVisibleFovs​(CelestialBody cb,
                                             FovCamera fcamera)
        Returns true if a body with the given position is observed in any of the given directions using the given cone angle
        Parameters:
        cb - The body.
        fcamera - The FovCamera.
        Returns:
        True if the body is observed. False otherwise.
      • getDistance

        public double getDistance()
        Description copied from interface: ICamera
        Gets the distance from the camera to the centre of our reference frame (Sun)
        Specified by:
        getDistance in interface ICamera
        Returns:
        The distance
      • checkClosest

        public void checkClosest​(IFocus cb)
        Description copied from interface: ICamera
        Called after updating the body's distance to the cam, it updates the closest body in the camera to figure out the camera near
        Specified by:
        checkClosest in interface ICamera
        Parameters:
        cb - The body to check
      • copyParamsFrom

        public void copyParamsFrom​(AbstractCamera other)
      • getCameraStereoLeft

        public com.badlogic.gdx.graphics.PerspectiveCamera getCameraStereoLeft()
        Specified by:
        getCameraStereoLeft in interface ICamera
      • getCameraStereoRight

        public com.badlogic.gdx.graphics.PerspectiveCamera getCameraStereoRight()
        Specified by:
        getCameraStereoRight in interface ICamera
      • setCameraStereoLeft

        public void setCameraStereoLeft​(com.badlogic.gdx.graphics.PerspectiveCamera cam)
        Specified by:
        setCameraStereoLeft in interface ICamera
      • setCameraStereoRight

        public void setCameraStereoRight​(com.badlogic.gdx.graphics.PerspectiveCamera cam)
        Specified by:
        setCameraStereoRight in interface ICamera
      • updateFrustum

        public void updateFrustum​(Frustumd frustum,
                                  com.badlogic.gdx.graphics.PerspectiveCamera cam,
                                  Vector3d position,
                                  Vector3d direction,
                                  Vector3d up)
      • getClosestStar

        public IStarFocus getClosestStar()
        Description copied from interface: ICamera
        Gets the current closest star to this camera
        Specified by:
        getClosestStar in interface ICamera
        Returns:
        The closest star
      • setClosestStar

        public void setClosestStar​(IStarFocus star)
        Description copied from interface: ICamera
        Sets the current closest star to this camera. This will be only set if the given star is closer than the current.
        Specified by:
        setClosestStar in interface ICamera
        Parameters:
        star - The candidate star