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::Line

Syntax

Line::Line(); [1 line of code]

The default constructor does not initialize any members of this class.

This means that the values of the members pos and dir are undefined after creating a new Line using this default constructor. Remember to assign to them before use.

See Also

pos, dir.

Syntax

Line::Line(const float4 &pos, const float4 &dir); [5 lines of code]

Constructs a new line by explicitly specifying the member variables.

Parameters

const float4 &posThe origin position of the line. const float4 &dirThe direction of the line. This vector must be normalized, this function will not normalize the vector for you (for performance reasons).

See Also

pos, dir.

Syntax

Line::Line(const Ray &ray); [5 lines of code]

Converts a Ray to a Line.

This conversion simply copies the members pos and dir over from the given Ray to this Line. This means that the new Line starts at the same position, but extends to two directions in space, instead of one.

See Also

class Ray, ToRay().

Syntax

Line::Line(const LineSegment &lineSegment); [4 lines of code]

Converts a LineSegment to a Line.

This constructor sets pos = lineSegment.a, and dir = (lineSegment.b - lineSegment.a).Normalized().

See Also

class LineSegment, ToLineSegment().