public static ClosestPointToDisc ( Vector3 center, Vector3 normal, float radius ) : Vector3 | ||
center | Vector3 | |
normal | Vector3 | |
radius | float | |
return | Vector3 |
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 ClosestPointToArc(center, normal, from, 360f, radius);
}