DistanceToArc() public static method

Pixel distance from mouse pointer to a 3D section of a disc.

public static DistanceToArc ( Vector3 center, Vector3 normal, Vector3 from, float angle, float radius ) : float
center Vector3
normal Vector3
from Vector3
angle float
radius float
return float
Esempio n. 1
0
		public static float DistanceToDisc(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.DistanceToArc(center, normal, from, 360f, radius);
		}