Package gaiasky.scene.camera
Class FovCamera
java.lang.Object
gaiasky.scene.camera.AbstractCamera
gaiasky.scene.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.scene.camera.AbstractCamera
angleEdgeRad, ar, CAM_FAR, CAM_NEAR, camera, cameras, camLeft, camRight, closest, closestBody, closestStar, closestStarView, combined, distance, fovFactor, frustumd, gamepadInput, logger, parent, pos, posinv, prevCombined, prevpos, projection, proximity, shift, tmp, view -
Constructor Summary
ConstructorsConstructorDescriptionFovCamera(com.badlogic.gdx.assets.AssetManager assetManager, CameraManager parent, com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch) -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.graphics.PerspectiveCameraReturns the perspective camera.final Vector3d[]Vector3d[]getFocus()Returns the focus if any.floatcom.badlogic.gdx.graphics.PerspectiveCamera[]getMode()intdoublegetSpeed()Gets the current velocity of the camera in km/h.getUp()booleanhasFocus()Checks whether the current camera has a focus set.voidinitialize(com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch) booleanisFocus(com.badlogic.ashley.core.Entity entity) Checks if the given entity is the current focus.booleanisVisible(com.badlogic.ashley.core.Entity cb) voidEvent notification call.voidrender(int rw, int rh) voidresize(int width, int height) voidsetCamera(com.badlogic.gdx.graphics.PerspectiveCamera perspectiveCamera) 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.scene.camera.AbstractCamera
checkClosestBody, 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, setGamepadInput, 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 -
directions
-
interpolatedDirections
-
currentTime
public long currentTime -
lastTime
public long lastTime -
dirIndex
public int dirIndex
-
-
Constructor Details
-
FovCamera
public FovCamera(com.badlogic.gdx.assets.AssetManager assetManager, CameraManager parent, com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch)
-
-
Method Details
-
initialize
public void initialize(com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch) -
update
Description copied from interface:ICameraUpdates the camera. -
updateDirections
Updates both FOVs' directions applying the right transformation.- Parameters:
time- The time frame provider.
-
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. -
setCamera
public void setCamera(com.badlogic.gdx.graphics.PerspectiveCamera perspectiveCamera) Description copied from interface:ICameraSets the active 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
Description copied from interface:IObserverEvent notification call. -
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
public boolean isFocus(com.badlogic.ashley.core.Entity entity) Description copied from interface:ICameraChecks if the given entity is the current focus. -
getFocus
Description copied from interface:ICameraReturns the focus if any. -
hasFocus
public boolean hasFocus()Description copied from interface:ICameraChecks whether the current camera has a focus set. -
isVisible
public boolean isVisible(com.badlogic.ashley.core.Entity cb) - Specified by:
isVisiblein interfaceICamera- Overrides:
isVisiblein classAbstractCamera
-
resize
public void resize(int width, int height) -
getFrustum2
-
speedScaling
public double speedScaling()- Specified by:
speedScalingin interfaceICamera
-