The Line struct represents a line in 3D space. It provides methods to perform various geometric calculations such as finding the closest point on the line to a given point or ray, and calculating distances.
The Line struct represents a line in 3D space. It provides methods to perform various geometric calculations such as finding the closest point on the line to a given point or ray, and calculating distances.
Member Name | Summary |
---|---|
Start | Start position of the line. |
End | End position of the line. |
Delta | Returns the result of b - a. |
Center | Returns the midpoint between a and b. |
Member Name | Summary |
---|---|
Trace | Traces a ray against the line with a specified radius and maximum distance. |
ClosestPoint(Vector3& pos) | Finds the closest point on the line to a given position. |
ClosestPoint(Ray& ray, Vector3& point_on_line) | Finds the closest point on the line to a given ray. |
ClosestPoint(Ray& ray, Vector3& point_on_line, Vector3& point_on_ray) | Finds the closest points on both the line and the ray. |
Distance(Vector3 pos) | Calculates the distance from a point to the line. |
Distance(Vector3 pos, Vector3& closestPoint) | Calculates the distance from a point to the line and returns the closest point on the line. |
SqrDistance(Vector3 pos) | Calculates the squared distance from a point to the line. |