Exemple #1
0
    public Heightmap(HeightmapParams vars)
    {
        worldData = GameObject.Find("World").GetComponent<WorldData>();

        form = vars.form;
        formArg = vars.formArg;
        mapSize = worldData.GetWorldSize();
        featureSizePower = vars.featureSizePower;
        heightScale = vars.heightScale;
        heightStepped = vars.heightStepped;
        heightStep = Mathf.Max(vars.heightStep, 0.00001f);

        floatMap = new float[mapSize*mapSize];
        featureSize = (int)Mathf.Pow(2.0f, (float)featureSizePower);

        diamondSquared = vars.diamondSquared;
        diamondRange = vars.diamondRange;
        squareRange = vars.squareRange;
    }