intersectLineSegmentAar
- int intersectLineSegmentAar(double p0X, double p0Y, double p1X, double p1Y, double minX, double minY, double maxX, double maxY, Vector2d result)
- int intersectLineSegmentAar(Vector2d p0, Vector2d p1, Vector2d min, Vector2d max, Vector2d result)
public static
int
intersectLineSegmentAar
doml intersection_d
static functionsstatic variables
Determine whether the undirected line segment with the end points <code>p0</code> and <code>p1</code> intersects the axis-aligned rectangle given as its minimum corner <code>min</code> and maximum corner <code>max</code>, and store the values of the parameter <i>t</i> in the ray equation <i>p(t) = p0 + t * (p1 - p0)</i> of the near and far point of intersection into <code>result</code>. <p> This method also detects an intersection of a line segment whose either end point lies inside the axis-aligned rectangle. <p> Reference: <a href="https://dl.acm.org/citation.cfm?id=1198748">An Efficient and Robust Ray–Box Intersection</a>
#see {@link #intersectLineSegmentAar(double, double, double, double, double, double, double, double, Vector2d)}
@param p0 the line segment's first end point @param p1 the line segment's second end point @param min the minimum corner of the axis-aligned rectangle @param max the maximum corner of the axis-aligned rectangle @param result a vector which will hold the values of the parameter <i>t</i> in the ray equation <i>p(t) = p0 + t * (p1 - p0)</i> of the near and far point of intersection @return {@link #INSIDE} if the line segment lies completely inside of the axis-aligned rectangle; or {@link #OUTSIDE} if the line segment lies completely outside of the axis-aligned rectangle; or {@link #ONE_INTERSECTION} if one of the end points of the line segment lies inside of the axis-aligned rectangle; or {@link #TWO_INTERSECTION} if the line segment intersects two edges of the axis-aligned rectangle