Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/FMath
Description
Find closest point on a Sphere to a Line. When line intersects Sphere, then closest point to LineOrigin is returned.
| Name | SphereDistToLine |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h |
| Include Path | #include "Math/UnrealMathUtility.h" |
| Source | /Engine/Source/Runtime/Core/Private/Math/UnrealMath.cpp |
static void SphereDistToLine
(
FVector SphereOrigin,
float SphereRadius,
FVector LineOrigin,
FVector LineDir,
FVector & OutClosestPoint
)
Parameters
| Name | Remarks |
|---|---|
| SphereOrigin | Origin of Sphere |
| SphereRadius | Radius of Sphere |
| LineOrigin | Origin of line |
| LineDir | Direction of line. Needs to be normalized!! |
| OutClosestPoint | Closest point on sphere to given line. |