Vector2Extensions
Namespace: Murder.Utilities
Assembly: Murder.dll
public static class Vector2Extensions
⭐ Methods
HasValue(Vector2)
public bool HasValue(Vector2 vector)
Parameters
vector
Vector2
Returns
bool
Angle(Vector2)
public float Angle(Vector2 vector)
Parameters
vector
Vector2
Returns
float
Height(Vector2)
public float Height(Vector2 vector)
A quick shorthand for when using a vector as a "size"
Parameters
vector
Vector2
Returns
float
Manhattan(Vector2)
public float Manhattan(Vector2 vector)
Parameters
vector
Vector2
Returns
float
PerpendicularCounterClockwise(Vector2, Vector2)
public float PerpendicularCounterClockwise(Vector2 vector, Vector2 other)
Parameters
vector
Vector2
other
Vector2
Returns
float
Width(Vector2)
public float Width(Vector2 vector)
A quick shorthand for when using a vector as a "size"
Parameters
vector
Vector2
Returns
float
Ceiling(Vector2)
public Point Ceiling(Vector2 vector)
Parameters
vector
Vector2
Returns
Point
Floor(Vector2)
public Point Floor(Vector2 vector)
Parameters
vector
Vector2
Returns
Point
Point(Vector2)
public Point Point(Vector2 vector)
Parameters
vector
Vector2
Returns
Point
Round(Vector2)
public Point Round(Vector2 vector)
Parameters
vector
Vector2
Returns
Point
ToGridPoint(Vector2)
public Point ToGridPoint(Vector2 vector)
Parameters
vector
Vector2
Returns
Point
XY(Vector2)
public ValueTuple<T1, T2> XY(Vector2 vector)
Parameters
vector
Vector2
Returns
ValueTuple<T1, T2>
Abs(Vector2)
public Vector2 Abs(Vector2 vector)
Parameters
vector
Vector2
Returns
Vector2
Add(Vector2, float)
public Vector2 Add(Vector2 a, float b)
Returns
Vector2
Approach(Vector2, Vector2, float)
public Vector2 Approach(Vector2 a, Vector2 b, float amount)
Parameters
a
Vector2
b
Vector2
amount
float
Returns
Vector2
Mirror(Vector2, Vector2)
public Vector2 Mirror(Vector2 vector, Vector2 center)
Parameters
vector
Vector2
center
Vector2
Returns
Vector2
Multiply(Vector2, Vector2)
public Vector2 Multiply(Vector2 a, Vector2 b)
Parameters
a
Vector2
b
Vector2
Returns
Vector2
Normalized(Vector2)
public Vector2 Normalized(Vector2 vector)
Parameters
vector
Vector2
Returns
Vector2
NormalizedWithSanity(Vector2)
public Vector2 NormalizedWithSanity(Vector2 vector)
Parameters
vector
Vector2
Returns
Vector2
Perpendicular(Vector2)
public Vector2 Perpendicular(Vector2 vector)
Returns the perpendicular vector to the given vector.
Parameters
vector
Vector2
Returns
Vector2
PerpendicularClockwise(Vector2)
public Vector2 PerpendicularClockwise(Vector2 vector)
Parameters
vector
Vector2
Returns
Vector2
PerpendicularCounterClockwise(Vector2)
public Vector2 PerpendicularCounterClockwise(Vector2 vector)
Parameters
vector
Vector2
Returns
Vector2
Reverse(Vector2)
public Vector2 Reverse(Vector2 vector)
Parameters
vector
Vector2
Returns
Vector2
Rotate(Vector2, float)
public Vector2 Rotate(Vector2 vector, float angle)
Returns a new vector, rotated by the given angle. In radians.
Parameters
vector
Vector2
angle
float
Returns
Vector2
SnapAngle(Vector2, int)
public Vector2 SnapAngle(Vector2 vector, int steps)
Snap the angel to the nearest angle, based on the number of steps in a circle.
Parameters
vector
Vector2
steps
int
Returns
Vector2
ToVector3(Vector2)
public Vector3 ToVector3(Vector2 vector)
Parameters
vector
Vector2
Returns
Vector3
⚡