public cAABB getBoundingBox() { cAABB b = new cAABB(); b.SetDims(Dims); b.SetPosByCenter(Pos); return(b); }
public override void Enter() { Vector2f worldSize = new Vector2f(m_AppController.MainWindow.Size.X, m_AppController.MainWindow.Size.Y); m_View.Size = new Vector2f(worldSize.X, worldSize.Y); m_View.Center = new Vector2f(worldSize.X / 2.0f, worldSize.Y / 2.0f); m_View.Viewport = new FloatRect(0.0f, 0.0f, 1.0f, 1.0f); m_View.Zoom(0.6f); //0.6f m_AppController.MainWindow.SetView(m_View); viewRect = new cAABB(); viewRect.SetDims(m_View.Size); worldEnvironment = new cEnvironment(); // Constants.LIGHTMAP_COLOR lightMap = new cLightSystem(Constants.LIGHTMAP_COLOR); //((uint)m_World.WorldBounds.dims.X, (uint)m_World.WorldBounds.dims.Y, Constants.LIGHTMAP_COLOR); m_World = new cWorld(this, m_AppController.MainWindow.Size); //lightMap.Create((uint)m_World.WorldBounds.dims.X, (uint)m_World.WorldBounds.dims.Y); lightMap.Create(m_AppController.MainWindow.Size.X, m_AppController.MainWindow.Size.Y); this.staticTexture = new RenderTexture((uint)m_World.WorldBounds.dims.X, (uint)m_World.WorldBounds.dims.Y); this.staticTexture.SetActive(true); this.staticTexture.Clear(new Color(0, 0, 0, 0)); //this.staticTexture.SetView(m_View); Vector2f playerStart = new Vector2f(m_World.LevelStartRegion.center.X, m_World.LevelStartRegion.rightBottom.Y); playerStart.X -= Constants.CHAR_FRAME_WIDTH / 2.0f; playerStart.Y -= Constants.CHAR_FRAME_HEIGHT; m_Player = new cPlayer(this, playerStart); entityPool = new cEntityPool(this, m_World.WorldBounds.dims, m_Player); //vizekhez adunk fényt List <cWaterBlock> waterBlocks = m_World.GetWaterBlocks(); foreach (cWaterBlock wb in waterBlocks) { cLight waterLight = new cLight(); //víz blokkokhoz adunk fényt, mert jól néz ki waterLight.Pos = new Vector2f(wb.Area.center.X, wb.Area.topLeft.Y + Constants.TILE_SIZE / 2.0f); waterLight.Radius = (wb.Area.dims.X + wb.Area.dims.Y) * 0.8f; waterLight.Bleed = 0.00001f; // 0.00001f; waterLight.LinearizeFactor = 0.95f; waterLight.Color = new Color(41, 174, 232); // 96,156,164 lightMap.AddStaticLight(waterLight); } //háttér, környezeti tárgyak megjelenítése worldEnvironment.SetWaterBlocks(waterBlocks); this.particleManager = new cParticleManager(this); // lightMap.renderStaticLightsToTexture(); gameCommands = new Queue <Action>(50); //Pálya idő start levelTimer.Start(); }