struct TLineSegment3

template<typename T>

Represents a line segment in three dimensional space defined by a start and an end point.

Public

Constructors

TLineSegment3<T>

TLineSegment3<T>() = default

TLineSegment3<T>

TLineSegment3<T>(const TVector3<T> &start, const TVector3<T> &end)

Methods

GetNearestPoint

std::pair<std::array<TVector3<T>, 2>, T> GetNearestPoint(const TRay<T> &ray) const

Find the nearest point on the line segment and the provided ray.

Returns: Set of nearest points and distance from the points. First nearest point is a point along the ray, while the second is along the line segment.

GetLength

T GetLength() const

Returns the length of the line segment.

GetCenter

TVector3<T> GetCenter() const

Returns the center point along the line segment.

Fields

Start

TVector3<T> Start

End

TVector3<T> End