void buildGround()
    {
        PlaneBuilder pBuilder = new PlaneBuilder();
        for (int x =0; x < mapSize -1; x++) //-1 as the bottom left of the quad is x/y but top left is x+1/y+1
        {
            for (int y =0; y < mapSize -1; y++)
            {
                Vector3[] verts = new Vector3[4];
                verts[0] = getHeight(x,y);
                verts[1] = getHeight(x +1,y);
                verts[2] = getHeight(x,y +1);
                verts[3] = getHeight(x +1,y +1);
                pBuilder.addQuad(verts);

            }
        }
        GetComponent<MeshFilter> ().mesh = pBuilder.compileMesh();//low polly map
    }
    float[,] detailedHeightMap = null; //stored as a connected array

    #endregion Fields

    #region Methods

    void addQuad(int x, int y, ref PlaneBuilder pBuilder)
    {
        Vector3[] quadVerts = new Vector3[4]{getVert(x,y),getVert(x +1,y),getVert(x,y + 1),getVert(x + 1,y + 1)};
        //print(getVert(x,y).y);
        pBuilder.addQuad(quadVerts);
    }