public Intersection FindClosestIntersectionWith(Ray ray) { Intersection closest = null; if (_left != null && _leftBounds.IntersectsRay(ray, 0, double.PositiveInfinity)) { closest = _left.FindClosestIntersectionWith(ray); } if (_right != null && _rightBounds.IntersectsRay(ray, 0, (closest != null) ? closest.Distance : double.PositiveInfinity)) { closest = Intersection.Closest(closest, _right.FindClosestIntersectionWith(ray)); } return(closest); }
public Color DetermineRayColor(Ray ray, IIntersectable scene) { var intersection = scene.FindClosestIntersectionWith(ray); return intersection == null ? Color.Black : intersection.Color; }
public Color DetermineRayColor(Ray ray, IIntersectable scene) { var intersection = scene.FindClosestIntersectionWith(ray); return(intersection == null ? Color.Black : intersection.Color); }