예제 #1
0
 public Level(String name, LevelScene scene)
 {
     this.name = name;
     this.scene = scene;
 }
예제 #2
0
 public LevelSceneRender(LevelScene scene)
 {
     this.scene = scene;
     InitRender();
 }
예제 #3
0
 public QuadTreeNode(LevelScene scene)
     : this(scene.Bounds)
 {
 }
예제 #4
0
        public List<Tuple<ITile, TileCoord>> Culling(ViewFrustum frustum, LevelScene scene)
        {
            List<Tuple<ITile, TileCoord>> viewTiles = new List<Tuple<ITile, TileCoord>>();

            Culling(frustum, scene, viewTiles);

            return viewTiles;
        }
예제 #5
0
        private void Culling(ViewFrustum frustum, LevelScene scene, List<Tuple<ITile, TileCoord>> viewTiles)
        {
            if (IsLeaf)
            {
                foreach (TileCoord tileCoord in region.TileCoords())
                {
                    ITile tile = scene.GetTile(tileCoord);
                    if (tile != null)
                    {
                        viewTiles.Add(new Tuple<ITile, TileCoord>(tile, tileCoord));
                    }
                }
            }
            else
            {
                for (int k = 0; k < 4; k++)
                {
                    if (children[k] == null)
                        continue;

                    if (frustum.Intersects(children[k].Bounds))
                        Culling(frustum, scene, viewTiles);
                }
            }
        }