intersectRayAar

Determine whether the given ray with the given <code>origin</code> and direction <code>dir</code> intersects the axis-aligned rectangle given as its minimum corner <code>min</code> and maximum corner <code>max</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(double, double, double, double, double, double, double, double, Vector2d)

@param origin the ray's origin @param dir the ray's direction @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) = 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;

  1. int intersectRayAar(double originX, double originY, double dirX, double dirY, double minX, double minY, double maxX, double maxY, Vector2d result)
  2. int intersectRayAar(Vector2d origin, Vector2d dir, Vector2d min, Vector2d max, Vector2d result)
    public static
    int
    intersectRayAar

Meta