Beispiel #1
0
        public GOTileObj(Vector2 tileCoordinates, int zoomLevel, GoMap.GOMap.GOMapType mapType, bool useElevation, float elevationMultiplier, Vector2 resolution,
                         bool useCache, bool addGofeatureComponents, float worldScale, bool useSatelliteBackground, bool satellite4X, bool combineFeatures, GONavMeshSettings navmeshSettings)
        {
            this.tileCoordinates        = tileCoordinates;
            this.zoomLevel              = zoomLevel;
            this.useElevation           = useElevation;
            this.elevationMultiplier    = elevationMultiplier;
            this.resolution             = resolution;
            this.useCache               = useCache;
            this.mapType                = mapType;
            this.elevationType          = MapTypeToElevationType(mapType);
            this.addGoFeatureComponents = addGofeatureComponents;
            this.worldScale             = worldScale;
            this.useSatelliteBackground = useSatelliteBackground;
            this.satellite4X            = satellite4X;
            this.combineFeatures        = combineFeatures;
            this.navmeshSettings        = navmeshSettings;

            tileCenter = new Coordinates(tileCoordinates, zoomLevel);
            tileOrigin = tileCenter.tileOrigin(zoomLevel).convertCoordinateToVector();

            diagonalLenght = tileCenter.diagonalLenght(zoomLevel);

            name = tileCoordinates.x + "-" + tileCoordinates.y + "-" + zoomLevel;

            Vector3[] vs = tileCenter.tileVertices(zoomLevel).ToArray();
            vertices = vs.ToList();

            float tileHeight = Vector3.Distance(vertices [0], vertices [1]);
            float tileWidth  = Vector3.Distance(vertices [1], vertices [2]);

            this.tileSize = new Vector2(tileWidth, tileHeight);
        }
Beispiel #2
0
 public GODEMTexture2D(Texture2D t, Vector2 tileSize, GOElevationAPI elevationAPI, float altitudeMultiplier = 1)
 {
     this.texture            = t;
     this.tileSize           = tileSize;
     this.elevationAPI       = elevationAPI;
     this.width              = t.width;
     this.height             = t.height;
     this.arcolors           = t.GetPixels32();
     this.altitudeMultiplier = altitudeMultiplier;
 }
        public GODEMTexture2D(byte[] b, Vector2 tileSize, GOElevationAPI elevationAPI, float altitudeMultiplier = 1)
        {
            this.data               = b;
            this.tileSize           = tileSize;
            this.elevationAPI       = elevationAPI;
            this.altitudeMultiplier = altitudeMultiplier;

            this.texture          = new Texture2D(256, 256);
            this.texture.wrapMode = TextureWrapMode.Clamp;
            this.texture.LoadImage(data);

            this.width    = texture.width;
            this.height   = texture.height;
            this.arcolors = texture.GetPixels32();
        }