Get the point on an arc (in 3D space) which is closest to the current mouse position.
public static Vector3 ClosestPointToArc(Vector3 center, Vector3 normal, Vector3 from, float angle, float radius) { Vector3[] dest = new Vector3[60]; Handles.SetDiscSectionPoints(dest, 60, center, normal, from, angle, radius); return ClosestPointToPolyLine(dest); }
public static Vector3 ClosestPointToDisc(Vector3 center, Vector3 normal, float radius) { Vector3 from = Vector3.Cross(normal, Vector3.up); if (from.sqrMagnitude < 0.001f) { from = Vector3.Cross(normal, Vector3.right); } return HandleUtility.ClosestPointToArc(center, normal, from, 360f, radius); }