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/
|
Defines a 4x4 matrix. More...
Public Member Functions | |
Matrix (float[] values) | |
Initializes a new instance of the Matrix structure. More... | |
float | Determinant () |
Calculates the determinant of the matrix. More... | |
float | Det3x3 (float M11, float M12, float M13, float M21, float M22, float M23, float M31, float M32, float M33) |
void | Invert () |
Inverts the matrix. More... | |
Vector3 | TransformPoint (Vector3 point) |
Apply the transformation matrix to a point in world space More... | |
Vector3 | InverseTransformPoint (Vector3 point) |
Calculates the position of a point before this transformation matrix gets applied More... | |
float[] | ToArray () |
Converts the matrix to an array of floats. 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 (Matrix other) |
Returns a value that indicates whether the current instance is equal to the specified object. More... | |
Static Public Member Functions | |
static Matrix | Add (Matrix left, Matrix right) |
Determines the sum of two matrices. More... | |
static Matrix | Subtract (Matrix left, Matrix right) |
Determines the difference between two matrices. More... | |
static Matrix | Multiply (Matrix left, Matrix right) |
Determines the product of two matrices. More... | |
static Matrix | Multiply (Matrix left, float right) |
Scales a matrix by the given value. More... | |
static Matrix | Divide (Matrix left, Matrix right) |
Determines the quotient of two matrices. More... | |
static Matrix | Divide (Matrix left, float right) |
Scales a matrix by the given value. More... | |
static Matrix | Negate (Matrix matrix) |
Negates a matrix. More... | |
static Matrix | Invert (Matrix matrix) |
Calculates the inverse of a matrix if it exists. More... | |
static Matrix | Lerp (Matrix start, Matrix end, float amount) |
Performs a linear interpolation between two matrices. More... | |
static Matrix | RotationX (float angle) |
Creates a matrix that rotates around the x-axis. More... | |
static Matrix | RotationY (float angle) |
Creates a matrix that rotates around the y-axis. More... | |
static Matrix | RotationZ (float angle) |
Creates a matrix that rotates around the z-axis. More... | |
static Matrix | RotationAxis (Vector3 axis, float angle) |
Creates a matrix that rotates around an arbitrary axis. More... | |
static Matrix | RotationQuaternion (Quaternion rotation) |
Creates a rotation matrix from a rotation. More... | |
static Matrix | RotationYawPitchRoll (float yaw, float pitch, float roll) |
Creates a rotation matrix with a specified yaw, pitch, and roll. More... | |
static Matrix | Scaling (float x, float y, float z) |
Creates a matrix that scales along the x-axis, y-axis, and y-axis. More... | |
static Matrix | Scaling (Vector3 scale) |
Creates a matrix that scales along the x-axis, y-axis, and y-axis. More... | |
static Matrix | Translation (float x, float y, float z) |
Creates a translation matrix using the specified offsets. More... | |
static Matrix | Translation (Vector3 amount) |
Creates a translation matrix using the specified offsets. More... | |
static Matrix | Transpose (Matrix matrix) |
Calculates the transpose of the specified matrix. More... | |
static Matrix | operator- (Matrix matrix) |
Negates a matrix. More... | |
static Matrix | operator+ (Matrix left, Matrix right) |
Adds two matrices. More... | |
static Matrix | operator- (Matrix left, Matrix right) |
Subtracts two matrices. More... | |
static Matrix | operator/ (Matrix left, Matrix right) |
Divides two matrices. More... | |
static Matrix | operator/ (Matrix left, float right) |
Scales a matrix by a given value. More... | |
static Matrix | operator* (Matrix left, Matrix right) |
Multiplies two matrices. More... | |
static Matrix | operator* (Matrix left, float right) |
Scales a matrix by a given value. More... | |
static Matrix | operator* (float left, Matrix right) |
Scales a matrix by a given value. More... | |
static bool | operator== (Matrix left, Matrix right) |
Tests for equality between two objects. More... | |
static bool | operator!= (Matrix left, Matrix right) |
Tests for inequality between two objects. More... | |
Public Attributes | |
float | M11 |
Gets or sets the element of the matrix that exists in the first row and first column. More... | |
float | M12 |
Gets or sets the element of the matrix that exists in the first row and second column. More... | |
float | M13 |
Gets or sets the element of the matrix that exists in the first row and third column. More... | |
float | M14 |
Gets or sets the element of the matrix that exists in the first row and fourth column. More... | |
float | M21 |
Gets or sets the element of the matrix that exists in the second row and first column. More... | |
float | M22 |
Gets or sets the element of the matrix that exists in the second row and second column. More... | |
float | M23 |
Gets or sets the element of the matrix that exists in the second row and third column. More... | |
float | M24 |
Gets or sets the element of the matrix that exists in the second row and fourth column. More... | |
float | M31 |
Gets or sets the element of the matrix that exists in the third row and first column. More... | |
float | M32 |
Gets or sets the element of the matrix that exists in the third row and second column. More... | |
float | M33 |
Gets or sets the element of the matrix that exists in the third row and third column. More... | |
float | M34 |
Gets or sets the element of the matrix that exists in the third row and fourth column. More... | |
float | M41 |
Gets or sets the element of the matrix that exists in the fourth row and first column. More... | |
float | M42 |
Gets or sets the element of the matrix that exists in the fourth row and second column. More... | |
float | M43 |
Gets or sets the element of the matrix that exists in the fourth row and third column. More... | |
float | M44 |
Gets or sets the element of the matrix that exists in the fourth row and fourth column. More... | |
bool | IsIdentity => Equals(Identity) |
Gets a value indicating whether this instance is an identity matrix. More... | |
bool | HasInverse => Determinant() != 0.0f |
Gets a value indicating whether this instance has an inverse matrix. More... | |
Static Public Attributes | |
static Matrix | Zero => new Matrix() |
A Matrix with all of its components set to zero. More... | |
static Matrix | Identity => new Matrix() { M11 = 1.0f, M22 = 1.0f, M33 = 1.0f, M44 = 1.0f } |
The identity Matrix. More... | |
Properties | |
float | this[int index] [get, set] |
Gets or sets the component at the specified index. More... | |
float | this[int row, int column] [get, set] |
Gets or sets the component at the specified index. More... | |
Defines a 4x4 matrix.
GTA.Math.Matrix.Matrix | ( | float[] | values | ) |
Initializes a new instance of the Matrix structure.
values | The values to assign to the components of the matrix. This must be an array with sixteen elements. |
ArgumentNullException | Thrown when values is null . |
ArgumentOutOfRangeException | Thrown when values contains more or less than sixteen elements. |
Determines the sum of two matrices.
left | The first matrix to add. |
right | The second matrix to add. |
float GTA.Math.Matrix.Det3x3 | ( | float | M11, |
float | M12, | ||
float | M13, | ||
float | M21, | ||
float | M22, | ||
float | M23, | ||
float | M31, | ||
float | M32, | ||
float | M33 | ||
) |
float GTA.Math.Matrix.Determinant | ( | ) |
Calculates the determinant of the matrix.
Scales a matrix by the given value.
left | The matrix to scale. |
right | The amount by which to scale. |
Determines the quotient of two matrices.
left | The first matrix to divide. |
right | The second matrix to divide. |
bool GTA.Math.Matrix.Equals | ( | Matrix | 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 bool GTA.Math.Matrix.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; false
otherwise.override int GTA.Math.Matrix.GetHashCode | ( | ) |
Returns the hash code for this instance.
Calculates the position of a point before this transformation matrix gets applied
point | The transformed vertex location |
void GTA.Math.Matrix.Invert | ( | ) |
Inverts the matrix.
Calculates the inverse of a matrix if it exists.
Performs a linear interpolation between two matrices.
start | Start matrix. |
end | End matrix. |
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.
Scales a matrix by the given value.
left | The matrix to scale. |
right | The amount by which to scale. |
Determines the product of two matrices.
left | The first matrix to multiply. |
right | The second matrix to multiply. |
Negates a matrix.
matrix | The matrix to be negated. |
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 matrix by a given value.
right | The matrix to scale. |
left | The amount by which to scale. |
Scales a matrix by a given value.
left | The matrix to scale. |
right | The amount by which to scale. |
Multiplies two matrices.
left | The first matrix to multiply. |
right | The second matrix to multiply. |
Adds two matrices.
left | The first matrix to add. |
right | The second matrix to add. |
Subtracts two matrices.
left | The first matrix to subtract. |
right | The second matrix to subtract. |
Negates a matrix.
matrix | The matrix to negate. |
Scales a matrix by a given value.
left | The matrix to scale. |
right | The amount by which to scale. |
Divides two matrices.
left | The first matrix to divide. |
right | The second matrix to divide. |
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
.Creates a matrix that rotates around an arbitrary axis.
axis | The axis around which to rotate. |
angle | Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
|
static |
Creates a rotation matrix from a rotation.
rotation | The quaternion to use to build the matrix. |
|
static |
Creates a matrix that rotates around the x-axis.
angle | Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
|
static |
Creates a matrix that rotates around the y-axis.
angle | Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
|
static |
Creates a rotation matrix with a specified yaw, pitch, and roll.
yaw | Yaw around the y-axis, in radians. |
pitch | Pitch around the x-axis, in radians. |
roll | Roll around the z-axis, in radians. |
|
static |
Creates a matrix that rotates around the z-axis.
angle | Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
|
static |
Creates a matrix that scales along the x-axis, y-axis, and y-axis.
x | Scaling factor that is applied along the x-axis. |
y | Scaling factor that is applied along the y-axis. |
z | Scaling factor that is applied along the z-axis. |
Creates a matrix that scales along the x-axis, y-axis, and y-axis.
scale | Scaling factor for all three axes. |
Determines the difference between two matrices.
left | The first matrix to subtract. |
right | The second matrix to subtract. |
float [] GTA.Math.Matrix.ToArray | ( | ) |
Converts the matrix to an array of floats.
override string GTA.Math.Matrix.ToString | ( | ) |
Converts the value of the object to its equivalent string representation.
string GTA.Math.Matrix.ToString | ( | string | format | ) |
Converts the value of the object to its equivalent string representation.
format | The format. |
Apply the transformation matrix to a point in world space
point | The original vertex location |
|
static |
Creates a translation matrix using the specified offsets.
x | X-coordinate offset. |
y | Y-coordinate offset. |
z | Z-coordinate offset. |
Creates a translation matrix using the specified offsets.
amount | The offset for all three coordinate planes. |
Calculates the transpose of the specified matrix.
matrix | The matrix whose transpose is to be calculated. |
bool GTA.Math.Matrix.HasInverse => Determinant() != 0.0f |
Gets a value indicating whether this instance has an inverse matrix.
|
static |
The identity Matrix.
Gets a value indicating whether this instance is an identity matrix.
true
if this instance is an identity matrix; otherwise, false
.
float GTA.Math.Matrix.M11 |
Gets or sets the element of the matrix that exists in the first row and first column.
float GTA.Math.Matrix.M12 |
Gets or sets the element of the matrix that exists in the first row and second column.
float GTA.Math.Matrix.M13 |
Gets or sets the element of the matrix that exists in the first row and third column.
float GTA.Math.Matrix.M14 |
Gets or sets the element of the matrix that exists in the first row and fourth column.
float GTA.Math.Matrix.M21 |
Gets or sets the element of the matrix that exists in the second row and first column.
float GTA.Math.Matrix.M22 |
Gets or sets the element of the matrix that exists in the second row and second column.
float GTA.Math.Matrix.M23 |
Gets or sets the element of the matrix that exists in the second row and third column.
float GTA.Math.Matrix.M24 |
Gets or sets the element of the matrix that exists in the second row and fourth column.
float GTA.Math.Matrix.M31 |
Gets or sets the element of the matrix that exists in the third row and first column.
float GTA.Math.Matrix.M32 |
Gets or sets the element of the matrix that exists in the third row and second column.
float GTA.Math.Matrix.M33 |
Gets or sets the element of the matrix that exists in the third row and third column.
float GTA.Math.Matrix.M34 |
Gets or sets the element of the matrix that exists in the third row and fourth column.
float GTA.Math.Matrix.M41 |
Gets or sets the element of the matrix that exists in the fourth row and first column.
float GTA.Math.Matrix.M42 |
Gets or sets the element of the matrix that exists in the fourth row and second column.
float GTA.Math.Matrix.M43 |
Gets or sets the element of the matrix that exists in the fourth row and third column.
float GTA.Math.Matrix.M44 |
Gets or sets the element of the matrix that exists in the fourth row and fourth column.
|
getset |
Gets or sets the component at the specified index.
The value of the matrix component, depending on the index.
index | The zero-based index of the component to access. |
System.ArgumentOutOfRangeException | Thrown when the index is out of the range [0, 15]. |
|
getset |
Gets or sets the component at the specified index.
The value of the matrix component, depending on the index.
row | The row of the matrix to access. |
column | The column of the matrix to access. |
System.ArgumentOutOfRangeException | Thrown when the row or column is out of the range [0, 3]. |