Class RelativisticCamera
java.lang.Object
gaiasky.scene.camera.AbstractCamera
gaiasky.scene.camera.RelativisticCamera
- All Implemented Interfaces:
ICamera
-
Field Summary
FieldsFields 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, tmpModifier and TypeFieldDescriptionprotected floatAngle from the center to the corner of the screen in scene coordinates, in radians.protected floatAspect ratio.doubleCamera far value.doubleCamera near value.com.badlogic.gdx.graphics.PerspectiveCameraThe main camera.protected com.badlogic.gdx.graphics.PerspectiveCamera[]Vector with all perspective cameras.protected com.badlogic.gdx.graphics.PerspectiveCameraStereoscopic mode cameras.protected com.badlogic.gdx.graphics.PerspectiveCameraStereoscopic mode cameras.protected IFocusThe closest betweenAbstractCamera.closestBodyandAbstractCamera.closestStar.protected FocusViewClosest non-star body to the camera.protected IFocusThe closest particle to the camera.protected FocusViewprotected doubleDistance of camera to center.floatprotected booleanThe last input event was by a gamepad.protected static final Logger.Logprotected CameraManagerThe parent.protected com.badlogic.gdx.math.Matrix4protected Proximity -
Constructor Summary
ConstructorsConstructorDescriptionRelativisticCamera(com.badlogic.gdx.assets.AssetManager assetManager, CameraManager parent) RelativisticCamera(CameraManager parent) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoneLoading(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()intdoublegetSpeed()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.voidresize(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.voidupdateMode(ICamera previousCam, CameraManager.CameraMode previousMode, CameraManager.CameraMode newMode, boolean centerFocus) Methods inherited from class AbstractCamera
checkClosestBody, checkClosestBody, checkClosestParticle, copyParamsFrom, getAngleEdge, getAngleEdge, getCameraStereoLeft, getCameraStereoRight, getCloseLightSource, getClosest, getClosestBody, getClosestParticle, getCurrent, getDistance, getDPos, getFar, getFovFactor, getInversePos, getManager, getNear, getPos, getPreviousPos, getPreviousProjView, getProjView, getSecondClosestBody, getShift, getSpeedScaling, getSpeedScalingCapped, getVelocity, isRotating, isVisible, isVisible, isVisible, render, setCameraStereoLeft, setCameraStereoRight, setClosest, setDPos, setDPos, setFrustumPlanes, setGamepadInput, setPointerProjectionOnFocus, setPos, setPos, setPreviousPos, setPreviousPos, setPreviousProjView, setShift, swapBuffers, updateAngleEdge, updateFovFactor, updateFrustumPlanesModifier and TypeMethodDescriptionvoidcheckClosestBody(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 nearvoidcheckClosestParticle(IFocus star) Sets the current closest particle to this camera.voidcopyParamsFrom(AbstractCamera other) floatGets the angle of the edge of the screen, diagonally.floatgetAngleEdge(int width, int height, float angle) com.badlogic.gdx.graphics.PerspectiveCameracom.badlogic.gdx.graphics.PerspectiveCameragetCloseLightSource(int i) Gets the current i-close light source to this cameraReturns the current closest objectGets the current closest particle to this cameradoubleGets the distance from the camera to the centre of our reference frame (Sun)getDPos()doublegetFar()floatdoublegetNear()getPos()com.badlogic.gdx.math.Matrix4com.badlogic.gdx.math.Matrix4getShift()doubledoublebooleanCheck whether the camera is currently rotating around the (possible) focus object.booleanbooleanbooleanisVisible(com.badlogic.ashley.core.Entity cb) voidrender(int rw, int rh) voidsetCameraStereoLeft(com.badlogic.gdx.graphics.PerspectiveCamera cam) voidsetCameraStereoRight(com.badlogic.gdx.graphics.PerspectiveCamera cam) voidsetClosest(IFocus focus) Sets the closest of allvoidvoidprotected voidsetFrustumPlanes(com.badlogic.gdx.graphics.PerspectiveCamera cam) voidsetGamepadInput(boolean state) Main input mode is a gamepad.voidsetPointerProjectionOnFocus(com.badlogic.gdx.math.Vector3 point) Sets the current pointer coordinates, as projected on the current focus object.voidvoidvoidsetPreviousPos(Vector3D prevpos) voidsetPreviousPos(Vector3Q pos) voidsetPreviousProjView(com.badlogic.gdx.math.Matrix4 mat) voidvoidvoidupdateAngleEdge(int width, int height) protected voidUpdate the FOV factor using the reference FOV.void
-
Field Details
-
direction
-
up
-
-
Constructor Details
-
RelativisticCamera
-
RelativisticCamera
-
-
Method Details
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager) Description copied from interface:ICameraLoading is finished, gather resources.- Parameters:
manager- The asset manager.
-
getCamera
public com.badlogic.gdx.graphics.PerspectiveCamera getCamera()Description copied from interface:ICameraReturns the perspective camera.- Returns:
- The perspective camera.
-
setCamera
public void setCamera(com.badlogic.gdx.graphics.PerspectiveCamera perspectiveCamera) Description copied from interface:ICameraSets 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:ICameraUpdates 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:ICameraGets the current velocity of the camera in km/h.- Returns:
- The velocity in km/h.
-
getFocus
-
hasFocus
public boolean hasFocus()Description copied from interface:ICameraChecks 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:ICameraChecks 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)
-