Ejemplo n.º 1
0
    void Log()
    {
        Debug.Log("------- SUN ------- ");
        Debug.Log(string.Format("JD: {0}", dt.JulianDay()));
        Debug.Log(string.Format("Time: {0}:{1}:{2}", dt.Hour(), dt.Minute(), dt.Second()));
        skyModel.GetSun().Log();
        HourAngle H = new HourAngle(skyModel.GetSun().localHourAngle);

        Debug.Log(string.Format("H {0}", H.ToString()));

        AAS2DCoordinate local = AASCoordinateTransformation.Equatorial2Horizontal(skyModel.GetSun().localHourAngle,
                                                                                  skyModel.GetSun().EquatorialCoords.Declination.Get(),
                                                                                  location.Latitude);


        Debug.Log(string.Format("local X {0}", local.X));
        Debug.Log(string.Format("local Y {0}", local.Y));


        Debug.Log("------- VENUS ------- ");
        VenusModel venus = skyModel.GetPlanets() ["Venus"] as VenusModel;

        venus.Log();


        Debug.Log("------- MOON ------- ");
        MoonModel moon = skyModel.GetMoon();

        moon.Log();

        Debug.Log("------- JUPITER ------- ");
        JupiterModel jup = skyModel.GetPlanets()["Jupiter"] as JupiterModel;

        Debug.Log("p " + jup.GetParallacticAngle());
    }
Ejemplo n.º 2
0
    private bool CheckSolarSystemBodyHit()
    {
        RaycastHit hit;
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        bool ret = false;

        if (Physics.Raycast(ray, out hit))
        {
            if (hit.collider != null)
            {
                ret = true;
                string bodyTag = hit.transform.tag;

                if (bodyTag.Equals("Sun"))
                {
                    selectedBody = skyModel.GetSun();
                }
                else if (bodyTag.Equals("Moon"))
                {
                    selectedBody = skyModel.GetMoon();
                }
                else if (bodyTag.Equals("Mercury"))
                {
                    selectedBody = skyModel.GetPlanets() ["Mercury"];
                }
                else if (bodyTag.Equals("Venus"))
                {
                    selectedBody = skyModel.GetPlanets() ["Venus"];
                }
                else if (bodyTag.Equals("Mars"))
                {
                    selectedBody = skyModel.GetPlanets() ["Mars"];
                }
                else if (bodyTag.Equals("Jupiter"))
                {
                    selectedBody = skyModel.GetPlanets() ["Jupiter"];
                }
                else if (bodyTag.Equals("Saturn"))
                {
                    selectedBody = skyModel.GetPlanets() ["Saturn"];
                }
                else if (bodyTag.Equals("Uranus"))
                {
                    selectedBody = skyModel.GetPlanets() ["Uranus"];
                }
                else if (bodyTag.Equals("Neptune"))
                {
                    selectedBody = skyModel.GetPlanets() ["Neptune"];
                }

                crosshairRadius = hit.collider.transform.localScale.magnitude;
                crosshairSize   = hit.collider.transform.localScale.magnitude;
            }
        }

        return(ret);
    }