Kav/Lights/PointLight.cs

27 lines
705 B
C#
Raw Normal View History

2020-08-04 09:32:02 +00:00
using Microsoft.Xna.Framework;
namespace Kav
{
2020-08-07 08:12:46 +00:00
public struct PointLight
2020-08-04 09:32:02 +00:00
{
2020-12-10 00:10:53 +00:00
public static double ATTENUATION_EPSILON = 0.1;
2020-08-07 08:12:46 +00:00
public Vector3 Position { get; }
public Color Color { get; }
public float Intensity { get; }
2020-08-04 09:32:02 +00:00
2020-12-10 00:10:53 +00:00
public float EffectiveRadius { get; }
public BoundingSphere BoundingSphere { get; }
2020-08-05 19:15:22 +00:00
public PointLight(Vector3 position, Color color, float intensity = 1f)
2020-08-04 09:32:02 +00:00
{
Position = position;
Color = color;
Intensity = intensity;
2020-12-10 00:10:53 +00:00
EffectiveRadius = (float) System.Math.Sqrt(Intensity);
BoundingSphere = new BoundingSphere(position, EffectiveRadius);
2020-08-04 09:32:02 +00:00
}
}
}