Vector2Helper

Namespace: Murder.Utilities
Assembly: Murder.dll

public static class Vector2Helper

⭐ Properties

Center

public static Vector2 Center { get; }

Returns
Vector2

Down

public static Vector2 Down { get; }

Returns
Vector2

Up

public static Vector2 Up { get; }

Returns
Vector2

⭐ Methods

CalculateAngle(Vector2, Vector2, Vector2)

public float CalculateAngle(Vector2 a, Vector2 b, Vector2 c)

Calculates the internal angle of a triangle.

Parameters
a Vector2

b Vector2

c Vector2

Returns
float

Deviation(Vector2, Vector2)

public float Deviation(Vector2 vec1, Vector2 vec2)

Parameters
vec1 Vector2
vec2 Vector2

Returns
float

FromAngle(float)

public Vector2 FromAngle(float angle)

Creates a vector from an angle in radians.

Parameters
angle float

Returns
Vector2

LerpSnap(Vector2, Vector2, double, float)

public Vector2 LerpSnap(Vector2 origin, Vector2 target, double factor, float threshold)

Parameters
origin Vector2
target Vector2
factor double
threshold float

Returns
Vector2

LerpSnap(Vector2, Vector2, float, float)

public Vector2 LerpSnap(Vector2 origin, Vector2 target, float factor, float threshold)

Parameters
origin Vector2
target Vector2
factor float
threshold float

Returns
Vector2

RoundTowards(Vector2, Vector2)

public Vector2 RoundTowards(Vector2 value, Vector2 towards)

Parameters
value Vector2
towards Vector2

Returns
Vector2

Squish(float)

public Vector2 Squish(float ammount)

Returns a one unit vector, squished by . A positive number increases the X, a negative number increases the Y

Parameters
ammount float

Returns
Vector2