|
NavMap
|

Classes | |
| struct | AABB |
| Axis-aligned bounding box. More... | |
Typedefs | |
| using | Vec3 |
| 3D vector alias used across NavMap geometry. | |
Functions | |
| bool | 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. | |
| TEST (Geometry_AABB, ContainsXYWithZEps) | |
| TEST (Geometry_AABB, ExpandPointBoxAxis) | |
| TEST (Geometry_AABB, IntersectsRayVariants) | |
| TEST (Geometry_RayTriangle, HitMissEdgeBackfaceParallel) | |
| TEST (Geometry_RayTriangle, RaysThroughASharedEdgeAlwaysHit) | |
| TEST (Geometry_TriangleArea, BasicScaledDegenerate) | |
| TEST (Geometry_TriangleNormal, OrientationAndDegenerate) | |
| float | triangle_area (const Vec3 &a, const Vec3 &b, const Vec3 &c) |
| Compute the area of a triangle ABC. | |
| Vec3 | triangle_normal (const Vec3 &a, const Vec3 &b, const Vec3 &c) |
| Compute a unit normal of triangle ABC. | |
| bool 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 true on hit and outputs:
t: parametric distance along the ray (t > 0).u, v: barycentric coordinates (with w = 1 - u - v).| orig | Ray origin. |
| dir | Ray direction (not necessarily unit length). |
| v0 | First triangle vertex. |
| v1 | Second triangle vertex. |
| v2 | Third triangle vertex. |
| t | Output ray parameter on hit (> 0). |
| u | Output barycentric u on hit. |
| v | Output barycentric v on hit. |
kEps is set conservatively for typical mapping units (meters). | TEST | ( | Geometry_AABB | , |
| ContainsXYWithZEps | ) |
| TEST | ( | Geometry_AABB | , |
| ExpandPointBoxAxis | ) |
| TEST | ( | Geometry_AABB | , |
| IntersectsRayVariants | ) |
| TEST | ( | Geometry_RayTriangle | , |
| HitMissEdgeBackfaceParallel | ) |
| TEST | ( | Geometry_RayTriangle | , |
| RaysThroughASharedEdgeAlwaysHit | ) |
| TEST | ( | Geometry_TriangleArea | , |
| BasicScaledDegenerate | ) |
| TEST | ( | Geometry_TriangleNormal | , |
| OrientationAndDegenerate | ) |
Compute the area of a triangle ABC.
| a | First vertex (world coordinates). |
| b | Second vertex (world coordinates). |
| c | Third vertex (world coordinates). |
Compute a unit normal of triangle ABC.
The normal is computed as normalized cross product (b - a) x (c - a). If the triangle is degenerate (near-zero area), returns +Z (0, 0, 1).
| a | First vertex (world coordinates). |
| b | Second vertex (world coordinates). |
| c | Third vertex (world coordinates). |