-
Notifications
You must be signed in to change notification settings - Fork 0
/
material.go
59 lines (45 loc) · 1.17 KB
/
material.go
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
52
53
54
55
56
57
58
59
package raytrace
import ()
type Material struct {
gloss float64
transparency float64
reflection float64
refraction float64
color DoubleColor
}
func CreateMaterial(color DoubleColor, gloss float64, transparency float64, reflection float64, refraction float64) *Material {
return &Material{color: color, gloss: gloss, transparency: transparency, reflection: reflection, refraction: refraction}
}
func (sm *Material) Gloss() float64 {
return sm.gloss
}
func (sm *Material) SetGloss(value float64) {
sm.gloss = value
}
func (sm *Material) Transparency() float64 {
return sm.transparency
}
func (sm *Material) SetTransparency(value float64) {
sm.transparency = value
}
func (sm *Material) Reflection() float64 {
return sm.reflection
}
func (sm *Material) SetReflection(value float64) {
sm.reflection = value
}
func (sm *Material) Refraction() float64 {
return sm.refraction
}
func (sm *Material) SetRefraction(value float64) {
sm.refraction = value
}
func (sm *Material) HasTexture() bool {
return false
}
func (sm *Material) GetBaseColor() DoubleColor {
return sm.color
}
func (sm *Material) GetColor(u float64, v float64) DoubleColor {
return sm.color
}