Normalize() 공개 정적인 메소드

public static Normalize ( Vector2 p ) : Vector2
p Vector2
리턴 Vector2
예제 #1
0
    // Token: 0x0600001B RID: 27 RVA: 0x000027C4 File Offset: 0x00000BC4
    public static Vector2 NearestPointStrict(Vector2 lineStart, Vector2 lineEnd, Vector2 point)
    {
        Vector2 p      = lineEnd - lineStart;
        Vector2 vector = Mathfx.Normalize(p);
        float   value  = Vector2.Dot(point - lineStart, vector) / Vector2.Dot(vector, vector);

        return(lineStart + Mathf.Clamp(value, 0f, p.magnitude) * vector);
    }
예제 #2
0
    // Token: 0x06000026 RID: 38 RVA: 0x00002B80 File Offset: 0x00000F80
    public static Vector2 NearestPointOnCircle(Vector2 p, Vector2 center, float w)
    {
        Vector2 vector = p - center;

        vector  = Mathfx.Normalize(vector);
        vector *= w;
        return(center + vector);
    }