コード例 #1
0
ファイル: Game1.cs プロジェクト: BDG123321GDB/XNA-TrabM2
        public void InicializaCamera(GraphicsDevice device)
        {
            camera = new ChaseCamera();
            // Set the camera offsets
            camera.DesiredPositionOffset = new Vector3(0.0f, 2.0f, 3.0f);
            camera.LookAtOffset          = new Vector3(0.0f, 1.0f, 0.0f);
            // Set the camera aspect ratio
            camera.AspectRatio = (float)device.Viewport.Width / device.Viewport.Height;

            // Perform an inital reset on the camera so that it starts at the resting
            // position. If we don't do this, the camera will start at the origin and
            // race across the world to get behind the chased object.
            // This is performed here because the aspect ratio is needed by Reset.
            UpdateCamera(new GameTime(), player.position, player.direction);
            camera.Reset();
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: BigDogsGames/XNA-TrabM2
        public void InicializaCamera(GraphicsDevice device)
        {
            camera = new ChaseCamera();
            // Set the camera offsets
            camera.DesiredPositionOffset = new Vector3(0.0f, 2.0f, 3.0f);
            camera.LookAtOffset = new Vector3(0.0f, 1.0f, 0.0f);
            // Set the camera aspect ratio
            camera.AspectRatio = (float)device.Viewport.Width / device.Viewport.Height;

            // Perform an inital reset on the camera so that it starts at the resting
            // position. If we don't do this, the camera will start at the origin and
            // race across the world to get behind the chased object.
            // This is performed here because the aspect ratio is needed by Reset.
            UpdateCamera(new GameTime(), player.position, player.direction);
            camera.Reset();
        }