Gravity Engine 2 3.0
Loading...
Searching...
No Matches
GravityEngine2.SolarMetaController Class Reference

The Solar System has a GSController for the motion of planets around the sun and separate controllers for any planets with satellites. Due to the difference length and mass scales these controllers will have different internal integration times. More...

Inheritance diagram for GravityEngine2.SolarMetaController:

Public Member Functions

void SetDateTime (int year, int month, int day, double utc)
 
void SwitchPrimary (int bodyCode)
 Switch the primary controller to the controller for the indicated bodyCode 0=sun, 1=mercury etc.
 

Public Attributes

GSController[] controllers = new GSController[SolarSystemBuilder.NUM_PLANETS + 1]
 
int day = 1
 
bool debugKeys = true
 
GESphereCamera geCamera
 
int month = 1
 
bool runAllControllers = true
 
GameObject[] targets = new GameObject[SolarSystemBuilder.NUM_PLANETS + 1]
 
TMPro.TextMeshProUGUI timeText
 
int year = 2024
 
bool zoomRadiiForVisibility = true
 

Detailed Description

The Solar System has a GSController for the motion of planets around the sun and separate controllers for any planets with satellites. Due to the difference length and mass scales these controllers will have different internal integration times.

At any given time one of these controllers will be the primary controller. It's time evolution will set the time evolution in all the other systems.

For brevity, this controller also handles the switching of the display when a new primary system is selected. This is done by:

  • deactivating the display of objects in the newly inactive system
  • enabling display of the objects in the active system
  • changing the GE camera config to a display scale suitable distance from the origin

There may be cases where there is no need to update the evolution in all the secondary systems e.g. if they are not in the display and they are all "on-rails" and can be jumped to a new time easily. When this is not the case (off-rails) it is best to evolve all the secondary controllers as the primary progresses to avoid a big "catch-up" computation when a new primary is selected.

On Awake the start time from the Solar System time will be used (and pushed to all the planet controllers).

Member Function Documentation

◆ SwitchPrimary()

void GravityEngine2.SolarMetaController.SwitchPrimary ( int bodyCode)

Switch the primary controller to the controller for the indicated bodyCode 0=sun, 1=mercury etc.

Parameters
bodyCode

The documentation for this class was generated from the following file: