Cosmos Journeyer API Documentation - v1.10.1
    Preparing search index...

    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

    Index

    Constructors

    Properties

    havokPlugin: HavokPlugin

    The Havok physics plugin used inside the scene

    loader: StarSystemLoader = ...

    The star system loader used to load the star system. It is constant for the whole game.

    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<
        {
            idInSystem: string;
            systemCoordinates: {
                localX: number;
                localY: number;
                localZ: number;
                starSectorX: number;
                starSectorY: number;
                starSectorZ: number;
            };
        },
    > = ...
    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

    • 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>

    • 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.

      Parameters

      • targetSeed: {
            localX: number;
            localY: number;
            localZ: number;
            starSectorX: number;
            starSectorY: number;
            starSectorZ: number;
        }

        the seed of the target system

        • localX: number

          Floating point X coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

        • localY: number

          Floating point Y coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

        • localZ: number

          Floating point Z coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

        • starSectorX: number

          Integer coordinates of the star sector along the universe X axis

        • starSectorY: number

          Integer coordinates of the star sector along the universe Y axis

        • starSectorZ: number

          Integer coordinates of the star sector along the universe Z axis

      Returns void

    • Switches the active controller to the default controls

      Parameters

      • showHelpNotification: boolean

      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