Vect2 Add(Vect2 other) / static Vect2 Add(Vect2 a, Vect2 b)
|
Component-wise addition. |
Vect2 Subtract(Vect2 other) / static Vect2 Subtract(Vect2 a, Vect2 b)
|
Component-wise subtraction. |
Vect2 Multiply(float s) / static Vect2 Multiply(Vect2 v, float s)
|
Scale by scalar. |
Vect2 Divide(float s) / static Vect2 Divide(Vect2 v, float s)
|
Divide by scalar. |
Vect2 Abs() / static Vect2 Abs(Vect2 v)
|
Absolute value of each component. |
Vect2 Floor() / static Vect2 Floor(Vect2 v)
|
Floor each component. |
Vect2 Ceiling() / static Vect2 Ceiling(Vect2 v)
|
Ceil each component. |
Vect2 Round() / static Vect2 Round(Vect2 v, int digits)
|
Round components to nearest / specified decimals. |
Vect2 Clamp(Vect2 min, Vect2 max) / static Vect2 Clamp(Vect2 v, Vect2 min, Vect2 max)
|
Clamp components between vectors. |
float Dot(Vect2 other) / static float Dot(Vect2 a, Vect2 b)
|
Dot product. |
float Length() / static float Length(Vect2 v)
|
Euclidean length (magnitude). |
float LengthSquared() / static float LengthSquared(Vect2 v)
|
Squared length (avoid sqrt). |
float Distance(Vect2 other) / static float Distance(Vect2 a, Vect2 b)
|
Euclidean distance between vectors. |
float DistanceSquared(Vect2 other) / static float DistanceSquared(Vect2 a, Vect2 b)
|
Squared distance. |
Vect2 Normalized() / static Vect2 Normalized(Vect2 v)
|
Unit vector (length = 1). |
Vect2 Direction(Vect2 other, bool normalized) / static Vect2 Direction(Vect2 a,Vect2 b,bool)
|
Vector from this to other , optionally normalized. |
Vect2 Lerp(Vect2 a, Vect2 b, float t) |
Linear interpolation. |
float Lerp(float a, float b, float t) |
Scalar interpolation. |
Vect2 MoveTowards(Vect2 target, float maxDelta) / static Vect2 MoveTowards(Vect2 cur,Vect2 tgt,float)
|
Move component-wise toward target up to maxDelta . |
static float ToFps(float seconds) |
Convert seconds per frame to FPS: 1/seconds . |
static Vect2 Rotate(Vect2 v, float radians) / Vect2.Rotate(radians)
|
Rotate vector by angle in radians. |
static Vect2 Reflect(Vect2 vec, Vect2 normal) |
Reflect vector about a normal. |
static Vect2 To2D(int index, int size) / overloads |
Convert 1D index into 2D grid coordinate. |
static int To1D(Vect2 loc, int size) |
Convert 2D coordinate to 1D index in grid. |
static float LookAt(Vect2 a, Vect2 b) |
Angle in radians from a toward b . |
static Vect2 AngleTo(float rad, bool normalized=true) |
Convert angle to direction vector, normalized by default. |
static float WrapAngle(float radians) |
Wrap angle into range [-π, π]. |
static float TurnToFace(Vect2 target, float curRot, Vect2 origin, float speed) |
Smoothly turn toward target by max speed . |
static Vect2 Transform(Vect2 pos, Camera cam) |
Map world position to screen coords. |