Class AbstractCamera

    • Field Detail

      • logger

        protected static final Logger.Log logger
      • CAM_FAR

        public double CAM_FAR
        Camera far value
      • CAM_NEAR

        public double CAM_NEAR
        Camera near value
      • 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
      • camera

        public camera
        The main camera
      • camLeft

        protected camLeft
        Stereoscopic mode cameras
      • camRight

        protected camRight
        Stereoscopic mode cameras
      • cameras

        protected[] cameras
        Vector with all perspective cameras
      • projection

        protected Matrix4d projection
      • fovFactor

        public float fovFactor
      • closestBody

        protected IFocus closestBody
        Closest non-star body to the camera
      • closestStar

        protected IFocus closestStar
        The closest particle to the camera
      • prevCombined

        protected com.badlogic.gdx.math.Matrix4 prevCombined
    • 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
        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
        cb - The body.
        fcamera - The FovCamera.
        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
        The distance
      • copyParamsFrom

        public void copyParamsFrom​(AbstractCamera other)
      • getCameraStereoLeft

        public getCameraStereoLeft()
        Specified by:
        getCameraStereoLeft in interface ICamera
      • getCameraStereoRight

        public getCameraStereoRight()
        Specified by:
        getCameraStereoRight in interface ICamera
      • setCameraStereoLeft

        public void setCameraStereoLeft​( cam)
        Specified by:
        setCameraStereoLeft in interface ICamera
      • setCameraStereoRight

        public void setCameraStereoRight​( cam)
        Specified by:
        setCameraStereoRight in interface ICamera
      • update

        public void update​( cam,
                           Vector3d position,
                           Vector3d direction,
                           Vector3d up)
      • checkClosestBody

        public void checkClosestBody​(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:
        checkClosestBody in interface ICamera
        cb - The body to check
      • getClosestParticle

        public IFocus getClosestParticle()
        Description copied from interface: ICamera
        Gets the current closest particle to this camera
        Specified by:
        getClosestParticle in interface ICamera
        The closest particle
      • checkClosestParticle

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

        public IFocus getClosest()
        Description copied from interface: ICamera
        Returns the current closest object
        Specified by:
        getClosest in interface ICamera
      • setClosest

        public void setClosest​(IFocus focus)
        Description copied from interface: ICamera
        Sets the closest of all
        Specified by:
        setClosest in interface ICamera
        focus - The new closest object
      • setFrustumPlanes

        protected void setFrustumPlanes​( cam)
      • getNear

        public double getNear()
        Specified by:
        getNear in interface ICamera
      • getFar

        public double getFar()
        Specified by:
        getFar in interface ICamera
      • getProjView

        public com.badlogic.gdx.math.Matrix4 getProjView()
        Specified by:
        getProjView in interface ICamera
      • getPreviousProjView

        public com.badlogic.gdx.math.Matrix4 getPreviousProjView()
        Specified by:
        getPreviousProjView in interface ICamera
      • setPreviousProjView

        public void setPreviousProjView​(com.badlogic.gdx.math.Matrix4 mat)
        Specified by:
        setPreviousProjView in interface ICamera