public SkyModel(double julianDay, LocationData location){ if (INSTANCE == null) { INSTANCE = this; } this.location = location; this.jd = julianDay; sun = new SunModel (jd, location); moon = new MoonModel (jd, location); MercuryModel mercuryModel = new MercuryModel (jd, location); VenusModel venusModel = new VenusModel(jd, location); MarsModel marsModel = new MarsModel (jd, location); JupiterModel jupiterModel = new JupiterModel (jd, location); SaturnModel saturnModel = new SaturnModel (jd, location); UranusModel uranusModel = new UranusModel(jd, location); NeptuneModel neptuneModel = new NeptuneModel(jd, location); planets = new Dictionary<string, PlanetModel> (); planets["Mercury"] = mercuryModel; planets["Venus"] = venusModel; planets["Mars"] = marsModel; planets["Jupiter"] = jupiterModel; planets["Saturn"] = saturnModel; planets["Uranus"] = uranusModel; planets["Neptune"] = neptuneModel; starPositionsDictionary = new Dictionary<EquatorialCoords, int> (); planetPositionsDictionary = new Dictionary<EquatorialCoords, PlanetModel> (); }
// Update is called once per frame void Update() { try{ Vector3 mousePos = Input.mousePosition; mousePos.z = SimController.INSTANCE.radius; Vector3 pointingAt = Camera.main.ScreenToWorldPoint(mousePos); LocalCoords local = SkyModel.Rectangular2Horizontal((double)pointingAt.x, (double)pointingAt.y, (double)pointingAt.z); EquatorialCoords equatorial = skyModel.Horizontal2Equatorial( local.Azimuth.Get(), local.Altitude.Get() ); DisplaySelectedBodyDetailsIfAny(equatorial); raDecGUI.text = string.Format("RA/Dec: {0} / {1}", equatorial.RA.ToString(), equatorial.Declination.ToString()); azimuthAltGUI.text = string.Format("Az/Alt: {0} / {1}", local.Azimuth.To0To360Range().ToString(), local.Altitude.ToString()); fovGUI.text = "FOV: " + Camera.main.fieldOfView + "º"; raDecGUI.color = azimuthAltGUI.color = fovGUI.color = sim.Settings.MouseHudColor; }catch (NullReferenceException n) { Debug.Log(n); } }
void Awake() { if (instance == null) { instance = this; } skyModel = new SkyModel((double)dt.JulianDay(), GetLocationData()); }
// Use this for initialization void Start() { sim = SimController.INSTANCE; skyModel = sim.skyModel; //DrawSun (); //DrawMoon (); //DrawPlanets(); }
// Use this for initialization void Start() { ps = gameObject.GetComponent <ParticleSystem> (); sim = SimController.INSTANCE; skyModel = sim.skyModel; CreatePoints(); }
protected virtual void Awake() { sim = SimController.INSTANCE; skyModel = sim.skyModel; distance = 1.0f * sim.radius; model = GetModel(); SetPosition(); SetScale(); }
void Start() { sim = SimController.INSTANCE; skyModel = sim.skyModel; lineMaterial = new Material(Shader.Find("Standard")); lineMaterial.EnableKeyword("_EMISSION"); lineMaterial.SetColor("_EmissionColor", sim.Settings.ConstellationsColor); lineColor = sim.Settings.ConstellationsColor; GenerateConstellations(); }
void Start() { raDecGUI = raDec.GetComponent <Text> (); azimuthAltGUI = azAlt.GetComponent <Text> (); fovGUI = fov.GetComponent <Text> (); detailsGUI = details.GetComponent <Text> (); skyModel = SimController.INSTANCE.skyModel; sim = SimController.INSTANCE; raDecGUI.color = azimuthAltGUI.color = fovGUI.color = sim.Settings.MouseHudColor; detailsGUI.text = ""; }
// Use this for initialization void Start() { sim = SimController.INSTANCE; skyModel = sim.skyModel; LocationSettings location = sim.GetLocation(); double angle = 90.0d - location.Latitude; earthAxis = new Vector3(0.0f, (float)Math.Sin(angle * M.DEG2RAD), (float)Math.Cos(angle * M.DEG2RAD)); Quaternion q = Quaternion.Euler((float)angle, 0, 0); gameObject.transform.localRotation = q; //correction for hour angle //TODO Debug.Log(string.Format("Angle {0}", angle)); Debug.Log(string.Format("Quaternion {0}", q)); }
// Use this for initialization void Start() { sim = SimController.INSTANCE; skyModel = sim.skyModel; go = new GameObject(); }