Exemple #1
0
    public override void Construct()
    {
        ConstructBase();

        var ska = qmm.triDiag * 0.5f;
        var qkm = qmm.qkm;

        //var pos1 = GetPosFromLatLng(qkm.ll1, yval0);
        var pos1  = qmm.GetPosFromLatLng(qkm.ll1);
        var name1 = "ll1";

        SphInfo.DoInfoSphere(decoroot, name1, pos1, ska, "red", qkm.ll1);

        //var pos2 = GetPosFromLatLng(qkm.ll2, yval1);
        var pos2  = qmm.GetPosFromLatLng(qkm.ll2);
        var name2 = "ll2";

        SphInfo.DoInfoSphere(decoroot, name2, pos2, ska, "red", qkm.ll2);

        //var pos3 = GetPosFromLatLng(qkm.tileul.llul, yval0);
        var pos3  = qmm.GetPosFromLatLng(qkm.tileul.llul);
        var name3 = "qkt_ll_ul";

        SphInfo.DoInfoSphere(decoroot, name3, pos3, ska, "blue", qkm.tileul.llul);
        //var pos4 = GetPosFromLatLng(qkm.tilebr.llbr, yval1);
        var pos4  = qmm.GetPosFromLatLng(qkm.tilebr.llbr);
        var name4 = "qkt_ll_br";

        SphInfo.DoInfoSphere(decoroot, name4, pos4, ska, "blue", qkm.tilebr.llbr);
    }
Exemple #2
0
    public override void Construct()
    {
        ConstructBase();

        var ska = qmm.triDiag * 0.5f;
        int i   = 0;

        foreach (var md in qmm.llmap.mapcoord.mapdata)
        {
            var sname = "mc:" + i;
            //var v = llmap.mapcoord.glbmap(md.x, 0, md.z);
            var ll    = new LatLng(md.lat, md.lng);
            var posll = qmm.GetPosFromLatLng(ll);
            var pos   = new Vector3((float)md.x, posll.y, (float)md.z);
            var spi   = SphInfo.DoInfoSphere(decoroot, sname, pos, ska, "orange", ll);
            spi.mapPoint = md;
            i++;
        }
    }
Exemple #3
0
    IEnumerator YieldingConstruct()
    {
        var sw = new StopWatch();

        sw.Start();
        ConstructBase();

        var qkm = qmm.qkm;

//        var ska = qmm.nodefak * qkm.llbox.diagonalInMeters / 450;
        var ska = qmm.triDiag * 0.075f;

        var        qtt = qmm.qtt;
        int        i = 0;
        GameObject pipeu, piper, pipeb, pipel;

        foreach (var qktile in qkm.qktiles)
        {
            var llul   = qktile.llul;
            var llbr   = qktile.llbr;
            var llur   = new LatLng(llul.lat, llbr.lng);
            var llbl   = new LatLng(llbr.lat, llul.lng);
            var pul    = qmm.GetPosFromLatLng(llul);
            var pur    = qmm.GetPosFromLatLng(llur);
            var pbl    = qmm.GetPosFromLatLng(llbl);
            var pbr    = qmm.GetPosFromLatLng(llbr);
            var qkname = qktile.name;
            if (oldway)
            {
                SphInfo.DoInfoSphere(decoroot, "pur" + i, pur, ska, "navyblue", llur);
                pipeu = GpuInst.CreateCylinderGpu(qkname + "-u", pul, pur, ska, "cyan");
                pipeu.transform.parent = decoroot.transform;
                piper = GpuInst.CreateCylinderGpu(qkname + "-r", pur, pbr, ska, "cyan");
                piper.transform.parent = decoroot.transform;
                pipeb = GpuInst.CreateCylinderGpu(qkname + "-b", pbr, pbl, ska, "cyan");
                pipeb.transform.parent = decoroot.transform;
                pipel = GpuInst.CreateCylinderGpu(qkname + "-l", pbl, pul, ska, "cyan");
                pipel.transform.parent = decoroot.transform;
            }
            else
            {
                SphInfo.DoInfoSphereSlim(decoroot, "pur" + i, pur, ska, "navyblue", llur);
                pipeu = qtt.AddFragLine(qkname + "-u", pul, pur, ska, lclr: "blue");
                pipeu.transform.parent = decoroot.transform;
                piper = qtt.AddFragLine(qkname + "-r", pur, pbr, ska, lclr: "blue");
                piper.transform.parent = decoroot.transform;
                pipeb = qtt.AddFragLine(qkname + "-b", pbr, pbl, ska, lclr: "blue");
                pipeb.transform.parent = decoroot.transform;
                pipel = qtt.AddFragLine(qkname + "-l", pbl, pul, ska, lclr: "blue");
                pipel.transform.parent = decoroot.transform;
            }
            if (showQuadkeyLabels)
            {
                qut.MakeTextGo(pipeu, qkname, yoff: 100, backoff: 0.01f, sfak: 20);
            }
            if (sw.ElapfOverYieldTime())
            {
                Debug.Log($"Yielding on qktile frame {i} of {qkm.qktiles.Count}");
                yield return(null);

                if (earlyTerminate)
                {
                    break;
                }
            }
            i++;
        }
        sw.Stop();
        Debug.Log($"Framed {i} tiles in {sw.ElapSecs(3)} secs");
        earlyTerminate = false;
        yield return(null);
    }