Kav/Camera.cs

24 lines
537 B
C#
Raw Normal View History

2020-08-04 09:32:02 +00:00
using Microsoft.Xna.Framework;
namespace Kav
{
2020-08-06 06:58:18 +00:00
public struct Camera
2020-08-04 09:32:02 +00:00
{
2020-08-06 06:58:18 +00:00
public Matrix Transform { get; }
2020-08-05 19:15:22 +00:00
public Matrix View
{
2020-08-04 09:32:02 +00:00
get
{
2020-08-06 06:58:18 +00:00
return Matrix.CreateLookAt(Transform.Translation, Transform.Translation + Transform.Forward, Transform.Up);
2020-08-04 09:32:02 +00:00
}
}
2020-08-06 06:58:18 +00:00
public Matrix Projection { get; }
2020-08-04 09:32:02 +00:00
2020-08-06 06:58:18 +00:00
public Camera(Matrix transform, Matrix projection)
2020-08-05 19:15:22 +00:00
{
Transform = transform;
2020-08-06 06:58:18 +00:00
Projection = projection;
2020-08-04 09:32:02 +00:00
}
}
}