Back to class index
Line[Class Summary]
pos
dir
ctor (+3 overloads)
IsFinite()[const]
GetPoint(distance)[const]
Translate(offset)
Transform(transform) (+3 overloads)
Contains(...)[const] (+2 overloads)
Equals(line,epsilon)[const]
BitEquals(other)[const]
Distance(point)[const] (+12 overloads)
ClosestPoint(targetPoint)[const] (+13 overloads)
Intersects(...)[const] (+10 overloads)
IntersectsDisc(disc)[const]
ToRay()[const]
ToLineSegment(d)[const] (+1 overload)
ProjectToAxis(...)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
AreCollinear(p1,p2,p3,epsilon)[static]
ClosestPointLineLine(...)[static]
FromString(str,outEndStr)[static] (+1 overload)

Line::ClosestPointLineLine

Syntax

void Line::ClosestPointLineLine(const float4 &start0, const float4 &dir0, const float4 &start1, const float4 &dir1, float &d, float &d2); [18 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.

Parameters

float &d [out]Receives the normalized distance of the closest point along the first line.float &d2 [out]Receives the normalized distance of the closest point along the second line.

Return Value

Returns the closest point on line start0<->end0 to the second line.

See Also

ClosestPoint(), Distance().