Struct Vector2
- Namespace
- AO
- Assembly
- CoreAssembly.dll
public struct Vector2
- Inherited Members
- Extension Methods
Constructors
Vector2(float, float)
public Vector2(float x, float y)
Parameters
Fields
X
public float X
Field Value
Y
public float Y
Field Value
Properties
Down
public static Vector2 Down { get; }
Property Value
Left
public static Vector2 Left { get; }
Property Value
Length
Returns the length of the vector. √(X^2 + Y^2)
public float Length { get; }
Property Value
LengthSquared
Returns the squared length of the vector. X^2 + Y^2
public float LengthSquared { get; }
Property Value
Normalized
Returns the normalized or zero vector.
public Vector2 Normalized { get; }
Property Value
One
public static Vector2 One { get; }
Property Value
Right
public static Vector2 Right { get; }
Property Value
Up
public static Vector2 Up { get; }
Property Value
Zero
public static Vector2 Zero { get; }
Property Value
Methods
Cross2DZ(Vector2, Vector2)
Computes the Z value of Cross(v3(a), v3(b)).
public static float Cross2DZ(Vector2 a, Vector2 b)
Parameters
Returns
Distance(Vector2, Vector2)
Computes the distance between two vectors.
public static float Distance(Vector2 a, Vector2 b)
Parameters
Returns
- float
Distance between the two vectors
Dot(Vector2, Vector2)
Computes the dot product of 'a' and 'b'.
public static float Dot(Vector2 a, Vector2 b)
Parameters
Returns
Lerp(Vector2, Vector2, float)
Computes a linear interpolation between 'a' and 'b' by 't'.
public static Vector2 Lerp(Vector2 a, Vector2 b, float t)
Parameters
Returns
- Vector2
Resulting vector
MoveToward(Vector2, Vector2, float)
Moves 'from' towards 'to' by delta, returning that new position and whether we arrived.
public static (Vector2, bool) MoveToward(Vector2 from, Vector2 to, float delta)
Parameters
Returns
Rotate(Vector2, float, Vector2)
Computes 'point' rotated by 'radians' about point 'pivot'.
public static Vector2 Rotate(Vector2 point, float radians, Vector2 pivot)
Parameters
Returns
RoughlyEqual(Vector2, Vector2, float)
Returns true if the two vectors are roughly equal within the given tolerance.
public static bool RoughlyEqual(Vector2 a, Vector2 b, float tolerance = 0.0001)
Parameters
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Unlerp(Vector2, Vector2, Vector2)
Computes the percentage that 'value' is between 'a' and 'b'.
public static Vector2 Unlerp(Vector2 a, Vector2 b, Vector2 value)
Parameters
Returns
Operators
operator +(Vector2, Vector2)
public static Vector2 operator +(Vector2 a, Vector2 b)
Parameters
Returns
operator /(Vector2, Vector2)
public static Vector2 operator /(Vector2 a, Vector2 b)
Parameters
Returns
operator /(Vector2, float)
public static Vector2 operator /(Vector2 a, float b)
Parameters
Returns
operator ==(Vector2, Vector2)
public static bool operator ==(Vector2 a, Vector2 b)
Parameters
Returns
operator !=(Vector2, Vector2)
public static bool operator !=(Vector2 a, Vector2 b)
Parameters
Returns
operator *(Vector2, Vector2)
public static Vector2 operator *(Vector2 a, Vector2 b)
Parameters
Returns
operator *(Vector2, float)
public static Vector2 operator *(Vector2 a, float b)
Parameters
Returns
operator -(Vector2, Vector2)
public static Vector2 operator -(Vector2 a, Vector2 b)
Parameters
Returns
operator -(Vector2)
public static Vector2 operator -(Vector2 a)
Parameters
a
Vector2