Function navmap::ray_triangle_intersect
Defined in File Geometry.hpp
Function Documentation
-
inline bool navmap::ray_triangle_intersect(const Vec3 &orig, const Vec3 &dir, const Vec3 &v0, const Vec3 &v1, const Vec3 &v2, float &t, float &u, float &v)
Möller–Trumbore ray–triangle intersection.
Solves intersection between a ray (orig + t * dir, t > 0) and triangle (v0, v1, v2). Returns
trueon hit and outputs:t:parametric distance along the ray (t > 0).u,v:barycentric coordinates (with w = 1 - u - v).
Warning
Numerical robustness depends on the geometry scale;
kEpsis set conservatively for typical mapping units (meters).- Parameters:
- Returns:
True if the ray intersects the triangle with t > 0.