struct Line

book_4_sparkGenerated
code_blocksInput

Description

The Line struct represents a line in 3D space. It provides methods to perform geometric calculations such as finding the closest point on the line to a given point or ray, and calculating distances.

Members

Properties

Member NameSummary
StartStart position of the line.
EndEnd position of the line.
DeltaReturns the result of b - a.
CenterReturns the midpoint between a and b.

Methods

Member NameSummary
TracePerforms a trace along the line with a specified radius and maximum distance.
ClosestPoint(Vector3&)Finds the closest point on the line to a given position.
ClosestPoint(Ray&, Vector3&)Finds the closest point on the line to a given ray, returning the point on the line.
ClosestPoint(Ray&, Vector3&, Vector3&)Finds the closest points on both the line and the ray.
Distance(Vector3)Calculates the distance from a point to the line.
Distance(Vector3, Vector3&)Calculates the distance from a point to the line and returns the closest point on the line.
SqrDistance(Vector3)Calculates the squared distance from a point to the line.