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)
- int intersectLineSegmentAab(Vector3d p0, Vector3d p1, Vector3d min, Vector3d max, Vector2d result)
public static
int
intersectLineSegmentAab
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 box 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 + 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 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 box @param max the maximum corner of the axis-aligned box @param result a vector which will hold the resulting 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