SHVDN
v3
An ASI plugin for Grand Theft Auto V, which allows running scripts written in any .NET language in-game. Developed by crosire https://github.com/crosire/scripthookvdotnet/
|
Public Member Functions | |
Vector2 (float x, float y) | |
Initializes a new instance of the Vector2 class. More... | |
float | Length () |
Calculates the length of the vector. More... | |
float | LengthSquared () |
Calculates the squared length of the vector. More... | |
void | Normalize () |
Converts the vector into a unit vector. More... | |
float | DistanceTo (Vector2 position) |
Calculates the distance between two vectors. More... | |
float | DistanceToSquared (Vector2 position) |
Calculates the squared distance between two vectors. More... | |
float | ToHeading () |
Converts a vector to a heading. More... | |
override string | ToString () |
Converts the value of the object to its equivalent string representation. More... | |
string | ToString (string format) |
Converts the value of the object to its equivalent string representation. More... | |
override int | GetHashCode () |
Returns the hash code for this instance. More... | |
override bool | Equals (object obj) |
Returns a value that indicates whether the current instance is equal to a specified object. More... | |
bool | Equals (Vector2 other) |
Returns a value that indicates whether the current instance is equal to the specified object. More... | |
Static Public Member Functions | |
static float | Distance (Vector2 position1, Vector2 position2) |
Calculates the distance between two vectors. More... | |
static float | DistanceSquared (Vector2 position1, Vector2 position2) |
Calculates the squared distance between two vectors. More... | |
static float | Angle (Vector2 from, Vector2 to) |
Returns the angle in degrees between from and to. The angle returned is always the acute angle between the two vectors. More... | |
static float | SignedAngle (Vector2 from, Vector2 to) |
Returns the signed angle in degrees between from and to. More... | |
static Vector2 | RandomXY () |
Returns a new normalized vector with random X and Y components. More... | |
static Vector2 | Add (Vector2 left, Vector2 right) |
Adds two vectors. More... | |
static Vector2 | Subtract (Vector2 left, Vector2 right) |
Subtracts two vectors. More... | |
static Vector2 | Multiply (Vector2 value, float scale) |
Scales a vector by the given value. More... | |
static Vector2 | Multiply (Vector2 left, Vector2 right) |
Multiplies a vector with another by performing component-wise multiplication. More... | |
static Vector2 | Divide (Vector2 value, float scale) |
Scales a vector by the given value. More... | |
static Vector2 | Negate (Vector2 value) |
Reverses the direction of a given vector. More... | |
static Vector2 | Clamp (Vector2 value, Vector2 min, Vector2 max) |
Restricts a value to be within a specified range. More... | |
static Vector2 | Lerp (Vector2 start, Vector2 end, float amount) |
Performs a linear interpolation between two vectors. More... | |
static Vector2 | Normalize (Vector2 vector) |
Converts the vector into a unit vector. More... | |
static float | Dot (Vector2 left, Vector2 right) |
Calculates the dot product of two vectors. More... | |
static Vector2 | Reflect (Vector2 vector, Vector2 normal) |
Returns the reflection of a vector off a surface that has the specified normal. More... | |
static Vector2 | Minimize (Vector2 left, Vector2 right) |
Returns a vector containing the smallest components of the specified vectors. More... | |
static Vector2 | Maximize (Vector2 left, Vector2 right) |
Returns a vector containing the largest components of the specified vectors. More... | |
static Vector2 | operator+ (Vector2 left, Vector2 right) |
Adds two vectors. More... | |
static Vector2 | operator- (Vector2 left, Vector2 right) |
Subtracts two vectors. More... | |
static Vector2 | operator- (Vector2 value) |
Reverses the direction of a given vector. More... | |
static Vector2 | operator* (Vector2 vector, float scale) |
Scales a vector by the given value. More... | |
static Vector2 | operator* (float scale, Vector2 vector) |
Scales a vector by the given value. More... | |
static Vector2 | operator/ (Vector2 vector, float scale) |
Scales a vector by the given value. More... | |
static bool | operator== (Vector2 left, Vector2 right) |
Tests for equality between two objects. More... | |
static bool | operator!= (Vector2 left, Vector2 right) |
Tests for inequality between two objects. More... | |
static implicit | operator Vector3 (Vector2 vector) |
Converts a Vector2 to a Vector3 implicitly. More... | |
Public Attributes | |
float | X |
Gets or sets the X component of the vector. More... | |
float | Y |
Gets or sets the Y component of the vector. More... | |
Vector2 | Normalized => Normalize(new Vector2(X, Y)) |
Returns this vector with a magnitude of 1. More... | |
Static Public Attributes | |
static Vector2 | Zero => new Vector2(0.0f, 0.0f) |
Returns a null vector. (0,0) More... | |
static Vector2 | UnitX => new Vector2(1.0f, 0.0f) |
The X unit Vector2 (1, 0). More... | |
static Vector2 | UnitY => new Vector2(0.0f, 1.0f) |
The Y unit Vector2 (0, 1). More... | |
static Vector2 | Up => new Vector2(0.0f, 1.0f) |
Returns the up vector. (0,1) More... | |
static Vector2 | Down => new Vector2(0.0f, -1.0f) |
Returns the down vector. (0,-1) More... | |
static Vector2 | Right => new Vector2(1.0f, 0.0f) |
Returns the right vector. (1,0) More... | |
static Vector2 | Left => new Vector2(-1.0f, 0.0f) |
Returns the left vector. (-1,0) More... | |
Properties | |
float | this[int index] [get, set] |
Gets or sets the component at the specified index. More... | |
GTA.Math.Vector2.Vector2 | ( | float | x, |
float | y | ||
) |
Initializes a new instance of the Vector2 class.
x | Initial value for the X component of the vector. |
y | Initial value for the Y component of the vector. |
Adds two vectors.
left | The first vector to add. |
right | The second vector to add. |
Returns the angle in degrees between from and to. The angle returned is always the acute angle between the two vectors.
Restricts a value to be within a specified range.
value | The value to clamp. |
min | The minimum value. |
max | The maximum value. |
Calculates the distance between two vectors.
position1 | The first vector to calculate the distance to the second vector. |
position2 | The second vector to calculate the distance to the first vector. |
Calculates the squared distance between two vectors.
position1 | The first vector to calculate the squared distance to the second vector. |
position2 | The second vector to calculate the squared distance to the first vector. |
float GTA.Math.Vector2.DistanceTo | ( | Vector2 | position | ) |
Calculates the distance between two vectors.
position | The second vector to calculate the distance to. |
float GTA.Math.Vector2.DistanceToSquared | ( | Vector2 | position | ) |
Calculates the squared distance between two vectors.
position | The second vector to calculate the squared distance to. |
Scales a vector by the given value.
value | The vector to scale. |
scale | The amount by which to scale the vector. |
Calculates the dot product of two vectors.
left | First source vector. |
right | Second source vector. |
override bool GTA.Math.Vector2.Equals | ( | object | obj | ) |
Returns a value that indicates whether the current instance is equal to a specified object.
obj | Object to make the comparison with. |
true
if the current instance is equal to the specified object; otherwise, false
.bool GTA.Math.Vector2.Equals | ( | Vector2 | other | ) |
Returns a value that indicates whether the current instance is equal to the specified object.
other | Object to make the comparison with. |
true
if the current instance is equal to the specified object; false
otherwise.override int GTA.Math.Vector2.GetHashCode | ( | ) |
Returns the hash code for this instance.
float GTA.Math.Vector2.Length | ( | ) |
Calculates the length of the vector.
float GTA.Math.Vector2.LengthSquared | ( | ) |
Calculates the squared length of the vector.
Performs a linear interpolation between two vectors.
start | Start vector. |
end | End vector. |
amount | Value between 0 and 1 indicating the weight of end . |
This method performs the linear interpolation based on the following formula.
Passing amount a value of 0 will cause start to be returned; a value of 1 will cause end to be returned.
Returns a vector containing the largest components of the specified vectors.
left | The first source vector. |
right | The second source vector. |
Returns a vector containing the smallest components of the specified vectors.
left | The first source vector. |
right | The second source vector. |
Multiplies a vector with another by performing component-wise multiplication.
left | The first vector to multiply. |
right | The second vector to multiply. |
Scales a vector by the given value.
value | The vector to scale. |
scale | The amount by which to scale the vector. |
Reverses the direction of a given vector.
value | The vector to negate. |
void GTA.Math.Vector2.Normalize | ( | ) |
Converts the vector into a unit vector.
Converts the vector into a unit vector.
vector | The vector to normalize. |
Tests for inequality between two objects.
left | The first value to compare. |
right | The second value to compare. |
true
if left has a different value than right ; otherwise, false
.Scales a vector by the given value.
vector | The vector to scale. |
scale | The amount by which to scale the vector. |
Scales a vector by the given value.
vector | The vector to scale. |
scale | The amount by which to scale the vector. |
Adds two vectors.
left | The first vector to add. |
right | The second vector to add. |
Subtracts two vectors.
left | The first vector to subtract. |
right | The second vector to subtract. |
Reverses the direction of a given vector.
value | The vector to negate. |
Scales a vector by the given value.
vector | The vector to scale. |
scale | The amount by which to scale the vector. |
Tests for equality between two objects.
left | The first value to compare. |
right | The second value to compare. |
true
if left has the same value as right ; otherwise, false
.
|
static |
Returns a new normalized vector with random X and Y components.
Returns the reflection of a vector off a surface that has the specified normal.
vector | The source vector. |
normal | Normal of the surface. |
Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was close enough to the surface to hit it.
Returns the signed angle in degrees between from and to.
Subtracts two vectors.
left | The first vector to subtract. |
right | The second vector to subtract. |
float GTA.Math.Vector2.ToHeading | ( | ) |
Converts a vector to a heading.
override string GTA.Math.Vector2.ToString | ( | ) |
Converts the value of the object to its equivalent string representation.
string GTA.Math.Vector2.ToString | ( | string | format | ) |
Converts the value of the object to its equivalent string representation.
format | The format. |
Returns this vector with a magnitude of 1.
float GTA.Math.Vector2.X |
Gets or sets the X component of the vector.
The X component of the vector.
float GTA.Math.Vector2.Y |
Gets or sets the Y component of the vector.
The Y component of the vector.
|
getset |
Gets or sets the component at the specified index.
The value of the X or Y component, depending on the index.
index | The index of the component to access. Use 0 for the X component and 1 for the Y component. |
System.ArgumentOutOfRangeException | Thrown when the index is out of the range [0, 1]. |