Package gaiasky.scenegraph.camera
Class RelativisticCamera
java.lang.Object
gaiasky.scenegraph.camera.AbstractCamera
gaiasky.scenegraph.camera.RelativisticCamera
- All Implemented Interfaces:
ICamera
public class RelativisticCamera extends AbstractCamera
-
Field Summary
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
Constructors Constructor Description RelativisticCamera(com.badlogic.gdx.assets.AssetManager assetManager, CameraManager parent)
RelativisticCamera(CameraManager parent)
-
Method Summary
Modifier and Type Method Description com.badlogic.gdx.graphics.PerspectiveCamera
getCamera()
Returns the perspective camera.Vector3d
getDirection()
Vector3d[]
getDirections()
IFocus
getFocus()
Returns the foucs if anycom.badlogic.gdx.graphics.PerspectiveCamera[]
getFrontCameras()
CameraManager.CameraMode
getMode()
int
getNCameras()
double
getSpeed()
Gets the current velocity of the camera in km/h.Vector3d
getUp()
boolean
isFocus(IFocus cb)
Checks if this body is the current focusvoid
resize(int width, int height)
void
setCamera(com.badlogic.gdx.graphics.PerspectiveCamera cam)
Sets the active cameravoid
setDirection(Vector3d dir)
double
speedScaling()
void
update(double dt, ITimeFrameProvider time)
Updates the camera.void
updateMode(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, getFovFactor, getInversePos, getManager, getNear, getPos, getPreviousPos, getPreviousProjView, getProjView, getSecondClosestBody, getShift, getVelocity, isVisible, isVisible, isVisible, render, setCameraStereoLeft, setCameraStereoRight, setClosest, setFrustumPlanes, setPos, setPos, setPreviousPos, setPreviousPos, setPreviousProjView, setShift, swapBuffers, update, updateAngleEdge, updateFrustumPlanes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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 cam)Description copied from interface:ICamera
Sets the active camera -
getFrontCameras
public com.badlogic.gdx.graphics.PerspectiveCamera[] getFrontCameras() -
setDirection
-
getDirection
-
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, boolean postEvent) -
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 foucs if any- Returns:
- The foucs object if it is in focus mode. Null otherwise
-
isFocus
Description copied from interface:ICamera
Checks if this body is the current focus- Parameters:
cb
- The body- Returns:
- Whether the body is focus
-
resize
public void resize(int width, int height)
-