Back to class index
LineSegment[Class Summary]
a
b
ctor (+3 overloads)
GetPoint(d)[const]
CenterPoint()[const]
Reverse()
Dir()[const]
AnyPointFast()[const]
ExtremePoint(direction)[const] (+1 overload)
Translate(offset)
Transform(transform) (+3 overloads)
Length()[const]
LengthSq()[const]
IsFinite()[const]
Equals(...)[const]
BitEquals(other)[const]
Contains(...)[const] (+1 overload)
ClosestPoint(point)[const] (+10 overloads)
Distance(point)[const] (+13 overloads)
DistanceSq(point)[const] (+1 overload)
Intersects(plane)[const] (+12 overloads)
IntersectsDisc(disc)[const]
ToRay()[const]
ToLine()[const]
ProjectToAxis(...)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
FromString(str,outEndStr)[static] (+1 overload)

LineSegment::LineSegment

Syntax

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

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

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

See Also

a, b.

Syntax

LineSegment::LineSegment(const float4 &a, const float4 &b); [4 lines of code]

Constructs a line segment through the given end points.

See Also

a, b.

Syntax

LineSegment::LineSegment(const Ray &ray, float d); [4 lines of code]
LineSegment::LineSegment(const Line &line, float d); [4 lines of code]

Constructs a line segment from a ray or a line.

This constructor takes the ray/line origin position as the starting point of this line segment, and defines the end point of the line segment using the given distance parameter.

Parameters

floatdThe distance along the ray/line for the end point of this line segment. This will set b = ray.pos + d * ray.dir as the end point. When converting a ray to a line segment, it is possible to pass in a d value < 0, but in that case the resulting line segment will not lie on the ray.

See Also

a, b, classes Ray, Line, Line::GetPoint(), Ray::GetPoint().