2020-08-07 08:12:46 +00:00
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
|
|
|
namespace Kav
|
|
|
|
{
|
|
|
|
public struct DirectionalLight
|
|
|
|
{
|
|
|
|
public Vector3 Direction { get; set; }
|
|
|
|
public Color Color { get; set; }
|
|
|
|
public float Intensity { get; set; }
|
|
|
|
|
|
|
|
public Matrix View
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2020-08-27 21:46:20 +00:00
|
|
|
return Matrix.CreateLookAt(Direction * 100f, Vector3.Zero, Vector3.Up);
|
2020-08-07 08:12:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Matrix Projection
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return Matrix.CreateOrthographic(20f, 20f, 1f, 101f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public DirectionalLight(Vector3 direction, Color color, float intensity = 1f)
|
|
|
|
{
|
|
|
|
Direction = direction;
|
|
|
|
Color = color;
|
|
|
|
Intensity = intensity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|