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]
ToOBB()[const]
MinimalEnclosingSphere()[const]
MaximalContainedSphere()[const]
IsFinite()[const]
IsDegenerate()[const]
CenterPoint()[const]
Centroid()[const]
PointInside(x,y,z)[const]
Edge(edgeIndex)[const]
CornerPoint(cornerIndex)[const]
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] (+8 overloads)
Intersects(ray,dNear,dFar)[const] (+11 overloads)
ProjectToAxis(axis,dMin,dMax)[const]
Enclose(point) (+10 overloads)
Triangulate(...)[const]
ToEdgeList(outPos)[const]
Intersection(aabb)[const]
IntersectRayAABB(...)[const]
MinimalEnclosingAABB(...)[static]
ExtremePointsAlongAABB(...)[static]
FromCenterAndSize(...)[static]
NumVerticesInTriangulation(...)[static]
NumVerticesInEdgeList()[static]

AABB::IntersectRayAABB

Syntax

bool AABB::IntersectRayAABB(const float3 &rayPos, const float3 &rayDir, float &tNear, float &tFar) const; [28 lines of code]

Computes the intersection of a ray and a 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. You probably want to use the AABB::Intersects() function instead.

Parameters

float &tNear [out]If intersection occurs, the signed distance from ray origin to the ray entry point in aabb is returned here.float &tFar [out]If intersection occurs, the signed distance from ray origin to the ray exit point in aabb is returned here.

Return Value

True if an intersection occurs, false otherwise.

Performance

28.737nsecs/call ≈ 34.8M calls/second ≈ 579.98k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

See Also

Intersects().

Leave a Comment

Name:
Comments:
Captcha:captcha image Type in the black symbols:
Back to class index