|Back to class index|
Syntaxbool 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
This is a low level utility function. You probably want to use the AABB::Intersects() function instead.
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.
True if an intersection occurs, false otherwise.
28.737nsecs/call ≈ 34.8M calls/second ≈ 579.98k calls/frame (@ 60fps).
Leave a Comment