Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static method: void RayWithRectangle(ref EdgeD, ref RectangleD, out double, out double)

Declaration

public static void RayWithRectangle(
    ref EdgeD ray,
    ref RectangleD rect,
    out double lambda1,
    out double lambda2
)

Summary

Finds intersections between a ray and a rectangle. Returns the lambdas of intersections, if any, or NaN otherwise. Guarantees that lambda1 < lambda2, and if only one of them is NaN then it's lambda2. Lambda is such that ray.Start + lambda * (ray.End - ray.Start) gives the point of intersection.