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 long
currentTime
Vector3d[]
directions
int
dirindex
Gaia
gaia
java.util.List<Vector3d[]>
interpolatedDirections
long
lastTime
float
MAX_OVERLAP_ANGLE
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.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
Modifier and Type Method Description com.badlogic.gdx.graphics.PerspectiveCamera
getCamera()
Returns the perspective camera.Vector3d
getDirection()
Vector3d[]
getDirections()
Vector3d[]
getDirections(java.util.Date d)
IFocus
getFocus()
Returns the foucs if anyfloat
getFovFactor()
com.badlogic.gdx.graphics.PerspectiveCamera[]
getFrontCameras()
Frustumd
getFrustum2()
CameraManager.CameraMode
getMode()
int
getNCameras()
double
getSpeed()
Gets the current velocity of the camera in km/h.Vector3d
getUp()
void
initialize(com.badlogic.gdx.assets.AssetManager assetManager)
boolean
isFocus(IFocus cb)
Checks if this body is the current focusboolean
isVisible(ITimeFrameProvider time, CelestialBody cb)
void
notify(Events event, java.lang.Object... data)
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
speedScaling()
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
updateDirections(ITimeFrameProvider time)
Updates both FOVs' directions applying the right transformation.void
updateMode(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, isVisible, setCameraStereoLeft, setCameraStereoRight, setClosest, setFrustumPlanes, setPos, setPreviousPos, setPreviousProjView, setShift, update, updateFrustumPlanes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
- 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
-