Interface ICamera
-
- All Known Implementing Classes:
AbstractCamera
,CameraManager
,FovCamera
,NaturalCamera
,RelativisticCamera
,SpacecraftCamera
public interface ICamera
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkClosest(IFocus focus)
Called after updating the body's distance to the cam, it updates the closest body in the camera to figure out the camera nearvoid
computeGaiaScan(ITimeFrameProvider time, CelestialBody cb)
float
getAngleEdge()
Gets the angle of the edge of the screen, diagonally.com.badlogic.gdx.graphics.PerspectiveCamera
getCamera()
Returns the perspective camera.com.badlogic.gdx.graphics.PerspectiveCamera
getCameraStereoLeft()
com.badlogic.gdx.graphics.PerspectiveCamera
getCameraStereoRight()
IFocus
getClosest()
IFocus
getClosest2()
IStarFocus
getClosestStar()
Gets the current closest star to this cameraICamera
getCurrent()
Vector3d
getDirection()
Vector3d[]
getDirections()
double
getDistance()
Gets the distance from the camera to the centre of our reference frame (Sun)IFocus
getFocus()
Returns the foucs if anyfloat
getFovFactor()
com.badlogic.gdx.graphics.PerspectiveCamera[]
getFrontCameras()
Vector3d
getInversePos()
CameraManager
getManager()
CameraManager.CameraMode
getMode()
int
getNCameras()
Vector3d
getPos()
double
getSpeed()
Gets the current velocity of the camera in km/h.double
getTranslateUnits()
Vector3d
getUp()
Vector3d
getVelocity()
boolean
isFocus(IFocus cb)
Checks if this body is the current focusboolean
isVisible(ITimeFrameProvider time, double viewAngle, Vector3d pos, double distToCamera)
boolean
isVisible(ITimeFrameProvider time, CelestialBody cb)
void
render(int rw, int rh)
void
resize(int width, int height)
void
setCamera(com.badlogic.gdx.graphics.PerspectiveCamera cam)
Sets the active cameravoid
setCameraStereoLeft(com.badlogic.gdx.graphics.PerspectiveCamera cam)
void
setCameraStereoRight(com.badlogic.gdx.graphics.PerspectiveCamera cam)
void
setClosestStar(IStarFocus star)
Sets the current closest star to this camera.void
setDirection(Vector3d dir)
void
setPos(Vector3d pos)
void
update(double dt, ITimeFrameProvider time)
Updates the camera.void
updateAngleEdge(int width, int height)
void
updateMode(CameraManager.CameraMode mode, boolean centerFocus, boolean postEvent)
-
-
-
Method Detail
-
getCamera
com.badlogic.gdx.graphics.PerspectiveCamera getCamera()
Returns the perspective camera.- Returns:
- The perspective camera.
-
setCamera
void setCamera(com.badlogic.gdx.graphics.PerspectiveCamera cam)
Sets the active camera- Parameters:
cam
-
-
getCameraStereoLeft
com.badlogic.gdx.graphics.PerspectiveCamera getCameraStereoLeft()
-
getCameraStereoRight
com.badlogic.gdx.graphics.PerspectiveCamera getCameraStereoRight()
-
setCameraStereoLeft
void setCameraStereoLeft(com.badlogic.gdx.graphics.PerspectiveCamera cam)
-
setCameraStereoRight
void setCameraStereoRight(com.badlogic.gdx.graphics.PerspectiveCamera cam)
-
getFrontCameras
com.badlogic.gdx.graphics.PerspectiveCamera[] getFrontCameras()
-
getCurrent
ICamera getCurrent()
-
getFovFactor
float getFovFactor()
-
getPos
Vector3d getPos()
-
setPos
void setPos(Vector3d pos)
-
setDirection
void setDirection(Vector3d dir)
-
getInversePos
Vector3d getInversePos()
-
getDirection
Vector3d getDirection()
-
getVelocity
Vector3d getVelocity()
-
getUp
Vector3d getUp()
-
getDirections
Vector3d[] getDirections()
-
getNCameras
int getNCameras()
-
getTranslateUnits
double getTranslateUnits()
-
update
void update(double dt, ITimeFrameProvider time)
Updates the camera.- Parameters:
dt
- The time since the las frame in seconds.time
- The frame time provider (simulation time).
-
updateMode
void updateMode(CameraManager.CameraMode mode, boolean centerFocus, boolean postEvent)
-
getMode
CameraManager.CameraMode getMode()
-
updateAngleEdge
void updateAngleEdge(int width, int height)
-
getAngleEdge
float getAngleEdge()
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.- Returns:
- The angle in radians.
-
getManager
CameraManager getManager()
-
render
void render(int rw, int rh)
-
getSpeed
double getSpeed()
Gets the current velocity of the camera in km/h.- Returns:
- The velocity in km/h.
-
getDistance
double getDistance()
Gets the distance from the camera to the centre of our reference frame (Sun)- Returns:
- The distance
-
getFocus
IFocus getFocus()
Returns the foucs if any- Returns:
- The foucs object if it is in focus mode. Null otherwise
-
isFocus
boolean isFocus(IFocus cb)
Checks if this body is the current focus- Parameters:
cb
- The body- Returns:
- Whether the body is focus
-
checkClosest
void checkClosest(IFocus focus)
Called after updating the body's distance to the cam, it updates the closest body in the camera to figure out the camera near- Parameters:
focus
- The body to check
-
getClosest
IFocus getClosest()
-
getClosest2
IFocus getClosest2()
-
isVisible
boolean isVisible(ITimeFrameProvider time, CelestialBody cb)
-
isVisible
boolean isVisible(ITimeFrameProvider time, double viewAngle, Vector3d pos, double distToCamera)
-
computeGaiaScan
void computeGaiaScan(ITimeFrameProvider time, CelestialBody cb)
-
resize
void resize(int width, int height)
-
getClosestStar
IStarFocus getClosestStar()
Gets the current closest star to this camera- Returns:
- The closest star
-
setClosestStar
void setClosestStar(IStarFocus star)
Sets the current closest star to this camera. This will be only set if the given star is closer than the current.- Parameters:
star
- The candidate star
-
-