Creates an empty star system view with a scene, a gui and a havok plugin
To fill it with a star system, use loadStarSystem
and then initStarSystem
The player object shared with the rest of the game
The BabylonJS engine
The Havok physics instance
Readonly
bodyA debug HTML UI to change the properties of the closest celestial body
Readonly
havokThe Havok physics plugin used inside the scene
Readonly
onAn observable that notifies when the player has jumped to another star system.
Readonly
onAn observable that notifies when the player is about to jump to another star system.
Readonly
onAn observable that notifies when the star system is initialized. This is when the current star system becomes playable and the post processes are initialized.
Readonly
onReadonly
postReadonly
sceneThe BabylonJS scene, upgraded with some helper methods and properties
Readonly
spaceThe HTML UI responsible for the name of the closest orbital object, the velocity of the spaceship and the target helper radar.
Readonly
spaceThe HTML UI responsible for the interaction with space stations
Readonly
targetThe HTML GUI used to display orbital objects cursors and information when targeted.
Attach user input to the view to allow the player to interact with it
Remove user input to ensure the player does not interact with the view when another view is displayed
Returns the bottom layer scene of the view. This is useful for taking a screenshot of the view for example as we can only use one camera at a time.
Initializes the assets using the scene of the star system view.
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.
Dispose the previous star system and incrementally loads the new star system. All the assets are instantiated but the system still need to be initialized
Renders the view. It is composed of multiple scene layers: a main scene (bottom layer) and other scenes to handle the UI for example.
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.
Creates a visible target inside the current star system to aim for another star system. This target will display the name of the target system and its distance.
the seed of the target system
Stops the background sounds of the spaceship
Switches the active controller to the character controls
Switches the active controller to the default controls
Switches the active controller to the spaceship controls
Updates the system view. It updates the underlying star system, the UI, the chunk forge and the controls
the time elapsed since the last update in seconds
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.