Function rayTriangleIntersect

  • Computes the intersection of a 3D ray with a 3D triangle.

    Parameters

    • origin: Vec3

      The ray origin.

    • dir: Vec3

      The ray direction.

    • a: Vec3

      First vertex of the triangle.

    • b: Vec3

      Second vertex of the triangle.

    • c: Vec3

      Third vertex of the triangle.

    • isect: Vec3

      The intersection point (output).

    Returns Vec3

    The intersection point if an intersection occurs, otherwise null.