Back to class index
Line[Class Summary]
pos
dir
ctor (+3 overloads)
GetPoint(distance)[const]
Transform(transform) (+3 overloads)
Contains(...)[const] (+2 overloads)
Equals(line,epsilon)[const]
Distance(point,d)[const] (+8 overloads)
ClosestPoint(targetPoint,d)[const] (+4 overloads)
Intersects(...)[const] (+8 overloads)
IntersectsDisc(disc)[const]
ToRay()[const]
ToLineSegment(d)[const]
AreCollinear(p1,p2,p3,epsilon)[static]
ClosestPointLineLine(...)[static]

Line::ClosestPointLineLine

Syntax

float3 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.

Parameters

float *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 Value

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

Performance

28.737nsecs/call ≈ 34.8M calls/second ≈ 579.98k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

See Also

ClosestPoint(), Distance().

User Comments

On 2014-07-24 06:37, anonymous wrote:

The link is broken.

Leave a Comment

Name:
Comments:
Captcha:captcha image Type in the black symbols:
Back to class index