UnityVectorExtensions.ClosestPointOnSegment Method (Vector3, Vector3, Vector3)
From Cinemachine
Cinemachine
![]() | UnityVectorExtensionsClosestPointOnSegment Method (Vector3, Vector3, Vector3) |
Get the closest point on a line segment.
Namespace: Cinemachine.Utility
Assembly: Cinemachine (in Cinemachine.dll) Version: 2.0.0.0 (2.0.0.0)
public static float ClosestPointOnSegment( this Vector3 p, Vector3 s0, Vector3 s1 )
Cinemachine.Utility.UnityVectorExtensions.ClosestPointOnSegment = function(p, s0, s1);
Parameters
- p
- Type: Vector3
A point in space - s0
- Type: Vector3
Start of line segment - s1
- Type: Vector3
End of line segment
Return Value
Type: SingleThe interpolation parameter representing the point on the segment, with 0==s0, and 1==s1
