Inheritance: Asset, IDisposable
Exemple #1
0
        public TerrainTile(VectorID tileID, TerrainChunk chunk)
            : base(tileID)
        {
            m_chunk = chunk;

            if (chunk != null)
            {
                m_world = m_chunk.World;
            }
        }
Exemple #2
0
        public TerrainTile LoadVoxel(int x, int y, int z, TerrainChunk chunk = null)
        {
            TerrainTile tile = null;

            tile = new TerrainTile(chunk);

            tile.X = x;
            tile.Y = y;
            tile.Z = z;

            tile.Height = (float)Math.Round(m_terrain.GetHeight(x, y));
            tile.m_value = (float)m_terrain.GetValue(x, y);

            tile.Bounds = new RectangleF(x, y, 1, 1);

            tile.Terrain = GetTerrainType(x, y);

            tile.m_temp = Math.Abs(Math.Round(m_tempurature.GetHeight(x, y), 0));
            tile.m_tempVal = m_tempurature.GetValue(x, y, z);

            return tile;
        }
Exemple #3
0
        public TerrainChunk LoadChunk(RectangleF chunkBounds)
        {
            TerrainChunk chunk = null;
            List<TerrainChunk> chunks = m_terrainChunks.Query(chunkBounds);

            if (chunks.Count == 0)
            {
                chunk = new TerrainChunk(this, chunkBounds);

                m_terrainChunks.Insert(chunk);
            }
            else
            {
                chunk = chunks[0];
            }

            return chunk;
        }
Exemple #4
0
        public void LoadPlane(int seed, int x, int y, int radius)
        {
            world = new World(seed);

            chunk = new TerrainChunk(world, x, y, radius);
        }
Exemple #5
0
 public TerrainTile(TerrainChunk chunk)
     : this(new VectorID(0, 0), chunk)
 {
 }