35 lines
767 B
C#
35 lines
767 B
C#
using Microsoft.Xna.Framework;
|
|
|
|
namespace Kav
|
|
{
|
|
public struct DirectionalLight
|
|
{
|
|
public Vector3 Direction { get; }
|
|
public Color Color { get; }
|
|
public float Intensity { get; }
|
|
|
|
public Matrix View
|
|
{
|
|
get
|
|
{
|
|
return Matrix.CreateLookAt(Direction * 100f, Vector3.Zero, Vector3.Up);
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|