-- | Calculate all the intersections made by a ray with a list of objects, and
-- with each object return the point of intersection's distance from the ray's
-- initial point.
intersections :: [Object] -> Ray -> [(Object, Scalar)]
intersections xs r = mapMaybe (\x -> fmap ((,) x) (mSurface x `intersect` r)) xs
intersections :: [Object] -> Ray -> [(Object, Scalar)]
intersections xs r = mapMaybe (\x -> fmap ((,) x) (mSurface x `intersect` r)) xs
intersections xs r = mapMaybe (\x -> fmap ((,) x) (mSurface x `intersect` r)) xs