Nez.Portable/Utils/Extensions/Vector2Ext.cs
/// <summary>
/// temporary workaround to Vector2.Normalize screwing up the 0,0 vector
/// </summary>
/// <param name="vec">Vec.</param>
temporary workaround to Vector2.Normalize screwing up the 0,0 vector
temporary workaround to Vector2 . Normalize screwing up the 0 0 vector
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static void normalize(ref Vector2 vec)
        {
            var magnitude = Mathf.sqrt((vec.X * vec.X) + (vec.Y * vec.Y));
            if (magnitude > Mathf.epsilon)
                vec /= magnitude;
            else
                vec.X = vec.Y = 0;
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public static void normalize ( ref Vector2 vec ) { var magnitude = Mathf . sqrt ( ( vec . X * vec . X ) + ( vec . Y * vec . Y ) ) ; if ( magnitude > Mathf . epsilon ) vec /= magnitude ; else vec . X = vec . Y = 0 ; }
temporary workaround to Vector2.Normalize screwing up the 0,0 vector
temporary workaround to Vector2 . Normalize screwing up the 0 0 vector
Vector2
ref
vec
None