Package gaiasky

Class GaiaSky

java.lang.Object
gaiasky.GaiaSky
All Implemented Interfaces:
com.badlogic.gdx.ApplicationListener, IObserver

public class GaiaSky extends Object implements com.badlogic.gdx.ApplicationListener, IObserver
Gaia Sky application code. Manages the application lifecycle, including initialization, main loop, and disposal.
  • Field Details

    • instance

      public static GaiaSky instance
      Singleton instance..
    • frameMonitor

      public final Object frameMonitor
      Used to wait for new frames.
    • window

      public com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window window
      Window.
    • graphics

      public com.badlogic.gdx.Graphics graphics
      Graphics.
    • xrDriver

      public XrDriver xrDriver
      The OpenXR driver set up in createVR(), may be null if we are not in VR mode or an OpenXR runtime is not detected.
    • assetManager

      public com.badlogic.gdx.assets.AssetManager assetManager
      The asset manager.
    • cameraManager

      public CameraManager cameraManager
      The main camera manager.
    • scene

      public Scene scene
    • sceneRenderer

      public SceneRenderer sceneRenderer
    • frames

      public long frames
      Holds the number of frames produced in this session.
    • inputMultiplexer

      public com.badlogic.gdx.InputMultiplexer inputMultiplexer
    • welcomeGui

      public IGui welcomeGui
      The user interfaces.
    • loadingGui

      public IGui loadingGui
      The user interfaces.
    • mainGui

      public IGui mainGui
      The user interfaces.
    • spacecraftGui

      public IGui spacecraftGui
      The user interfaces.
    • stereoGui

      public IGui stereoGui
      The user interfaces.
    • debugGui

      public IGui debugGui
      The user interfaces.
    • crashGui

      public IGui crashGui
      The user interfaces.
    • gamepadGui

      public IGui gamepadGui
      The user interfaces.
    • mainVRGui

      public IGui mainVRGui
      The user interfaces.
    • welcomeGuiVR

      public StandaloneVRGui<?> welcomeGuiVR
    • loadingGuiVR

      public StandaloneVRGui<?> loadingGuiVR
    • time

      public ITimeFrameProvider time
      Time frame provider.
    • windowCreated

      public boolean windowCreated
      Flag indicating whether the window has been successfully created.
    • saveState

      public boolean saveState
      Save state on exit.
    • externalView

      public boolean externalView
      External view with final rendered scene and no UI.
    • gaiaSkyView

      public GaiaSkyView gaiaSkyView
      External UI window.
  • Constructor Details

    • GaiaSky

      public GaiaSky()
      Creates an instance of Gaia Sky.
    • GaiaSky

      public GaiaSky(boolean skipWelcome, boolean vr, boolean externalView, boolean headless, boolean noScriptingServer, boolean debugMode)
      Creates an instance of Gaia Sky.
      Parameters:
      skipWelcome - Skips welcome screen if possible.
      vr - Launch in VR mode.
      externalView - Open a new window with a view of the rendered scene.
      headless - Launch in headless mode, without window.
      debugMode - Output debug information.
  • Method Details

    • postRunnable

      public static void postRunnable(Runnable r)
      Posts a runnable that will run once after the current frame.
      Parameters:
      r - The runnable to post.
    • create

      public void create()
      Specified by:
      create in interface com.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:
      pause in interface com.badlogic.gdx.ApplicationListener
    • resume

      public void resume()
      Specified by:
      resume in interface com.badlogic.gdx.ApplicationListener
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.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:
      render in interface com.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:
      resize in interface com.badlogic.gdx.ApplicationListener
    • resizeImmediate

      public void resizeImmediate(int width, int height, boolean resizePostProcessors, boolean resizeRenderSys, boolean resizeGuis, boolean resizeScreenConf)
    • scripting

      public IScriptingInterface scripting()
      Gets the main scripting interface object.
      Returns:
      The main scripting interface object of Gaia Sky.
    • getExecutorService

      public GaiaSkyExecutorService getExecutorService()
      Returns the main executor service, used to run asynchronous tasks in different threads.
      Returns:
      The main executor service of Gaia Sky.
    • getGuiRegistry

      public GuiRegistry getGuiRegistry()
    • getBookmarksManager

      public BookmarksManager getBookmarksManager()
    • getICamera

      public ICamera getICamera()
    • getT

      public double getT()
    • getCameraManager

      public CameraManager getCameraManager()
    • getPostProcessor

      public IPostProcessor getPostProcessor()
    • isOn

      public boolean isOn(int ordinal)
    • isOn

      public boolean isOn(ComponentTypes.ComponentType comp)
    • isOn

      public boolean isOn(ComponentTypes cts)
    • alpha

      public float alpha(ComponentTypes cts)
    • getCatalogInfoFromEntity

      public Optional<CatalogInfo> getCatalogInfoFromEntity(com.badlogic.ashley.core.Entity entity)
    • notify

      public void notify(Event event, Object source, Object... data)
      Description copied from interface: IObserver
      Event notification call.
      Specified by:
      notify in interface IObserver
      Parameters:
      event - The event type.
      source - The source object, if any.
      data - The data associated with this event.
    • isInitialised

      public boolean isInitialised()
    • isHeadless

      public boolean isHeadless()
    • getGlobalResources

      public GlobalResources getGlobalResources()
    • getCatalogManager

      public CatalogManager getCatalogManager()
    • parkUpdateRunnable

      public void parkUpdateRunnable(String key, Runnable runnable)
      Parks an update runnable that runs after the update-scene stage until it is removed.
      Parameters:
      key - The key to identify the runnable.
      runnable - The runnable to park.
    • parkCameraRunnable

      public void parkCameraRunnable(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.
      Parameters:
      key - The key to identify the runnable.
      runnable - The runnable to park.
    • 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

      public void removeRunnable(String key)
      Removes a previously parked update runnable.
      Parameters:
      key - The key of the runnable to remove.