GrapherApp.UI/Model/Vector3.cs
/// <summary>
///   <para>Returns a copy of vector with its magnitude clamped to maxLength.</para>
/// </summary>
/// <param name="vector"></param>
/// <param name="maxLength"></param>
Returns a copy of vector with its magnitude clamped to maxLength.
Returns a copy of vector with its magnitude clamped to maxLength .
public static Vector3 ClampMagnitude(Vector3 vector, float maxLength)
		{
			if (vector.sqrMagnitude > maxLength * maxLength)
			{
				return vector.normalized * maxLength;
			}
			return vector;
		}
public static Vector3 ClampMagnitude ( Vector3 vector , float maxLength ) { if ( vector . sqrMagnitude > maxLength * maxLength ) { return vector . normalized * maxLength ; } return vector ; }
Returns a copy of vector with its magnitude clamped to maxLength.
Returns a copy of vector with its magnitude clamped to maxLength .
vector
Vector3
None
maxLength
float
None