Example #1
0
 void Init(string scenename, LatLng ll, double latkm, double lngkm, int lod)
 {
     SceneName        = scenename;
     useElevationData = false;
     MapExtent        = MapExtentTypeE.AsSpecified;
     llbox            = new LatLngBox(ll, latkm, lngkm, lod: lod);
 }
Example #2
0
    public bool CheckChange()
    {
        var chg = old_mapExtent != mapExtent ||
                  old_maxVertsPerMesh != maxVertsPerMesh ||
                  old_hmult != hmult ||
                  old_synthTex != synthTex ||
                  old_flatTris != flatTriangles ||
                  old_mappprov != mapprov ||
                  old_normmethod != normmethod ||
                  old_nodefak != nodefak ||
                  old_heightType != heightType ||
                  old_useElevationData != useElevationData;

        if (updcount == 0 || chg)
        {
            old_mapExtent        = mapExtent;
            old_flatTris         = flatTriangles;
            old_hmult            = hmult;
            old_useElevationData = useElevationData;
            old_mappprov         = mapprov;
            old_normmethod       = normmethod;
            old_nodefak          = nodefak;
            old_synthTex         = synthTex;
            old_maxVertsPerMesh  = maxVertsPerMesh;
            old_addMeshColliders = addMeshColliders;
            old_heightType       = heightType;
        }
        if (chg)
        {
            Debug.Log("Change " + heightType);
        }
        return(chg);
    }
Example #3
0
 public void InitElevs(string scenename, ElevProvider elevprov, MapExtentTypeE mapextent, EarthHightModelE model, int nrow, int ncol, LatLngBox llb)
 {
     Debug.Log("InitElevs mapextent:" + mapextent + " nrow:" + nrow + " ncol:" + ncol);
     this.elevprov  = elevprov;
     this.scenename = scenename;
     this.mapprov   = MapProvider.Bing;// the only one with elevations
     this.nrow      = nrow;
     this.ncol      = ncol;
     this.llb       = llb;
     this.model     = model;
     this.mapextent = mapextent;
     heights        = new List <float>();
 }
Example #4
0
    public async Task <(QmapMesh, int, int)> MakeMeshFromLlbox(string scenename, LatLngBox llbox, int tpqk = 4, float hmult = 1, string mapcoordname = "", MapExtentTypeE mapextent = MapExtentTypeE.SnapToTiles, MapProvider mapprov = MapProvider.Bing, ElevProvider elevprov = ElevProvider.Bing, bool execute = true, bool forceload = false,
                                                               bool limitQuadkeys = true, QmapMesh.sythTexMethod synthTex   = QmapMesh.sythTexMethod.Quadkeys, HeightTypeE heitType = HeightTypeE.FetchedAndZeroed)
    {
        var wpstays = false;

        Debug.Log($"QmapMan.MakeMeshFromLlbox scenename:{scenename} wpstays:{wpstays}");
        this.mapprov      = mapprov;
        this.elevprov     = elevprov;
        this.scenename    = scenename;
        this.mapcoordname = mapcoordname;
        if (rgo != null)
        {
            Destroy(rgo);
            rgo = null;
        }
        rgo = new GameObject("rgo");
        rgo.transform.SetParent(this.transform, worldPositionStays: wpstays);
        qkgo = new GameObject("QmapMesh");
        qkgo.transform.SetParent(rgo.transform, worldPositionStays: wpstays);
        qkgo.transform.position = Vector3.zero;

        var qmmcomp = qkgo.AddComponent <QmapMesh>();

        qmmcomp.descriptor = $"{scenename} {llbox.lod} {mapprov} {mapextent}";
        qmmcomp.InitializeGrid(scenename, llbox, mapcoordname: mapcoordname);
        qmmcomp.secsPerQkTile    = tpqk;
        qmmcomp.useElevationData = useElevationDataStart;
        qmmcomp.mapExtent        = mapextent;
        qmmcomp.hmult            = hmult;
        qmmcomp.synthTex         = synthTex;
        qmmcomp.limitQuadkeys    = limitQuadkeys;
        qmmcomp.heightType       = heitType;

        (var nbm, var nel) = await qmmcomp.GenerateGrid(execute, forceload, limitQuadkeys : limitQuadkeys);

        return(qmmcomp, nbm, nel);
    }