Package gaiasky.scenegraph.camera
Class FovCamera
- java.lang.Object
-
- gaiasky.scenegraph.camera.AbstractCamera
-
- gaiasky.scenegraph.camera.FovCamera
-
public class FovCamera extends AbstractCamera implements IObserver
The field of view cameras.
-
-
Field Summary
Fields Modifier and Type Field Description longcurrentTimeVector3d[]directionsintdirindexGaiagaiajava.util.List<Vector3d[]>interpolatedDirectionslonglastTimefloatMAX_OVERLAP_ANGLElongMAX_OVERLAP_TIMEtime 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, shift, tmp, view
-
-
Constructor Summary
Constructors Constructor Description FovCamera(com.badlogic.gdx.assets.AssetManager assetManager, CameraManager parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomputeGaiaScan(ITimeFrameProvider time, CelestialBody cb)com.badlogic.gdx.graphics.PerspectiveCameragetCamera()Returns the perspective camera.Vector3dgetDirection()Vector3d[]getDirections()Vector3d[]getDirections(java.util.Date d)IFocusgetFocus()Returns the foucs if anyfloatgetFovFactor()com.badlogic.gdx.graphics.PerspectiveCamera[]getFrontCameras()FrustumdgetFrustum2()CameraManager.CameraModegetMode()intgetNCameras()doublegetSpeed()Gets the current velocity of the camera in km/h.doublegetTranslateUnits()Vector3dgetUp()voidinitialize(com.badlogic.gdx.assets.AssetManager assetManager)booleanisFocus(IFocus cb)Checks if this body is the current focusbooleanisVisible(ITimeFrameProvider time, CelestialBody cb)voidnotify(Events event, java.lang.Object... data)voidrender(int rw, int rh)voidresize(int width, int height)voidsetCamera(com.badlogic.gdx.graphics.PerspectiveCamera cam)Sets the active cameravoidsetDirection(Vector3d dir)voidupdate(double dt, ITimeFrameProvider time)Updates the camera.voidupdateAngleEdge(int width, int height)We have fixed field of view angles and thus fixed aspect ratio.voidupdateDirections(ITimeFrameProvider time)Updates both FOVs' directions applying the right transformation.voidupdateMode(CameraManager.CameraMode mode, boolean centerFocus, boolean postEvent)-
Methods inherited from class gaiasky.scenegraph.camera.AbstractCamera
checkClosestBody, checkClosestParticle, computeVisibleFovs, copyParamsFrom, getAngleEdge, getAngleEdge, getCameraStereoLeft, getCameraStereoRight, getClosest, getClosestBody, getClosestParticle, getCurrent, getDistance, getFar, getInversePos, getManager, getNear, getPos, getPreviousPos, getPreviousProjView, getProjView, getSecondClosestBody, getShift, getVelocity, isVisible, setCameraStereoLeft, setCameraStereoRight, setClosest, setFrustumPlanes, setPos, setPreviousPos, setPreviousProjView, setShift, update, updateFrustumPlanes
-
-
-
-
Field Detail
-
MAX_OVERLAP_TIME
public long MAX_OVERLAP_TIME
time 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
public Gaia gaia
-
directions
public Vector3d[] directions
-
interpolatedDirections
public java.util.List<Vector3d[]> interpolatedDirections
-
currentTime
public long currentTime
-
lastTime
public long lastTime
-
dirindex
public int dirindex
-
-
Constructor Detail
-
FovCamera
public FovCamera(com.badlogic.gdx.assets.AssetManager assetManager, CameraManager parent)
-
-
Method Detail
-
initialize
public void initialize(com.badlogic.gdx.assets.AssetManager assetManager)
-
update
public void update(double dt, ITimeFrameProvider time)Description copied from interface:ICameraUpdates the camera.
-
updateDirections
public void updateDirections(ITimeFrameProvider time)
Updates both FOVs' directions applying the right transformation.- Parameters:
time-
-
getDirections
public Vector3d[] getDirections(java.util.Date d)
-
getFrontCameras
public com.badlogic.gdx.graphics.PerspectiveCamera[] getFrontCameras()
- Specified by:
getFrontCamerasin interfaceICamera
-
getCamera
public com.badlogic.gdx.graphics.PerspectiveCamera getCamera()
Description copied from interface:ICameraReturns the perspective camera.
-
getFovFactor
public float getFovFactor()
- Specified by:
getFovFactorin interfaceICamera- Overrides:
getFovFactorin classAbstractCamera
-
getDirection
public Vector3d getDirection()
- Specified by:
getDirectionin interfaceICamera
-
setDirection
public void setDirection(Vector3d dir)
- Specified by:
setDirectionin interfaceICamera
-
getDirections
public final Vector3d[] getDirections()
- Specified by:
getDirectionsin interfaceICamera
-
notify
public void notify(Events event, java.lang.Object... data)
-
updateMode
public void updateMode(CameraManager.CameraMode mode, boolean centerFocus, boolean postEvent)
- Specified by:
updateModein interfaceICamera
-
getNCameras
public int getNCameras()
- Specified by:
getNCamerasin interfaceICamera
-
getMode
public CameraManager.CameraMode getMode()
-
updateAngleEdge
public void updateAngleEdge(int width, int height)We have fixed field of view angles and thus fixed aspect ratio.- Specified by:
updateAngleEdgein interfaceICamera- Overrides:
updateAngleEdgein classAbstractCamera
-
render
public void render(int rw, int rh)- Specified by:
renderin interfaceICamera- Overrides:
renderin classAbstractCamera
-
getSpeed
public double getSpeed()
Description copied from interface:ICameraGets the current velocity of the camera in km/h.
-
isFocus
public boolean isFocus(IFocus cb)
Description copied from interface:ICameraChecks if this body is the current focus
-
getFocus
public IFocus getFocus()
Description copied from interface:ICameraReturns the foucs if any
-
computeGaiaScan
public void computeGaiaScan(ITimeFrameProvider time, CelestialBody cb)
- Specified by:
computeGaiaScanin interfaceICamera- Overrides:
computeGaiaScanin classAbstractCamera
-
isVisible
public boolean isVisible(ITimeFrameProvider time, CelestialBody cb)
- Specified by:
isVisiblein interfaceICamera- Overrides:
isVisiblein classAbstractCamera
-
setCamera
public void setCamera(com.badlogic.gdx.graphics.PerspectiveCamera cam)
Description copied from interface:ICameraSets the active camera
-
getFrustum2
public Frustumd getFrustum2()
-
getTranslateUnits
public double getTranslateUnits()
- Specified by:
getTranslateUnitsin interfaceICamera
-
-