Class SpacecraftCamera
- java.lang.Object
-
- gaia.cu9.ari.gaiaorbit.scenegraph.camera.AbstractCamera
-
- gaia.cu9.ari.gaiaorbit.scenegraph.camera.SpacecraftCamera
-
public class SpacecraftCamera extends AbstractCamera implements IObserver
Implements a spacecraft-like movement. The spacecraft is modeled as a rigid solid and it has a mass and an engine model. The rest is physics.
-
-
Constructor Summary
Constructors Constructor Description SpacecraftCamera(CameraManager parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkClosest(IFocus cb)
Called after updating the body's distance to the cam, it updates the closest body in the camera to figure out the camera neardouble
convertAngle(double angle)
com.badlogic.gdx.graphics.PerspectiveCamera
getCamera()
Returns the perspective camera.IFocus
getClosest2()
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.double
getTranslateUnits()
Vector3d
getUp()
Vector3d
getVelocity()
boolean
isFocus(IFocus cb)
Checks if this body is the current focusvoid
notify(Events event, java.lang.Object... data)
void
render(int rw, int rh)
void
resize(int width, int height)
void
setCamera(com.badlogic.gdx.graphics.PerspectiveCamera cam)
Sets the active cameravoid
setDirection(Vector3d dir)
void
update(double dt, ITimeFrameProvider time)
Updates the camera.void
updateHard(double dt, ITimeFrameProvider time)
Updates the position and direction of the camera using a hard analytical algorithm.void
updateMode(CameraManager.CameraMode mode, boolean centerFocus, boolean postEvent)
protected void
updatePerspectiveCamera()
-
Methods inherited from class gaia.cu9.ari.gaiaorbit.scenegraph.camera.AbstractCamera
computeGaiaScan, computeVisibleFovs, copyParamsFrom, getAngleEdge, getAngleEdge, getCameraStereoLeft, getCameraStereoRight, getClosest, getClosestStar, getCurrent, getDistance, getFovFactor, getInversePos, getManager, getPos, isVisible, isVisible, setCameraStereoLeft, setCameraStereoRight, setClosestStar, setPos, updateAngleEdge, updateFrustum
-
-
-
-
Constructor Detail
-
SpacecraftCamera
public SpacecraftCamera(CameraManager parent)
-
-
Method Detail
-
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 cam)
Description copied from interface:ICamera
Sets the active camera
-
getFrontCameras
public com.badlogic.gdx.graphics.PerspectiveCamera[] getFrontCameras()
- Specified by:
getFrontCameras
in interfaceICamera
-
getDirection
public Vector3d getDirection()
- Specified by:
getDirection
in interfaceICamera
-
setDirection
public void setDirection(Vector3d dir)
- Specified by:
setDirection
in interfaceICamera
-
getDirections
public Vector3d[] getDirections()
- Specified by:
getDirections
in interfaceICamera
-
getNCameras
public int getNCameras()
- Specified by:
getNCameras
in interfaceICamera
-
update
public void update(double dt, ITimeFrameProvider time)
Description copied from interface:ICamera
Updates the camera.
-
updateHard
public void updateHard(double dt, ITimeFrameProvider time)
Updates the position and direction of the camera using a hard analytical algorithm.- Parameters:
dt
-time
-
-
convertAngle
public double convertAngle(double angle)
-
updatePerspectiveCamera
protected void updatePerspectiveCamera()
-
updateMode
public void updateMode(CameraManager.CameraMode mode, boolean centerFocus, boolean postEvent)
- Specified by:
updateMode
in interfaceICamera
-
getMode
public CameraManager.CameraMode getMode()
-
getSpeed
public double getSpeed()
Description copied from interface:ICamera
Gets the current velocity of the camera in km/h.
-
getFocus
public IFocus getFocus()
Description copied from interface:ICamera
Returns the foucs if any
-
isFocus
public boolean isFocus(IFocus cb)
Description copied from interface:ICamera
Checks if this body is the current focus
-
notify
public void notify(Events event, java.lang.Object... data)
-
render
public void render(int rw, int rh)
- Specified by:
render
in interfaceICamera
- Overrides:
render
in classAbstractCamera
-
checkClosest
public void checkClosest(IFocus 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:
checkClosest
in interfaceICamera
- Overrides:
checkClosest
in classAbstractCamera
- Parameters:
cb
- The body to check
-
getClosest2
public IFocus getClosest2()
- Specified by:
getClosest2
in interfaceICamera
- Overrides:
getClosest2
in classAbstractCamera
-
getVelocity
public Vector3d getVelocity()
- Specified by:
getVelocity
in interfaceICamera
- Overrides:
getVelocity
in classAbstractCamera
-
getTranslateUnits
public double getTranslateUnits()
- Specified by:
getTranslateUnits
in interfaceICamera
-
-