Taos API Reference
    Preparing search index...

    Function closestPointOnTri

    • Closest point on triangle (a,b,c) to query point p, with squared distance.

      Direct TS port of the WGSL routine in sdf_bake.wgsl (Ericson "Real-Time Collision Detection" §5.1.5). Kept in lockstep with the shader so the CPU helper can act as an oracle in tests.

      Parameters

      • p: [number, number, number]
      • a: [number, number, number]
      • b: [number, number, number]
      • c: [number, number, number]

      Returns ClosestPoint