intersectRayAar
- int intersectRayAar(double originX, double originY, double dirX, double dirY, double minX, double minY, double maxX, double maxY, Vector2d result)
public static
int
intersectRayAar
- int intersectRayAar(Vector2d origin, Vector2d dir, Vector2d min, Vector2d max, Vector2d result)
doml intersection_d
static functionsstatic variables
Determine whether the given ray with the origin <code>(originX, originY)</code> and direction <code>(dirX, dirY)</code> intersects the axis-aligned rectangle given as its minimum corner <code>(minX, minY)</code> and maximum corner <code>(maxX, maxY)</code>, and return the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the near and far point of intersection as well as the side of the axis-aligned rectangle the ray intersects. <p> This method also detects an intersection for a ray whose origin 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 #intersectRayAar(Vector2d, Vector2d, Vector2d, Vector2d, Vector2d)
@param originX the x coordinate of the ray's origin @param originY the y coordinate of the ray's origin @param dirX the x coordinate of the ray's direction @param dirY the y coordinate of the ray's direction @param minX the x coordinate of the minimum corner of the axis-aligned rectangle @param minY the y coordinate of the minimum corner of the axis-aligned rectangle @param maxX the x coordinate of the maximum corner of the axis-aligned rectangle @param maxY the y coordinate of 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) = origin + t * dir</i> of the near and far point of intersection @return the side on which the near intersection occurred as one of {@link #AAR_SIDE_MINX}, {@link #AAR_SIDE_MINY}, {@link #AAR_SIDE_MAXX} or {@link #AAR_SIDE_MAXY}; or <code>-1</code> if the ray does not intersect the axis-aligned rectangle;