Пример #1
0
        protected override void Initialize()
        {
            base.Initialize();

            floor = new Floor(GraphicsDevice);
            floor.Initialize(Content, "Textures/checkerboard", new Vector2(20));

            tank_light = new Tank();
            tank_light.Initialize(Content.Load <Model>("Models/Tank_Light"));
            tank_light.Move(Matrix.CreateTranslation(new Vector3(10, 0, 0)), Matrix.Identity);

            tank_medium = new Tank();
            tank_medium.Initialize(Content.Load <Model>("Models/Tank_Medium"));
            tank_medium.Move(Matrix.CreateTranslation(new Vector3(0, 0, 0)), Matrix.Identity);

            tank_dual = new Tank();
            tank_dual.Initialize(Content.Load <Model>("Models/Tank_Dual"));
            tank_dual.Move(Matrix.CreateTranslation(new Vector3(-10, 0, 0)), Matrix.Identity);


            var center = new Point(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2);

            lookController     = ControlHandler.GetLookController(center);
            movementController = ControlHandler.GetMovementController(center);

            camera = new AbsoluteCamera(GraphicsDevice, lookController, movementController);
            camera.SetPosition(new Vector3(0, -20, 10));
            camera.SetRotation(Matrix.CreateFromYawPitchRoll(0, 1, 0));
        }