Beispiel #1
0
    /*
     * public void onNoiseOptionsChanged() {
     * if(noise_options.res > 1) {
     *  terrain_mm.resetMinMax();
     *  original_noise_grid = new float[noise_options.res*noise_options.res];
     *  generateTerrain();
     *  applyTerrain();
     *  terrain_mm.addValues(noise_grid);
     *  terrain_mm.log();
     *  col_gen.updateHeight(terrain_mm);
     *  constructMesh();
     * } else {
     *  Debug.Log("ignoring as res is 0 or 1");
     * }
     * }
     */

    public void onTerrainOptionsChange()
    {
        Debug.Log("on terraain options changed");
        if (noise_options.res > 1)
        {
            original_noise_grid = new float[noise_options.res * noise_options.res];
            terrain_mm.resetMinMax();
            generateTerrain();
            applyTerrain();
            terrain_mm.addValues(noise_grid);
            terrain_mm.log();
            col_gen.updateHeight(terrain_mm);
            constructMesh();
        }
        else
        {
            Debug.Log("ignoring as res is 0 or 1");
        }
    }