Пример #1
0
        //set up the game view
        public void initialiseGameView(GraphicsDeviceManager gDevice)
        {
            graphics = gDevice;

            //initialise all the cameras
            gameCamThirdPerson = new Camera();
            gameCamThirdPerson.Initialise(new Vector3(0, 14, 40), graphics);
            gameCamThirdPerson.setCamPitch(MathHelper.ToRadians(-15));

            gameCamThirdPersonClose = new Camera();
            gameCamThirdPersonClose.Initialise(new Vector3(0, 10, 20), graphics);
            gameCamThirdPersonClose.setCamPitch(MathHelper.ToRadians(-15));

            //as this camera is from the player's POV, no pitch is necessary
            gameCamFirstPerson = new Camera();
            gameCamFirstPerson.Initialise(new Vector3(0, 3, -15), graphics);

            //the third person camera is the active camera by default
            gameCamActive = gameCamThirdPerson;

            //set both matrices to that of the currently active camera
            viewMatrix = gameCamActive.getCamViewMatrix();
            projectionMatrix = gameCamActive.getProjectionMatrix();
        }