Package gaiasky.scenegraph.camera
Class FovCamera
java.lang.Object
gaiasky.scenegraph.camera.AbstractCamera
gaiasky.scenegraph.camera.FovCamera
The field of view cameras
-
Field Summary
FieldsModifier and TypeFieldDescriptionlongVector3d[]intlongfloatlongtime 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
ConstructorsConstructorDescriptionFovCamera(com.badlogic.gdx.assets.AssetManager assetManager, CameraManager parent) -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.graphics.PerspectiveCameraReturns the perspective camera.Vector3d[]Vector3d[]getDirections(Date d)getFocus()Returns the foucs if anyfloatcom.badlogic.gdx.graphics.PerspectiveCamera[]getMode()intdoublegetSpeed()Gets the current velocity of the camera in km/h.getUp()voidinitialize(com.badlogic.gdx.assets.AssetManager assetManager)booleanChecks if this body is the current focusbooleanisVisible(CelestialBody cb)voidvoidrender(int rw, int rh)voidresize(int width, int height)voidsetCamera(com.badlogic.gdx.graphics.PerspectiveCamera cam)Sets the active cameravoidsetDirection(Vector3d dir)doublevoidupdate(double dt, ITimeFrameProvider time)Updates the camera.voidupdateAngleEdge(int width, int height)We have fixed field of view angles and thus fixed aspect ratio.voidUpdates both FOVs' directions applying the right transformation.voidupdateMode(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:ICameraUpdates the camera. -
updateDirections
Updates both FOVs' directions applying the right transformation.- Parameters:
time-
-
getDirections
-
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
- Specified by:
getDirectionin interfaceICamera
-
setDirection
- Specified by:
setDirectionin interfaceICamera
-
getUp
-
getDirections
- Specified by:
getDirectionsin interfaceICamera
-
notify
-
updateMode
public void updateMode(ICamera previousCam, CameraManager.CameraMode previousMode, CameraManager.CameraMode newMode, boolean centerFocus, boolean postEvent)- Specified by:
updateModein interfaceICamera
-
getNCameras
public int getNCameras()- Specified by:
getNCamerasin interfaceICamera
-
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
Description copied from interface:ICameraChecks if this body is the current focus -
getFocus
Description copied from interface:ICameraReturns the foucs if any -
isVisible
- 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 -
resize
public void resize(int width, int height) -
getFrustum2
-
speedScaling
public double speedScaling()- Specified by:
speedScalingin interfaceICamera
-