Package gaiasky.scene.camera
Class SpacecraftCamera
java.lang.Object
gaiasky.scene.camera.AbstractCamera
gaiasky.scene.camera.SpacecraftCamera
-
Field Summary
Modifier and TypeFieldDescriptionDirection and up vectors.Direction and up vectors.Fields inherited from class gaiasky.scene.camera.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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
checkClosestBody
(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 nearvoid
Called after updating the body's distance to the cam, it updates the closest body in the camera to figure out the camera nearvoid
doneLoading
(com.badlogic.gdx.assets.AssetManager manager) Loading is finished, gather resources.com.badlogic.gdx.graphics.PerspectiveCamera
Returns the perspective camera.Vector3d[]
getFocus()
Returns the focus if any.com.badlogic.gdx.graphics.PerspectiveCamera[]
getMode()
int
com.badlogic.ashley.core.Entity
double
getSpeed()
Gets the current velocity of the camera in km/h.getUp()
boolean
hasFocus()
Checks whether the current camera has a focus set.boolean
isFocus
(com.badlogic.ashley.core.Entity entity) Checks if the given entity is the current focus.void
Event notification call.void
void
resize
(int width, int height) void
setCamera
(com.badlogic.gdx.graphics.PerspectiveCamera perspectiveCamera) Sets the active cameravoid
setDirection
(Vector3d dir) double
void
update
(double dt, ITimeFrameProvider time) Updates the camera.void
updateHard
(double dt) Updates the position and direction of the camera using a hard analytical algorithm.void
updateMode
(ICamera previousCam, CameraManager.CameraMode previousMode, CameraManager.CameraMode mode, boolean centerFocus) protected void
Methods inherited from class gaiasky.scene.camera.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, isVisible, isVisible, isVisible, render, setCameraStereoLeft, setCameraStereoRight, setClosest, setDPos, setDPos, setFrustumPlanes, setGamepadInput, setPointerProjectionOnFocus, setPos, setPos, setPreviousPos, setPreviousPos, setPreviousProjView, setShift, swapBuffers, updateAngleEdge, 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:ICamera
Loading is finished, gather resources.- Specified by:
doneLoading
in interfaceICamera
- Parameters:
manager
- The asset manager.
-
getSpacecraft
public com.badlogic.ashley.core.Entity getSpacecraft() -
getSpacecraftView
-
getCamera
public com.badlogic.gdx.graphics.PerspectiveCamera getCamera()Description copied from interface:ICamera
Returns the perspective camera. -
setCamera
public void setCamera(com.badlogic.gdx.graphics.PerspectiveCamera perspectiveCamera) Description copied from interface:ICamera
Sets the active camera -
getFrontCameras
public com.badlogic.gdx.graphics.PerspectiveCamera[] getFrontCameras()- Specified by:
getFrontCameras
in interfaceICamera
-
getDirection
- Specified by:
getDirection
in interfaceICamera
-
setDirection
- Specified by:
setDirection
in interfaceICamera
-
getUp
-
getDirections
- Specified by:
getDirections
in interfaceICamera
-
getNCameras
public int getNCameras()- Specified by:
getNCameras
in interfaceICamera
-
update
Description copied from interface:ICamera
Updates 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:
updateMode
in interfaceICamera
-
getMode
-
getSpeed
public double getSpeed()Description copied from interface:ICamera
Gets the current velocity of the camera in km/h. -
getFocus
Description copied from interface:ICamera
Returns the focus if any. -
hasFocus
public boolean hasFocus()Description copied from interface:ICamera
Checks whether the current camera has a focus set. -
isFocus
public boolean isFocus(com.badlogic.ashley.core.Entity entity) Description copied from interface:ICamera
Checks if the given entity is the current focus. -
addGamepadListener
public void addGamepadListener() -
removeGamepadListener
public void removeGamepadListener() -
notify
Description copied from interface:IObserver
Event notification call. -
checkClosestBody
Description copied from interface:ICamera
Called 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:
checkClosestBody
in interfaceICamera
- Overrides:
checkClosestBody
in classAbstractCamera
- Parameters:
cb
- The body to check
-
checkClosestBody
public void checkClosestBody(com.badlogic.ashley.core.Entity cb) Description copied from interface:ICamera
Called 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:
checkClosestBody
in interfaceICamera
- Overrides:
checkClosestBody
in classAbstractCamera
- Parameters:
cb
- The body to check.
-
getSecondClosestBody
- Specified by:
getSecondClosestBody
in interfaceICamera
- Overrides:
getSecondClosestBody
in classAbstractCamera
-
resize
public void resize(int width, int height) -
getVelocity
- Specified by:
getVelocity
in interfaceICamera
- Overrides:
getVelocity
in classAbstractCamera
-
speedScaling
public double speedScaling()- Specified by:
speedScaling
in interfaceICamera
-