UnityVectorExtensions.ClosestPointOnSegment Method (Vector2, Vector2, Vector2)
From Cinemachine
Cinemachine
![]() | UnityVectorExtensionsClosestPointOnSegment Method (Vector2, Vector2, Vector2) |
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 Vector2 p, Vector2 s0, Vector2 s1 )
Cinemachine.Utility.UnityVectorExtensions.ClosestPointOnSegment = function(p, s0, s1);
Parameters
- p
- Type: Vector2
A point in space - s0
- Type: Vector2
Start of line segment - s1
- Type: Vector2
End of line segment
Return Value
Type: SingleThe interpolation parameter representing the point on the segment, with 0==s0, and 1==s1
