示例#1
0
    public biomeMap(IMap Heightmap, combinedHeightHeat ComboMap, moistureMap MoistureMap, bool MaskWater)

    {
        this._heightmap   = Heightmap;
        this._comboMap    = ComboMap;
        this._moistureMap = MoistureMap;
        this._maskWater   = MaskWater;
    }
示例#2
0
    public void BuildMap()
    {
        //initialzing settings objects

        hmSettings = new heightMapSettings
        {
            Octaves     = octaves,
            Frequency   = frequency,
            Lacunarity  = lacunarity,
            Quality     = quality,
            Seed        = seed,
            Persistence = persistence
        };
        thisChunk = new worldChunkSettings //need to move this out of this class for tiling world chunks
        {
            mapHeight = _mapHeight,
            mapWidth  = _mapWidth,
            top       = 0,
            bottom    = 1,
            left      = 2,
            right     = 3
        };
        mmSettings = new moistureMapSettings
        {
            Octaves     = MMoctaves,
            Frequency   = MMfrequency,
            Lacunarity  = MMlacunarity,
            Quality     = MMquality,
            Seed        = MMseed,
            Persistence = MMpersistence
        };

        //build maps
        HeightMap   = new heightMap(thisChunk, hmSettings);
        HeatMap     = new heatMap(thisChunk);
        ComboMap    = new combinedHeightHeat(HeightMap, HeatMap, thisChunk);
        MoistureMap = new moistureMap(thisChunk, mmSettings, HeightMap);
        BiomeMap    = new biomeMap(HeightMap, ComboMap, MoistureMap, maskWater);
        //Debug.Log("map seed "+hmSettings.Seed);
        //find game objects and build textures for each map
        HeightDisplay = GameObject.Find("HeightMapObj");
        HeightDisplay.GetComponent <Renderer>().sharedMaterial.mainTexture = textureFromMap.BuildTexture(HeightMap);
        //Debug.Log("Perlin point:" + HeightMap.GetValue(100, 100));

        HeatDisplay = GameObject.Find("HeatMapObj");
        HeatDisplay.GetComponent <Renderer>().sharedMaterial.mainTexture = textureFromMap.BuildTexture(HeatMap);

        //Debug.Log("Gradient Noise value:" + HeatMap.GetValue(0, 10));
        ComboDisplay = GameObject.Find("ComboMapObj");
        ComboDisplay.GetComponent <Renderer>().sharedMaterial.mainTexture = textureFromMap.BuildTexture(ComboMap);

        MoistureDisplay = GameObject.Find("MoistureMapObj");
        MoistureDisplay.GetComponent <Renderer>().sharedMaterial.mainTexture = textureFromMap.BuildTexture(MoistureMap);

        BiomeDisplay = GameObject.Find("BiomeMapObj");
        BiomeDisplay.GetComponent <Renderer>().sharedMaterial.mainTexture = textureFromMap.BuildTexture(BiomeMap);
    }