Ejemplo n.º 1
0
		internal TerrainModel(int numPatchesX, int numPatchesY, Patch[,] patches, HeightMap heightMap, float tau, Effect effect)
		{
			HeightMap = heightMap;
			_numPatchesX = numPatchesX;
			_numPatchesY = numPatchesY;
			_patches = patches;
			_tau = tau;
			Effect = effect;
		}
Ejemplo n.º 2
0
        internal TerrainModel(int numPatchesX, int numPatchesY, Patch[,] patches, HeightMap heightMap, Effect effect)
        {
            HeightMap = heightMap;
            _numPatchesX = numPatchesX;
            _numPatchesY = numPatchesY;
            _patches = new List<Patch>(_numPatchesX * _numPatchesY);
            _numLevels = 0;
            for (int x = 0; x < _numPatchesX; x++)
                for (int y = 0; y < _numPatchesY; y++)
                {
                    _patches.Add(patches[x, y]);
                    _numLevels = Math.Max(_numLevels, patches[x, y].Levels);
                }
            _visiblePatches = new List<Patch>(_patches.Count);
            MaxPatchesAtLevel = new int[_numLevels - 1];
            MaxPatchesAtLevel[0] = 4;
            for (int i = 1; i < _numLevels - 1; i++)
            {
                MaxPatchesAtLevel[i] = MaxPatchesAtLevel[i - 1] * 2;
            }

            Effect = effect;
        }