예제 #1
0
        protected override void LoadContent()
        {
            mHeightMap.Initialise();

            if (UsePatches == true)
            {
                SetupTerrainPatches();
            }
            else
            {
                LoadVertices();
            }
            LoadTextures();
        }
예제 #2
0
 public override void Initialise()
 {
     mSource.Initialise();
     mWidth     = mSource.Width;
     mLength    = mSource.Length;
     mHeightMap = new float[mWidth * mLength];
     for (int x = 0; x < mWidth; x++)
     {
         for (int y = 0; y < mLength; y++)
         {
             SetHeight(x, y);
         }
     }
     // release to allow collection via GC
     mSource = null;
     base.Initialise();
 }
예제 #3
0
 public override void Initialise()
 {
     mSource.Initialise();
     mWidth     = mSource.Width * 2;
     mLength    = mSource.Length * 2;
     mHeightMap = new float[mWidth * mLength];
     for (int x = 0; x < mWidth; x++)
     {
         for (int y = 0; y < mLength; y++)
         {
             int sx = x < mSource.Width ? x : (mWidth - 1 - x);
             int sy = y < mSource.Length ? y : (mLength - 1 - y);
             mHeightMap[x + y * mWidth] = mSource[sx, sy];
         }
     }
     // release reference to source so that it can be collect by GC
     mSource = null;
     base.Initialise();
 }