Gravity Engine  1.5
Unity Asset for Gravity
SolarSystem Class Reference

Solar system. This component is attached to a game object that is the Sun. It then manages the children of the Sun allowing editing and global scaling of planets, asteroids and comets. More...

Inheritance diagram for SolarSystem:

Public Types

enum  Type { PLANET, ASTEROID, COMET }
 

Public Member Functions

void Init ()
 
void UpdateEpochTime (float newTime)
 Sets the epoch time and adjusts the phase parameters of all bodies in the system accordingly. More...
 
void UpdatePlanetScale (float scale)
 
GameObject AddObject (Type type, SolarBody sbody)
 
void InitOrbit (SolarBody sbody)
 

Public Attributes

GameObject planetPrefab
 Prefab to be used to create bodies in the SolarSystem via the editor or script calls.
 
GameObject asteroidPrefab
 
GameObject cometPrefab
 
const float mass_sun = 1.989E6f
 

Properties

float planetScale [get, set]
 Planet scale in Unity units per 1000km.
 
float epochTime [get, set]
 

Detailed Description

Solar system. This component is attached to a game object that is the Sun. It then manages the children of the Sun allowing editing and global scaling of planets, asteroids and comets.

The atributes of the planets can be altered (for "what if" experiments) by editing the children game objects that are created. They can also be reset to defaults by a call to RestoreDefaults()

Member Function Documentation

void SolarSystem.UpdateEpochTime ( float  newTime)

Sets the epoch time and adjusts the phase parameters of all bodies in the system accordingly.

Phase is set by using the original orbit data reference. Any hand-tuning of phase by manual changes in the editor will be lost.

Parameters
newTimeNew time.

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