Exemplo n.º 1
0
        /// <summary>
        /// Creates a new clipmaplevel.
        /// </summary>
        /// <param name="L">Levelindex of the clipmap. If is 0 this will be the finest level</param>
        /// <param name="N">Number of vertices per clipside. Must be one less than power of two.</param>
        /// <param name="S">Maximum terrainheight and heightscale</param>
        /// <param name="fieldsize">Width and heightvalue of the heightfield</param>
        /// <param name="heightfield">Heightvalues with a range of 0.0f - 1.0f</param>
        /// <param name="device">The used Graphicsdevice</param>
        /// <exception cref="ArgumentException"></exception>
        /// <exception cref="ArgumentNullException"></exception>
        public Clipmap(int L, TerrainHeightmap parent)
        {
            this.Parent = parent;
            this.L = L;

            G = (int)Math.Pow(2, L);
            M = (Parent.N + 1) / 4;
            G2 = G * 2;
            Mm1G = (M - 1) * G;
            ClipRegion = new Rectangle(0, 0, (Parent.N - 1) * G, (Parent.N - 1) * G);

            // Initialize the vertices
            Initialize();
        }
 public ClutterPlacement(TerrainHeightmap terrain, RenderView renderView)
 {
     this.terrain = terrain;
     this.view = renderView;
     this.climate = terrain.GetClimate();
     BuildPlantSpots();
 }