intersectLineSegmentAab
- int intersectLineSegmentAab(double p0X, double p0Y, double p0Z, double p1X, double p1Y, double p1Z, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, Vector2d result)
public static
int
intersectLineSegmentAab
(,,,,,,,,,,,,) - int intersectLineSegmentAab(Vector3d p0, Vector3d p1, Vector3d min, Vector3d max, Vector2d result)
doml intersection_d
static functionsstatic variables
Determine whether the undirected line segment with the end points <code>(p0X, p0Y, p0Z)</code> and <code>(p1X, p1Y, p1Z)</code> intersects the axis-aligned box given as its minimum corner <code>(minX, minY, minZ)</code> and maximum corner <code>(maxX, maxY, maxZ)</code>, and return the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + p0 * (p1 - p0)</i> of the near and far point of intersection. <p> This method returns <code>true</code> for a line segment whose either end point lies inside the axis-aligned box. <p> Reference: <a href="https://dl.acm.org/citation.cfm?id=1198748">An Efficient and Robust Ray–Box Intersection</a>
@see #intersectLineSegmentAab(Vector3d, Vector3d, Vector3d, Vector3d, Vector2d)
@param p0X the x coordinate of the line segment's first end point @param p0Y the y coordinate of the line segment's first end point @param p0Z the z coordinate of the line segment's first end point @param p1X the x coordinate of the line segment's second end point @param p1Y the y coordinate of the line segment's second end point @param p1Z the z coordinate of the line segment's second end point @param minX the x coordinate of one corner of the axis-aligned box @param minY the y coordinate of one corner of the axis-aligned box @param minZ the z coordinate of one corner of the axis-aligned box @param maxX the x coordinate of the opposite corner of the axis-aligned box @param maxY the y coordinate of the opposite corner of the axis-aligned box @param maxZ the y coordinate of the opposite corner of the axis-aligned box @param result a vector which will ing 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 iff the line segment intersects the axis-aligned box @return {@link #INSIDE} if the line segment lies completely inside of the axis-aligned box; or {@link #OUTSIDE} if the line segment lies completely outside of the axis-aligned box; or {@link #ONE_INTERSECTION} if one of the end points of the line segment lies inside of the axis-aligned box; or {@link #TWO_INTERSECTION} if the line segment intersects two sides of the axis-aligned box or lies on an edge or a side of the box