Package gaiasky.scene.camera
Class RelativisticCamera
java.lang.Object
gaiasky.scene.camera.AbstractCamera
gaiasky.scene.camera.RelativisticCamera
- All Implemented Interfaces:
ICamera
-
Field Summary
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, frustum, gamepadInput, logger, parent, pos, posInv, prevCombined, prevPos, projection, proximity, shift, tmp, view
-
Constructor Summary
ConstructorDescriptionRelativisticCamera
(com.badlogic.gdx.assets.AssetManager assetManager, CameraManager parent) RelativisticCamera
(CameraManager parent) -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.graphics.PerspectiveCamera
Returns the perspective camera.Vector3d[]
getFocus()
Returns the focus if any.com.badlogic.gdx.graphics.PerspectiveCamera[]
getMode()
int
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
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
updateMode
(ICamera previousCam, CameraManager.CameraMode previousMode, CameraManager.CameraMode newMode, boolean centerFocus) Methods inherited from class gaiasky.scene.camera.AbstractCamera
checkClosestBody, checkClosestBody, checkClosestParticle, copyParamsFrom, getAngleEdge, getAngleEdge, getCameraStereoLeft, getCameraStereoRight, getCloseLightSource, getClosest, getClosestBody, getClosestParticle, getCurrent, getDistance, getFar, getFovFactor, getInversePos, getManager, getNear, getPos, getPreviousPos, getPreviousProjView, getProjView, getSecondClosestBody, getShift, getVelocity, isVisible, isVisible, isVisible, render, setCameraStereoLeft, setCameraStereoRight, setClosest, setFrustumPlanes, setGamepadInput, setPointerProjectionOnFocus, setPos, setPos, setPreviousPos, setPreviousPos, setPreviousProjView, setShift, swapBuffers, update, updateAngleEdge, updateFrustumPlanes
-
Field Details
-
direction
-
up
-
-
Constructor Details
-
RelativisticCamera
-
RelativisticCamera
-
-
Method Details
-
getCamera
public com.badlogic.gdx.graphics.PerspectiveCamera getCamera()Description copied from interface:ICamera
Returns the perspective camera.- Returns:
- The perspective camera.
-
setCamera
public void setCamera(com.badlogic.gdx.graphics.PerspectiveCamera perspectiveCamera) Description copied from interface:ICamera
Sets the active camera- Parameters:
perspectiveCamera
- The perspective camera.
-
getFrontCameras
public com.badlogic.gdx.graphics.PerspectiveCamera[] getFrontCameras() -
getDirection
-
setDirection
-
getUp
-
getDirections
-
getNCameras
public int getNCameras() -
speedScaling
public double speedScaling() -
update
Description copied from interface:ICamera
Updates the camera.- Parameters:
dt
- The time since the las frame in seconds.time
- The frame time provider (simulation time).
-
updateMode
public void updateMode(ICamera previousCam, CameraManager.CameraMode previousMode, CameraManager.CameraMode newMode, boolean centerFocus) -
getMode
-
getSpeed
public double getSpeed()Description copied from interface:ICamera
Gets the current velocity of the camera in km/h.- Returns:
- The velocity in km/h.
-
getFocus
Description copied from interface:ICamera
Returns the focus if any.- Returns:
- The focus object if it is in focus mode. Null otherwise.
-
hasFocus
public boolean hasFocus()Description copied from interface:ICamera
Checks whether the current camera has a focus set.- Returns:
- True if the camera has a focus.
-
isFocus
public boolean isFocus(com.badlogic.ashley.core.Entity entity) Description copied from interface:ICamera
Checks if the given entity is the current focus.- Parameters:
entity
- The entity.- Returns:
- Whether the entity is focus.
-
resize
public void resize(int width, int height)
-