-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLight.cs
More file actions
40 lines (29 loc) · 1.09 KB
/
Light.cs
File metadata and controls
40 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using Microsoft.Xna.Framework;
namespace LevelEditor.Engine
{
/// <summary>
/// Represents a light which can be added to a scene.
/// </summary>
internal sealed class Light
{
public Vector3 mLocation;
public Vector3 mColor;
public Shadow mShadow;
public float mAmbient;
/// <summary>
/// Constructs a <see cref="Light"/>.
/// </summary>
/// <param name="location">The location of the light.</param>
/// <param name="color">The color of the light in the range of [0.0-1.0] per component (RGB).</param>
/// <param name="ambient">The minimum brightness of the darkest regions.</param>
public Light(Vector3 location = default(Vector3),
Vector3 color = default(Vector3),
float ambient = 0.2f)
{
mLocation = (location == default(Vector3)) ? new Vector3(0.0f, 2000.0f, 0.0f) : location;
mColor = (color == default(Vector3)) ? new Vector3(1.0f) : color;
mAmbient = ambient;
mShadow = new Shadow(this);
}
}
}