Example #1
0
        public override void IntersectLocal(ref Tuple origin, ref Tuple direction, Intersections intersections)
        {
            Intersections leftXs = new Intersections();

            Left.Intersect(ref origin, ref direction, leftXs);
            var rightXs = new Intersections();

            Right.Intersect(ref origin, ref direction, rightXs);
            Intersections result;

            if (leftXs.Any() || rightXs.Any())
            {
                var xs = new Intersections(leftXs.Concat(rightXs));
                result = Filter(xs);
                intersections.AddRange(result);
            }
        }