(shapes []Shape)
| 11 | } |
| 12 | |
| 13 | func NewTree(shapes []Shape) *Tree { |
| 14 | box := BoxForShapes(shapes) |
| 15 | node := NewNode(shapes) |
| 16 | node.Split(0) |
| 17 | return &Tree{box, node} |
| 18 | } |
| 19 | |
| 20 | func (tree *Tree) Intersect(r Ray) Hit { |
| 21 | tmin, tmax := tree.Box.Intersect(r) |
no test coverage detected