コード例 #1
0
 public pinData(RSDESPin pin, Vector3 contactPoint)
 {
     RSDESManager.onEarthTilt += pin.onEarthTilt;
     this.pin          = pin;
     this.contactPoint = contactPoint;
     this.latLong      = GeoPlanetMaths.latlong(contactPoint, RSDESManager.earthPos);
     //pin.Latlong = this.latLong;
 }
コード例 #2
0
        public override void checkClassifier(EmbodiedClassifier classifier)
        {
            //look at whether the gesture being performed is close to the surface of the Earth
            float dist = IMRE.Math.Operations.magnitude((float3)RSDESManager.earthPos - classifier.origin);

            if (Unity.Mathematics.math.abs(RSDESManager.EarthRadius - dist) < tolerance && Time.time > _startTime + cooldown)
            {
                //figure out when the gesture began
                _startTime = Time.time;

                //make a pin at a location on the Earth closest to where the gesture is
                RSDESPin.Constructor(GeoPlanetMaths.latlong(classifier.origin, RSDESManager.earthPos));

                //the gesture has completed the functionality.
                classifier.shouldFinish = true;
            }
        }
コード例 #3
0
        // Use this for initialization
        void Awake()
        {
            Mesh m = GetComponent <MeshFilter>().mesh;

            Vector2[] uvs = m.uv;

            Vector3[] verts = m.vertices;
            for (int i = 0; i < uvs.Length; i++)
            {
                Vector2 tmp = GeoPlanetMaths.latlong(verts[i]);
                uvs[i] = new Vector2((tmp.y + 180f) / 360f, (tmp.x + 90f) / 180f);
                if (uvs[i].x < 0 || uvs[i].x > 1 || uvs[i].y < 0 || uvs[i].y > 1)
                {
                    Debug.LogWarning("UV OUT OF BOUND " + i + "  " + uvs[i].ToString());
                }
            }
            m.uv = uvs;
        }
コード例 #4
0
        private void SetSunMoonPositions()
        {
            Vector3 EarthOffset = Vector3.zero;

            if (Horizons.planetsHaveValues)
            {
                EarthOffset = Horizons.Planets.Find(p => p.id == 399).position;
            }
            if (Sun != null && sunPin != null && Horizons.planetsHaveValues)
            {
                if (sunBetweenTropics)
                {
                    Vector2 tmp = GeoPlanetMaths.latlong(Horizons.Planets.Find(p => p.id == 10).position - EarthOffset);
                    tmp.x          = (tmp.x / realEarthtilt) * earthTiltDeg;
                    sunPin.Latlong = tmp;
                }
                else
                {
                    sunPin.Latlong = GeoPlanetMaths.latlong(Horizons.Planets.Find(p => p.id == 10).position - EarthOffset);
                }
            }
            else
            {
                Debug.LogWarning("Sun, " + Sun + " ,or Sunpin, " + sunPin + " ,are not set.");
                RSDESPin.Constructor().GetComponent <RSDESPin>().setupSun();
            }
            if (Moon != null && moonPin != null && Horizons.planetsHaveValues)
            {
                moonPin.Latlong = GeoPlanetMaths.latlong(Horizons.Planets.Find(p => p.id == 301).position - EarthOffset);
            }
            else
            {
                Debug.LogWarning("moon, " + Moon + " ,or moonpin, " + moonPin + " ,are not set.");
                RSDESPin.Constructor().GetComponent <RSDESPin>().setupMoon();
            }
        }
コード例 #5
0
 public override void pinFunction(RSDESPin pin, EmbodiedClassifier classifier)
 {
     pin.Latlong = GeoPlanetMaths.latlong(classifier.origin, RSDESManager.earthPos);
 }