Back to class index
| AABB::IntersectRayAABBSyntaxbool 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. Parametersfloat &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 ValueTrue if an intersection occurs, false otherwise. Performance28.737nsecs/call ≈ 34.8M calls/second ≈ 579.98k calls/frame (@ 60fps). See AlsoLeave a Comment |