lib/mittsu/math/ray.rb in mittsu-0.3.2 vs lib/mittsu/math/ray.rb in mittsu-0.3.3
- old
+ new
@@ -136,10 +136,10 @@
v1.sub_vectors(sphere.center, @origin)
tca = v1.dot(@direction)
d2 = v1.dot(v1) - tca * tca
radius2 = sphere.radius * sphere.radius
return nil if d2 > radius2
- thc = Math.sqrt(radius2 - d2)
+ thc = ::Math.sqrt(radius2 - d2)
# t0 = first intersect point - entrance on front of sphere
t0 = tca - thc
# t1 = second intersect point - exit point on back of sphere
t1 = tca + thc
# test to see if both t0 and t1 are behind the ray - if so, return nil