-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintersectioninfo.go
80 lines (59 loc) · 1.38 KB
/
intersectioninfo.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package raytrace
type IntersectionInfo struct {
// indicates if the shape was hit
isHit bool
// counts the number of shapes that were hit
hitCount int
// the closest shape that was intersected
element IShape
// position of intersection
position Vector
// normal vector on intesection point
normal Vector
// color at intersection
color DoubleColor
// distance from point to screen
distance float64
}
func (i *IntersectionInfo) IsHit() bool {
return i.isHit
}
func (i *IntersectionInfo) SetIsHit(value bool) {
i.isHit = value
}
func (i *IntersectionInfo) HitCount() int {
return i.hitCount
}
func (i *IntersectionInfo) SetHitCount(value int) {
i.hitCount = value
}
func (i *IntersectionInfo) Element() IShape {
return i.element
}
func (i *IntersectionInfo) SetElement(value IShape) {
i.element = value
}
func (i *IntersectionInfo) Position() Vector {
return i.position
}
func (i *IntersectionInfo) SetPosition(value Vector) {
i.position = value
}
func (i *IntersectionInfo) Normal() Vector {
return i.normal
}
func (i *IntersectionInfo) SetNormal(value Vector) {
i.normal = value
}
func (i *IntersectionInfo) Color() DoubleColor {
return i.color
}
func (i *IntersectionInfo) SetColor(value DoubleColor) {
i.color = value
}
func (i *IntersectionInfo) Distance() float64 {
return i.distance
}
func (i *IntersectionInfo) SetDistance(value float64) {
i.distance = value
}