Azmyth.XNA.PlaneManager.LoadChunk C# (CSharp) Method

LoadChunk() public method

Load a chunk at specified x and y position (in chunks)
public LoadChunk ( float chunkX, float chunkY ) : void
chunkX float
chunkY float
return void
        public void LoadChunk(float chunkX, float chunkY)
        {
            if (m_world != null)
            {
                System.Drawing.RectangleF chunkBounds;

                int radius = 20;
                int x, y;

                for (y = -radius; y <= radius; y++)
                    for (x = -radius; x <= radius; x++)
                        if ((x * x) + (y * y) <= (radius * radius))
                        {
                            chunkBounds = new System.Drawing.RectangleF(x, y, 1, 1);

                            m_world.LoadChunk(chunkBounds);
                        }
                            //world.LoadTile(x, y);

                //Converts chunk bounds to tiles.

            }
        }