Back to class index
| Line::ClosestPointLineLineSyntaxfloat3 Line::ClosestPointLineLine(float3 start0, float3 end0, float3 start1, float3 end1, float *d, float *d2); [16 lines of code]Computes the closest point pair on two lines. The first line is specified by two points start0 and end0. The second line is specified by two points start1 and end1. The implementation of this function follows http://paulbourke.net/geometry/lineline3d/ . Note This is a low-level utility function. You probably want to use ClosestPoint() or Distance() instead. Parametersfloat *d [out]If specified, receives the normalized distance of the closest point along the first line. This pointer may be left null.float *d2 [out]If specified, receives the normalized distance of the closest point along the second line. This pointer may be left null. Return ValueReturns the closest point on line start0<->end0 to the second line. Performance28.737nsecs/call ≈ 34.8M calls/second ≈ 579.98k calls/frame (@ 60fps). See AlsoLeave a Comment |