-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLight.cs
51 lines (43 loc) · 1.32 KB
/
Light.cs
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
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
namespace GLTerrain {
public enum LightType {
Directional,
Point,
Spot
}
public class Light {
public Vector3 Position { get; set; }
public Vector3 Direction { get; set; }
public Color4 Diffuse { get; set; }
public Color4 Specular { get; set; }
public LightType Type { get; set; }
public LightName Name { get; set; }
public bool Enabled { get; set; }
public Light(
LightName name,
LightType type,
Vector3 position,
Vector3 direction,
Color4 diffuse,
Color4 specular) {
Name = name;
Type = type;
Position = position;
if (type == LightType.Spot) {
Direction = direction;
}
Diffuse = diffuse;
Specular = specular;
Enabled = true;
}
public Light(LightName name, LightType type, Vector3 position, Vector3 direction)
: this(name, type, position, direction, Color4.White, Color4.White) {
}
public Light(LightName name, LightType type) : this(name, type, new Vector3(), new Vector3()) {
}
}
}