The star system view is the part of Cosmos Journeyer responsible to display the current star system, along with the player's spaceship, character and GUI. It also handles the loading of the star system and its initialization. While the player may travel to another star system, the star system view stays the same, only the star system controller changes.

Implements

Constructors

Properties

bodyEditor: BodyEditor

A debug HTML UI to change the properties of the closest celestial body

havokPlugin: HavokPlugin

The Havok physics plugin used inside the scene

onAfterJump: Observable<void> = ...

An observable that notifies when the player has jumped to another star system.

onBeforeJump: Observable<void> = ...

An observable that notifies when the player is about to jump to another star system.

onInitStarSystem: Observable<void> = ...

An observable that notifies when the star system is initialized. This is when the current star system becomes playable and the post processes are initialized.

onNewDiscovery: Observable<UniverseObjectId> = ...
postProcessManager: PostProcessManager
scene: UberScene

The BabylonJS scene, upgraded with some helper methods and properties

spaceShipLayer: SpaceShipLayer

The HTML UI responsible for the name of the closest orbital object, the velocity of the spaceship and the target helper radar.

spaceStationLayer: SpaceStationLayer

The HTML UI responsible for the interaction with space stations

targetCursorLayer: TargetCursorLayer

The HTML GUI used to display orbital objects cursors and information when targeted.

Methods

  • Initializes the star system. It initializes the positions of the orbital objects, the UI, the chunk forge and the post processes As it initializes the post processes using initPostProcesses, it returns a promise that resolves when the post processes are initialized.

    Returns void

  • Renders the view. It is composed of multiple scene layers: a main scene (bottom layer) and other scenes to handle the UI for example.

    Returns void

  • Call this when the player object is changed when loading a save. It will remove the current controls and recreate them based on the player object.

    Returns Promise<void>

  • Switches the active controller to the character controls

    Returns Promise<void>

  • Switches the active controller to the default controls

    Parameters

    • showHelpNotification: boolean

    Returns Promise<void>

  • Switches the active controller to the spaceship controls

    Returns Promise<void>

  • Updates the system view. It updates the underlying star system, the UI, the chunk forge and the controls

    Parameters

    • deltaSeconds: number

      the time elapsed since the last update in seconds

    Returns void