-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestmutability.nim
46 lines (37 loc) · 992 Bytes
/
testmutability.nim
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
import glm
import typetraits
type
Light* = object
dir*: Vec3f
color*: Vec3f
intensity*: float32
projView*: Mat4f
shMapWidth*: int32
shMapHeight*: int32
txrID*: uint32
txrUnit*: uint32
FBOID*: uint32
rerender*: bool
var lights: seq[Light]
var light0 = Light(
dir: vec3f(1.0, -0.5, -0.5),
color: vec3f(1.0 * 2.0, 0.8 * 2.0, 0.6 * 2.0),
intensity: 900.0,
shMapWidth: 4096,
shMapHeight: 4096,
rerender: true)
var light1 = Light(
dir: vec3f(1, -0.25, -0.25),
color: vec3f(1.0 * 2.0, 0.8 * 2.0, 0.6 * 2.0),
intensity: 900.0,
shMapWidth: 4096,
shMapHeight: 4096,
rerender: true)
lights.add(light0)
lights.add(light1)
for it in lights:
#echo lights[it].intensity
echo it.type.name
var varit = it
varit.intensity = 1000.0
echo it.intensity, " ", varit.intensity