Package gaiasky.scenegraph.camera
Class FovCamera
java.lang.Object
gaiasky.scenegraph.camera.AbstractCamera
gaiasky.scenegraph.camera.FovCamera
The field of view cameras
-
Field Summary
Modifier and TypeFieldDescriptionlong
Vector3d[]
int
long
float
long
time that has to pass with the current scan rate so that we scan to the edge of the current field of view.Fields inherited from class gaiasky.scenegraph.camera.AbstractCamera
angleEdgeRad, ar, CAM_FAR, CAM_NEAR, camera, cameras, camLeft, camRight, closest, closestBody, closestStar, combined, distance, fovFactor, frustumd, logger, parent, pos, posinv, prevCombined, prevpos, projection, proximity, shift, tmp, view
-
Constructor Summary
ConstructorDescriptionFovCamera(com.badlogic.gdx.assets.AssetManager assetManager, CameraManager parent)
-
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.graphics.PerspectiveCamera
Returns the perspective camera.Vector3d[]
Vector3d[]
getDirections(Date d)
getFocus()
Returns the foucs if anyfloat
com.badlogic.gdx.graphics.PerspectiveCamera[]
getMode()
int
double
getSpeed()
Gets the current velocity of the camera in km/h.getUp()
void
initialize(com.badlogic.gdx.assets.AssetManager assetManager)
boolean
Checks if this body is the current focusboolean
isVisible(CelestialBody cb)
void
void
render(int rw, int rh)
void
resize(int width, int height)
void
setCamera(com.badlogic.gdx.graphics.PerspectiveCamera cam)
Sets the active cameravoid
setDirection(Vector3d dir)
double
void
update(double dt, ITimeFrameProvider time)
Updates the camera.void
updateAngleEdge(int width, int height)
We have fixed field of view angles and thus fixed aspect ratio.void
Updates both FOVs' directions applying the right transformation.void
updateMode(ICamera previousCam, CameraManager.CameraMode previousMode, CameraManager.CameraMode newMode, boolean centerFocus, boolean postEvent)
Methods inherited from class gaiasky.scenegraph.camera.AbstractCamera
checkClosestBody, checkClosestParticle, computeVisibleFovs, copyParamsFrom, getAngleEdge, getAngleEdge, getCameraStereoLeft, getCameraStereoRight, getCloseLightSource, getClosest, getClosestBody, getClosestParticle, getCurrent, getDistance, getFar, getInversePos, getManager, getNear, getPos, getPreviousPos, getPreviousProjView, getProjView, getSecondClosestBody, getShift, getVelocity, isVisible, isVisible, setCameraStereoLeft, setCameraStereoRight, setClosest, setFrustumPlanes, setPos, setPos, setPreviousPos, setPreviousPos, setPreviousProjView, setShift, swapBuffers, update, updateFrustumPlanes
-
Field Details
-
MAX_OVERLAP_TIME
public long MAX_OVERLAP_TIMEtime that has to pass with the current scan rate so that we scan to the edge of the current field of view. -
MAX_OVERLAP_ANGLE
public float MAX_OVERLAP_ANGLE -
gaia
-
directions
-
interpolatedDirections
-
currentTime
public long currentTime -
lastTime
public long lastTime -
dirindex
public int dirindex
-
-
Constructor Details
-
FovCamera
-
-
Method Details
-
initialize
public void initialize(com.badlogic.gdx.assets.AssetManager assetManager) -
update
Description copied from interface:ICamera
Updates the camera. -
updateDirections
Updates both FOVs' directions applying the right transformation.- Parameters:
time
-
-
getDirections
-
getFrontCameras
public com.badlogic.gdx.graphics.PerspectiveCamera[] getFrontCameras()- Specified by:
getFrontCameras
in interfaceICamera
-
getCamera
public com.badlogic.gdx.graphics.PerspectiveCamera getCamera()Description copied from interface:ICamera
Returns the perspective camera. -
getFovFactor
public float getFovFactor()- Specified by:
getFovFactor
in interfaceICamera
- Overrides:
getFovFactor
in classAbstractCamera
-
getDirection
- Specified by:
getDirection
in interfaceICamera
-
setDirection
- Specified by:
setDirection
in interfaceICamera
-
getUp
-
getDirections
- Specified by:
getDirections
in interfaceICamera
-
notify
-
updateMode
public void updateMode(ICamera previousCam, CameraManager.CameraMode previousMode, CameraManager.CameraMode newMode, boolean centerFocus, boolean postEvent)- Specified by:
updateMode
in interfaceICamera
-
getNCameras
public int getNCameras()- Specified by:
getNCameras
in interfaceICamera
-
getMode
-
updateAngleEdge
public void updateAngleEdge(int width, int height)We have fixed field of view angles and thus fixed aspect ratio.- Specified by:
updateAngleEdge
in interfaceICamera
- Overrides:
updateAngleEdge
in classAbstractCamera
-
render
public void render(int rw, int rh)- Specified by:
render
in interfaceICamera
- Overrides:
render
in classAbstractCamera
-
getSpeed
public double getSpeed()Description copied from interface:ICamera
Gets the current velocity of the camera in km/h. -
isFocus
Description copied from interface:ICamera
Checks if this body is the current focus -
getFocus
Description copied from interface:ICamera
Returns the foucs if any -
isVisible
- Specified by:
isVisible
in interfaceICamera
- Overrides:
isVisible
in classAbstractCamera
-
setCamera
public void setCamera(com.badlogic.gdx.graphics.PerspectiveCamera cam)Description copied from interface:ICamera
Sets the active camera -
resize
public void resize(int width, int height) -
getFrustum2
-
speedScaling
public double speedScaling()- Specified by:
speedScaling
in interfaceICamera
-