SetLookAtPoint() public method

public SetLookAtPoint ( Vector3 lookAtPoint ) : void
lookAtPoint Vector3
return void
Exemplo n.º 1
0
        public PlayScreen()
            : base("PlayScreen")
        {
            units = new List<Unit>();
            towers = new List<Tower>();

            Vector2 numTiles = new Vector2(20, 10);

            TileMap.InitializeTileMap(Vector3.Zero, numTiles, new Vector2(100, 100));

            startBase = new TestBase(TileMap.Tiles[0]);
            goalBase = new TestBase(TileMap.Tiles[TileMap.Tiles.Count - 1]);

            startBase.SetGoalBase(goalBase);
            goalBase.SetGoalBase(startBase);

            bases = new List<Base>();
            bases.Add(startBase);
            bases.Add(goalBase);

            TileMap.SetBase(goalBase);
            TileMap.SetBase(startBase);

            TileMap.UpdateTilePaths();

            //towers = new Dictionary<int, Tower>();
            //for (int i = 0; i < numTiles.X * numTiles.Y; i++)
            //   towers.Add(i, new TowerAGood(TileMap.Tiles[i].Position));

            background = ScreenManager.Game.Content.Load<Texture2D>("water_tiled");

            cameraManager = (CameraManager)ScreenManager.Game.Services.GetService(typeof(CameraManager));

            myModel = new AnimatedModel(ScreenManager.Game.Content.Load<Model>("AnimatedModel\\dude"));
            myModel.Scale = 2.0f;
            myModel.PlayClip("Take 001");

            currentTile = TileMap.GetTileFromPos(Vector3.Zero);
            myModel.SetPosition(currentTile.Position);

            if (numTiles.X == 10 && numTiles.Y == 10)
            {
                cameraManager.SetPosition(new Vector3(0.0f, 1400.0f, 500.0f));
                cameraManager.SetLookAtPoint(new Vector3(0.0f, 0.0f, 50.0f));
            }
            else if (numTiles.X == 20 && numTiles.Y == 10)
            {
                cameraManager.SetPosition(new Vector3(0.0f, 1700.0f, 500.0f));
                cameraManager.SetLookAtPoint(new Vector3(0.0f, 0.0f, 100.0f));
            }
        }
        public MenuScreenTest()
            : base("MenuScreenTest")
        {
            MenuEntry one = new MenuEntry("PlayScreen");
            MenuEntry two = new MenuEntry("ModelAndText");
            MenuEntry three = new MenuEntry("ModelScreen");
            MenuEntry four = new MenuEntry("PlayScreen");

            one.Selected += new EventHandler<EventArgs>(one_Selected);
            two.Selected += new EventHandler<EventArgs>(two_Selected);
            three.Selected += new EventHandler<EventArgs>(three_Selected);
            four.Selected += new EventHandler<EventArgs>(four_Selected);

            items = new List<MenuEntry>();
            items.Add(one);
            items.Add(two);
            items.Add(three);
            items.Add(four);

            menuModel = ScreenManager.Game.Content.Load<Model>("MainMenu\\oilBarrel_MainMenu");
            menuTransforms = new Matrix[menuModel.Bones.Count];
            menuModel.CopyAbsoluteBoneTransformsTo(menuTransforms);

            cameraManager = (CameraManager)ScreenManager.Game.Services.GetService(typeof(CameraManager));
            cameraManager.SetPosition(new Vector3(0.0f, 0.0f, 500.0f));
            cameraManager.SetLookAtPoint(new Vector3(0.0f, 0.0f, 50.0f));
            //cameraManager.SetPosition(new Vector3(0.0f, 1700.0f, 500.0f));
            //cameraManager.SetLookAtPoint(new Vector3(0.0f, 0.0f, -500.0f));

            menuPosition = new Vector3(100.0f, 0.0f, 0.0f);

            arrows = new Texture2D[2];
            arrows[0] = ScreenManager.Game.Content.Load<Texture2D>("MainMenu\\left_arrow");
            arrows[1] = ScreenManager.Game.Content.Load<Texture2D>("MainMenu\\right_arrow");

            arrow_locations_min = new Vector2[2];
            arrow_locations_max = new Vector2[2];
            arrow_locations_min[0] = new Vector2(550.0f, 320.0f);
            arrow_locations_min[1] = new Vector2(1050.0f, 320.0f);
            arrow_locations_max[0] = new Vector2(530.0f, 320.0f);
            arrow_locations_max[1] = new Vector2(1070.0f, 320.0f);
            selected = 0;
            arrowUpdateTime = 0;
            currentArrowIndex = 0;

            a_button = ScreenManager.Game.Content.Load<Texture2D>("MainMenu\\a_button");
            a_button_position = new Vector2(720.0f, 600.0f);
            font = ScreenManager.Game.Content.Load<SpriteFont>("MainMenu\\font");
            text_position = new Vector2(790.0f, 600.0f);

            tickEffect = ScreenManager.Game.Content.Load<SoundEffect>("Sounds\\Effects\\explosion");
        }