using Microsoft.Xna.Framework;

namespace AdvancedXNAGamesWP
{
	public class Camera
	{
		public Matrix Projection { get; private set; }
		public Matrix View { get; private set; }

		private Vector3 _viewPosition;
		private Vector3 _lookAt = Vector3.Zero;

		public Camera(float fov, float aspectRatio, float nearPlane, float farPlane)
		{
			Projection = Matrix.CreatePerspectiveFieldOfView(fov, aspectRatio, nearPlane, farPlane);
		}

		public Vector3 LookAt
		{
			get { return _lookAt; }
			set
			{
				_lookAt = value;
				View = Matrix.CreateLookAt(_viewPosition, _lookAt, Vector3.Up);
			}
		}

		public Vector3 ViewPosition
		{
			get { return _viewPosition; }
			set
			{
				_viewPosition = value;
				View = Matrix.CreateLookAt(_viewPosition, _lookAt, Vector3.Up);
			}
		}
	}
}
