public Level(String name, LevelScene scene) { this.name = name; this.scene = scene; }
public LevelSceneRender(LevelScene scene) { this.scene = scene; InitRender(); }
public QuadTreeNode(LevelScene scene) : this(scene.Bounds) { }
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; }
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); } } }