MCPcopy
hub / github.com/fogleman/ln / Intersect

Method Intersect

ln/function.go:37–47  ·  view source on GitHub ↗
(ray Ray)

Source from the content-addressed store, hash-verified

35}
36
37func (f *Function) Intersect(ray Ray) Hit {
38 step := 1.0 / 64
39 sign := f.Contains(ray.Position(step), 0)
40 for t := step; t < 10; t += step {
41 v := ray.Position(t)
42 if f.Contains(v, 0) != sign && f.Box.Contains(v) {
43 return Hit{f, t}
44 }
45 }
46 return NoHit
47}
48
49func (f *Function) Paths3() Paths {
50 var path Path

Callers

nothing calls this directly

Calls 3

ContainsMethod · 0.95
PositionMethod · 0.80
ContainsMethod · 0.65

Tested by

no test coverage detected