Back to class index
AABB[Class Summary]
minPoint
maxPoint
ctor (+3 overloads)
MinX()[const]
MinY()[const]
MinZ()[const]
MaxX()[const]
MaxY()[const]
MaxZ()[const]
SetNegativeInfinity()
SetFromCenterAndSize(center,size)
SetFrom(obb) (+2 overloads)
ToPolyhedron()[const]
ToPBVolume()[const]
ToOBB()[const]
MinimalEnclosingSphere()[const]
MaximalContainedSphere()[const]
IsFinite()[const]
IsDegenerate()[const]
CenterPoint()[const]
Centroid()[const]
AnyPointFast()[const]
PointInside(x,y,z)[const]
Edge(edgeIndex)[const]
CornerPoint(cornerIndex)[const]
ExtremePoint(direction)[const] (+1 overload)
PointOnEdge(edgeIndex,u)[const]
FaceCenterPoint(faceIndex)[const]
FacePoint(faceIndex,u,v)[const]
FaceNormal(faceIndex)[const]
FacePlane(faceIndex)[const]
GetCornerPoints(outPointArray)[const]
GetFacePlanes(outPlaneArray)[const]
Size()[const]
HalfSize()[const]
Diagonal()[const]
HalfDiagonal()[const]
Volume()[const]
SurfaceArea()[const]
RandomPointInside(rng)[const]
RandomPointOnSurface(rng)[const]
RandomPointOnEdge(rng)[const]
RandomCornerPoint(rng)[const]
Translate(offset)
Scale(...) (+1 overload)
TransformAsAABB(transform) (+3 overloads)
Transform(transform)[const] (+3 overloads)
ClosestPoint(targetPoint)[const]
Distance(point)[const] (+1 overload)
Contains(point)[const] (+10 overloads)
Intersects(ray,dNear,dFar)[const] (+14 overloads)
ProjectToAxis(axis,dMin,dMax)[const]
UniqueFaceNormals(out)[const]
UniqueEdgeDirections(out)[const]
Enclose(point) (+11 overloads)
Triangulate(...)[const]
ToEdgeList(outPos)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
Intersection(aabb)[const]
IntersectLineAABB(...)[const]
IntersectLineAABB_CPP(...)[const]
Equals(rhs,epsilon)[const]
BitEquals(other)[const]
NumFaces()[static]
NumEdges()[static]
NumVertices()[static]
MinimalEnclosingAABB(...)[static]
ExtremePointsAlongAABB(...)[static]
FromCenterAndSize(...)[static]
NumVerticesInTriangulation(...)[static]
NumVerticesInEdgeList()[static]
FromString(str,outEndStr)[static] (+1 overload)

AABB::IntersectLineAABB

Syntax

bool AABB::IntersectLineAABB(const float4 &linePos, const float4 &lineDir, float &tNear, float &tFar) const; [7 lines of code]

Computes the intersection of a line, ray or line segment and an AABB.

Based on "T. Kay, J. Kajiya. Ray Tracing Complex Scenes. SIGGRAPH 1986 vol 20, number 4. pp. 269-" http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter3.htm

Note
This is a low level utility function. It may be more convenient to use one of the AABB::Intersects() functions instead.

Parameters

const float4 &linePosThe starting position of the line. const float4 &lineDirThe direction of the line. This direction vector must be normalized! float &tNear [in, out]For the test, the input line is treated as a line segment. Pass in the signed distance from the line origin to the start of the line. For a Line-AABB test, -FLOAT_INF is typically passed here. For a Ray-AABB test, 0.0f should be inputted. If intersection occurs, the signed distance from line origin to the line entry point in the AABB is returned here.float &tFar [in, out]Pass in the signed distance from the line origin to the end of the line. For Line-AABB and Ray-AABB tests, pass in FLOAT_INF. For a LineSegment-AABB test, pass in the length of the line segment here. If intersection occurs, the signed distance from line origin to the line exit point in the AABB is returned here.

Return Value

True if an intersection occurs, false otherwise.

See Also

Intersects().