Class SpacecraftCamera
java.lang.Object
gaiasky.scene.camera.AbstractCamera
gaiasky.scene.camera.SpacecraftCamera
-
Field Summary
FieldsModifier and TypeFieldDescriptionDirection and up vectors.Direction and up vectors.Fields inherited from class AbstractCamera
angleEdgeRad, ar, CAM_FAR, CAM_NEAR, camera, cameras, camLeft, camRight, closest, closestBody, closestStar, closestStarView, distance, dPos, fovFactor, gamepadInput, logger, parent, pos, posInv, prevCombined, prevPos, proximity, shift, tmp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcheckClosestBody(com.badlogic.ashley.core.Entity cb) Called after updating the body's distance to the cam, it updates the closest body in the camera to figure out the camera nearvoidCalled after updating the body's distance to the cam, it updates the closest body in the camera to figure out the camera nearvoiddoneLoading(com.badlogic.gdx.assets.AssetManager manager) Loading is finished, gather resources.com.badlogic.gdx.graphics.PerspectiveCameraReturns the perspective camera.Vector3D[]getFocus()Returns the focus if any.com.badlogic.gdx.graphics.PerspectiveCamera[]getMode()intcom.badlogic.ashley.core.EntitydoublegetSpeed()Gets the current velocity of the camera in km/h.getUp()booleanhasFocus()Checks whether the current camera has a focus set.booleanisFocus(com.badlogic.ashley.core.Entity entity) Checks if the given entity is the current focus.voidEvent notification call.voidvoidresize(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.voidupdateHard(double dt) Updates the position and direction of the camera using a hard analytical algorithm.voidupdateMode(ICamera previousCam, CameraManager.CameraMode previousMode, CameraManager.CameraMode mode, boolean centerFocus) protected voidMethods inherited from class AbstractCamera
checkClosestParticle, copyParamsFrom, getAngleEdge, getAngleEdge, getCameraStereoLeft, getCameraStereoRight, getCloseLightSource, getClosest, getClosestBody, getClosestParticle, getCurrent, getDistance, getDPos, getFar, getFovFactor, getInversePos, getManager, getNear, getPos, getPreviousPos, getPreviousProjView, getProjView, getShift, getSpeedScaling, getSpeedScalingCapped, isRotating, isVisible, isVisible, isVisible, render, setCameraStereoLeft, setCameraStereoRight, setClosest, setDPos, setDPos, setFrustumPlanes, setGamepadInput, setPointerProjectionOnFocus, setPos, setPos, setPreviousPos, setPreviousPos, setPreviousProjView, setShift, swapBuffers, updateAngleEdge, updateFovFactor, updateFrustumPlanes
-
Field Details
-
direction
Direction and up vectors. -
up
Direction and up vectors. -
relPos
-
-
Constructor Details
-
SpacecraftCamera
-
-
Method Details
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager) Description copied from interface:ICameraLoading is finished, gather resources.- Specified by:
doneLoadingin interfaceICamera- Parameters:
manager- The asset manager.
-
getSpacecraft
public com.badlogic.ashley.core.Entity getSpacecraft() -
getSpacecraftView
-
getCamera
-
setCamera
-
getFrontCameras
public com.badlogic.gdx.graphics.PerspectiveCamera[] getFrontCameras()- Specified by:
getFrontCamerasin interfaceICamera
-
getDirection
- Specified by:
getDirectionin interfaceICamera
-
setDirection
- Specified by:
setDirectionin interfaceICamera
-
getUp
-
getDirections
- Specified by:
getDirectionsin interfaceICamera
-
getNCameras
public int getNCameras()- Specified by:
getNCamerasin interfaceICamera
-
update
Description copied from interface:ICameraUpdates the camera. -
updateHard
public void updateHard(double dt) Updates the position and direction of the camera using a hard analytical algorithm. -
updatePerspectiveCamera
protected void updatePerspectiveCamera() -
updateMode
public void updateMode(ICamera previousCam, CameraManager.CameraMode previousMode, CameraManager.CameraMode mode, boolean centerFocus) - Specified by:
updateModein interfaceICamera
-
getMode
-
getSpeed
-
getFocus
-
hasFocus
-
isFocus
-
addGamepadListener
public void addGamepadListener() -
removeGamepadListener
public void removeGamepadListener() -
notify
-
checkClosestBody
Description copied from interface:ICameraCalled after updating the body's distance to the cam, it updates the closest body in the camera to figure out the camera near- Specified by:
checkClosestBodyin interfaceICamera- Overrides:
checkClosestBodyin classAbstractCamera- Parameters:
cb- The body to check
-
checkClosestBody
public void checkClosestBody(com.badlogic.ashley.core.Entity cb) Description copied from interface:ICameraCalled after updating the body's distance to the cam, it updates the closest body in the camera to figure out the camera near- Specified by:
checkClosestBodyin interfaceICamera- Overrides:
checkClosestBodyin classAbstractCamera- Parameters:
cb- The body to check.
-
getSecondClosestBody
- Specified by:
getSecondClosestBodyin interfaceICamera- Overrides:
getSecondClosestBodyin classAbstractCamera
-
resize
-
getVelocity
- Specified by:
getVelocityin interfaceICamera- Overrides:
getVelocityin classAbstractCamera
-
speedScaling
public double speedScaling()- Specified by:
speedScalingin interfaceICamera
-