| 500 | */ |
| 501 | |
| 502 | bool AABBTree::TraceRay(const Vec3& start, const Vector3& dir, float& outT, float& u, float& v, float& w, float& faceSign, uint32_t& faceIndex) const |
| 503 | { |
| 504 | //s_traceDepth = 0; |
| 505 | |
| 506 | Vector3 rcp_dir(1.0f/dir.x, 1.0f/dir.y, 1.0f/dir.z); |
| 507 | |
| 508 | outT = FLT_MAX; |
| 509 | TraceRecursive(0, start, dir, outT, u, v, w, faceSign, faceIndex); |
| 510 | |
| 511 | return (outT != FLT_MAX); |
| 512 | } |
| 513 | |
| 514 | |
| 515 | void AABBTree::TraceRecursive(uint32_t nodeIndex, const Vec3& start, const Vector3& dir, float& outT, float& outU, float& outV, float& outW, float& faceSign, uint32_t& faceIndex) const |