Class GaiaSky
java.lang.Object
gaiasky.GaiaSky
- All Implemented Interfaces:
com.badlogic.gdx.ApplicationListener, IObserver
-
Field Summary
FieldsModifier and TypeFieldDescriptioncom.badlogic.gdx.assets.AssetManagerThe asset manager.The main camera manager.The user interfaces.The user interfaces.final ObjectUsed to wait for new frames.longHolds the number of frames produced in this session.Holds some assets.External UI window.The user interfaces.com.badlogic.gdx.GraphicsGraphics.com.badlogic.gdx.InputMultiplexerstatic GaiaSkySingleton instance.The user interfaces.The user interfaces.The user interfaces.intMaximum texture size.intMaximum number of vertex attributes.booleanSave state on exit.The user interfaces.The user interfaces.Time frame provider.The user interfaces.The user interfaces.com.badlogic.gdx.backends.lwjgl3.Lwjgl3WindowWindow.booleanFlag indicating whether the window has been successfully created.The OpenXR driver set up increateVR(), may be null if we are not in VR mode or an OpenXR runtime is not detected. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatalpha(ComponentTypes cts) voidapplyUIScale(int height, IGui gui) voidapplyUIScale(int height, List<IGui> guis) voidcreate()voiddispose()com.badlogic.gdx.graphics.glutils.FrameBuffergetCatalogInfoFromEntity(com.badlogic.ashley.core.Entity entity) Returns the main executor service, used to run asynchronous tasks in different threads.doubleGet the run time in seconds of this Gaia Sky instance, computed since the start of the program.doubleGet the run time in seconds of this Gaia Sky instance, computed since the scene was ready and all initial loading finished.doublegetT()floatbooleanbooleanbooleanbooleanisOn(int ordinal) booleanisOn(ComponentTypes cts) booleanbooleanisVR()Is this instance of Gaia Sky using VR?voidEvent notification call.voidparkCameraRunnable(String key, Runnable runnable) Parks a camera runnable that runs after the update-camera stage, and before the update-scene stage, until it is removed.voidparkRunnable(String key, Runnable runnable, Map<String, Runnable> map, com.badlogic.gdx.utils.Array<Runnable> runnables) Parks a runnable to the given map and list.voidparkUpdateRunnable(String key, Runnable runnable) Parks an update runnable that runs after the update-scene stage until it is removed.voidpause()static voidpopupNotification(String message, float duration, Object source) Create a new notification that is displayed as a popup for the given duration of seconds, and also as a console message with theLogger.LoggerLevel.INFOlevel.static voidpopupNotification(String message, float duration, Object source, Logger.LoggerLevel level, Throwable t) Create a new notification that is displayed as a popup for the given duration of seconds, and also as a console message with the given level.static voidPost aRunnableon the main loop thread that runs once after the current frame.voidRe-initialises all the GUI (step 1).voidSecond step in GUI initialisation.voidremoveRunnable(String key) Removes a previously parked update runnable.voidrender()voidvoidresize(int width, int height) voidresizeImmediate(int width, int height, boolean resizePostProcessors, boolean resizeRenderSys, boolean resizeGuis, boolean resizeScreenConf) voidresume()Gets the main scripting interface object.voidsetCrashed(boolean crashed) voidForces a global scene update.voidupdate(double dt) Update method.
-
Field Details
-
instance
Singleton instance. -
frameMonitor
Used to wait for new frames. -
window
public com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window windowWindow. -
graphics
public com.badlogic.gdx.Graphics graphicsGraphics. -
xrDriver
The OpenXR driver set up increateVR(), may be null if we are not in VR mode or an OpenXR runtime is not detected. -
assetManager
public com.badlogic.gdx.assets.AssetManager assetManagerThe asset manager. -
gaiaSkyAssets
Holds some assets. -
cameraManager
The main camera manager. -
scene
-
sceneRenderer
-
frames
public long framesHolds the number of frames produced in this session. -
inputMultiplexer
public com.badlogic.gdx.InputMultiplexer inputMultiplexer -
maxTextureSize
public int maxTextureSizeMaximum texture size. -
maxVertexAttributes
public int maxVertexAttributesMaximum number of vertex attributes. -
welcomeGui
The user interfaces. -
loadingGui
The user interfaces. -
mainGui
The user interfaces. -
spacecraftGui
The user interfaces. -
stereoGui
The user interfaces. -
debugGui
The user interfaces. -
crashGui
The user interfaces. -
gamepadGui
The user interfaces. -
mainVRGui
The user interfaces. -
timeGui
The user interfaces. -
welcomeGuiVR
-
loadingGuiVR
-
time
Time frame provider. -
windowCreated
public boolean windowCreatedFlag indicating whether the window has been successfully created. -
saveState
public boolean saveStateSave state on exit. -
gaiaSkyView
External UI window.
-
-
Constructor Details
-
GaiaSky
Creates an instance of Gaia Sky.- Parameters:
cliArgs- The command line arguments for this run.
-
-
Method Details
-
postRunnable
-
create
public void create()- Specified by:
createin interfacecom.badlogic.gdx.ApplicationListener
-
touchSceneGraph
public void touchSceneGraph()Forces a global scene update. Updates the scene with a very small dt to force the re-computation of all entities. -
reinitialiseGUI1
public void reinitialiseGUI1()Re-initialises all the GUI (step 1). -
reinitialiseGUI2
public void reinitialiseGUI2()Second step in GUI initialisation. -
pause
public void pause()- Specified by:
pausein interfacecom.badlogic.gdx.ApplicationListener
-
resume
public void resume()- Specified by:
resumein interfacecom.badlogic.gdx.ApplicationListener
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.ApplicationListener
-
resetDynamicResolution
public void resetDynamicResolution() -
getBackRenderBuffer
public com.badlogic.gdx.graphics.glutils.FrameBuffer getBackRenderBuffer() -
setCrashed
public void setCrashed(boolean crashed) -
render
public void render()- Specified by:
renderin interfacecom.badlogic.gdx.ApplicationListener
-
update
public void update(double dt) Update method.- Parameters:
dt- Delta time in seconds.
-
resize
public void resize(int width, int height) - Specified by:
resizein interfacecom.badlogic.gdx.ApplicationListener
-
resizeImmediate
public void resizeImmediate(int width, int height, boolean resizePostProcessors, boolean resizeRenderSys, boolean resizeGuis, boolean resizeScreenConf) -
scripting
Gets the main scripting interface object.- Returns:
- The main scripting interface object of Gaia Sky.
-
getExecutorService
Returns the main executor service, used to run asynchronous tasks in different threads.- Returns:
- The main executor service of Gaia Sky.
-
getGuiRegistry
-
getBookmarksManager
-
getICamera
-
getT
public double getT() -
getCameraManager
-
getPostProcessor
-
getCliArgs
-
isOn
public boolean isOn(int ordinal) -
isOn
-
isOn
-
alpha
-
getCatalogInfoFromEntity
-
notify
-
applyUIScale
-
applyUIScale
-
getUnitsPerPixel
public float getUnitsPerPixel() -
isInitialised
public boolean isInitialised() -
isHeadless
public boolean isHeadless() -
isExternalView
public boolean isExternalView() -
getGlobalResources
-
getCatalogManager
-
getConsoleManager
-
parkUpdateRunnable
-
parkCameraRunnable
-
parkRunnable
public void parkRunnable(String key, Runnable runnable, Map<String, Runnable> map, com.badlogic.gdx.utils.Array<Runnable> runnables) Parks a runnable to the given map and list.- Parameters:
key- The key to identify the runnable.runnable- The runnable to park.map- The map to use.runnables- The runnables list.
-
removeRunnable
Removes a previously parked update runnable.- Parameters:
key- The key of the runnable to remove.
-
getRunTimeSeconds
public double getRunTimeSeconds()Get the run time in seconds of this Gaia Sky instance, computed since the start of the program.- Returns:
- The time, in seconds, since Gaia Sky started running.
-
getSceneTimeSeconds
public double getSceneTimeSeconds()Get the run time in seconds of this Gaia Sky instance, computed since the scene was ready and all initial loading finished.- Returns:
- The time, in seconds, since the Gaia Sky scene started rendering.
-
isVR
public boolean isVR()Is this instance of Gaia Sky using VR?- Returns:
- The state of VR for this instance.
-
popupNotification
public static void popupNotification(String message, float duration, Object source, Logger.LoggerLevel level, Throwable t) Create a new notification that is displayed as a popup for the given duration of seconds, and also as a console message with the given level.- Parameters:
message- The message.duration- The popup duration, in seconds.source- The source object of the message.level- The logger level.t- The throwable, if any.
-
popupNotification
Create a new notification that is displayed as a popup for the given duration of seconds, and also as a console message with theLogger.LoggerLevel.INFOlevel.- Parameters:
message- The message.duration- The popup duration, in seconds.source- The source object of the message.
-