C# Класс GarrysModLuaShared.Classes.VMatrix

Representation of a mathematical construct that allows Vectors to be transformed. This object can be created with Global.Matrix function.
Наследование: LuaObject
Показать файл Открыть проект

Открытые методы

Метод Описание
GetAngles ( ) : Angle

Returns the absolute rotation of the matrix.

GetField ( byte row, byte column ) : double

Returns a specific field in the matrix.

GetForward ( ) : Vector

Gets the forward direction of the matrix. ie. The first column of the matrix, excluding the w coordinate.

GetInverse ( ) : VMatrix

Returns an inverted matrix without modifying the original matrix. Inverting the matrix will fail if its determinant is 0 or close to 0. (ie.its "scale" in any direction is 0.) See also GetInverseTR.

GetInverseTR ( ) : VMatrix

Returns an inverted matrix without modifying the original matrix. This function will not fail, but only works correctly on matrices that contain only translation and/or rotation. Using this function on a matrix with modified scale may return an incorrect inverted matrix. To get the inverse of a matrix that contains other modifications, see GetInverse.

GetRight ( ) : Vector

Gets the right direction of the matrix. ie. The second column of the matrix, negated, excluding the w coordinate.

GetScale ( ) : Vector

Returns the absolute scale of the matrix.

GetTranslation ( ) : Vector

Returns the absolute translation of the matrix.

GetUp ( ) : Vector

Gets the up direction of the matrix. ie. The third column of the matrix, excluding the w coordinate.

Identity ( ) : void

Initializes the matrix as Identity matrix.

Invert ( ) : bool

Inverts the matrix. Inverting the matrix will fail if its determinant is 0 or close to 0. (ie.its "scale" in any direction is 0.) If the matrix cannot be inverted, it does not get modified. See also InvertTR.

InvertTR ( ) : void

Inverts the matrix. This function will not fail, but only works correctly on matrices that contain only translation and/or rotation. Using this function on a matrix with modified scale may return an incorrect inverted matrix. To invert a matrix that contains other modifications, see Invert.

IsIdentity ( ) : bool

Returns whether the matrix is equal to Identity matrix or not.

IsRotationMatrix ( ) : bool

Returns whether the matrix is a rotation matrix or not. Technically it checks if the forward, right and up vectors are orthogonal and normalized.

Rotate ( Angle rotation ) : void

Rotates the matrix by the given angle. Postmultiplies the matrix by a rotation matrix(A = AR).

Scale ( Vector scale ) : void

Scales the matrix by the given vector. Postmultiplies the matrix by a scaling matrix(A = AS).

ScaleTranslation ( double scale ) : void

Scales the absolute translation with the given value.

Set ( VMatrix sourceMatrix ) : void

Copies values from the given matrix object.

SetAngles ( Angle angle ) : void

Sets the absolute rotation of the matrix.

SetField ( byte row, byte column, double value ) : void

Sets a specific field in the matrix.

SetForward ( Vector forward ) : void

Sets the forward direction of the matrix. ie. The first column of the matrix, excluding the w coordinate.

SetRight ( Vector forward ) : void

Sets the right direction of the matrix. ie. The second column of the matrix, negated, excluding the w coordinate.

SetScale ( Vector scale ) : void

Modifies the scale of the matrix while preserving the rotation and translation.

SetTranslation ( Vector translation ) : void

Sets the absolute translation of the matrix.

SetUp ( Vector forward ) : void

Sets the up direction of the matrix. ie. The third column of the matrix, excluding the w coordinate.

ToTable ( ) : LuaTable

Converts the matrix to a 4x4 table. See Global.Matrix function.

Translate ( Vector translation ) : void

Translates the matrix by the given vector aka. adds the vector to the translation. Postmultiplies the matrix by a translation matrix(A = AT).

VMatrix ( LuaTable data )
VMatrix ( int index )

Описание методов

GetAngles() публичный Метод

Returns the absolute rotation of the matrix.
public GetAngles ( ) : Angle
Результат Angle

GetField() публичный Метод

Returns a specific field in the matrix.
public GetField ( byte row, byte column ) : double
row byte Row of the field whose value is to be retrieved, from 1 to 4.
column byte Column of the field whose value is to be retrieved, from 1 to 4.
Результат double

GetForward() публичный Метод

Gets the forward direction of the matrix. ie. The first column of the matrix, excluding the w coordinate.
public GetForward ( ) : Vector
Результат Vector

GetInverse() публичный Метод

Returns an inverted matrix without modifying the original matrix. Inverting the matrix will fail if its determinant is 0 or close to 0. (ie.its "scale" in any direction is 0.) See also GetInverseTR.
public GetInverse ( ) : VMatrix
Результат VMatrix

GetInverseTR() публичный Метод

Returns an inverted matrix without modifying the original matrix. This function will not fail, but only works correctly on matrices that contain only translation and/or rotation. Using this function on a matrix with modified scale may return an incorrect inverted matrix. To get the inverse of a matrix that contains other modifications, see GetInverse.
public GetInverseTR ( ) : VMatrix
Результат VMatrix

GetRight() публичный Метод

Gets the right direction of the matrix. ie. The second column of the matrix, negated, excluding the w coordinate.
public GetRight ( ) : Vector
Результат Vector

GetScale() публичный Метод

Returns the absolute scale of the matrix.
public GetScale ( ) : Vector
Результат Vector

GetTranslation() публичный Метод

Returns the absolute translation of the matrix.
public GetTranslation ( ) : Vector
Результат Vector

GetUp() публичный Метод

Gets the up direction of the matrix. ie. The third column of the matrix, excluding the w coordinate.
public GetUp ( ) : Vector
Результат Vector

Identity() публичный Метод

Initializes the matrix as Identity matrix.
public Identity ( ) : void
Результат void

Invert() публичный Метод

Inverts the matrix. Inverting the matrix will fail if its determinant is 0 or close to 0. (ie.its "scale" in any direction is 0.) If the matrix cannot be inverted, it does not get modified. See also InvertTR.
public Invert ( ) : bool
Результат bool

InvertTR() публичный Метод

Inverts the matrix. This function will not fail, but only works correctly on matrices that contain only translation and/or rotation. Using this function on a matrix with modified scale may return an incorrect inverted matrix. To invert a matrix that contains other modifications, see Invert.
public InvertTR ( ) : void
Результат void

IsIdentity() публичный Метод

Returns whether the matrix is equal to Identity matrix or not.
public IsIdentity ( ) : bool
Результат bool

IsRotationMatrix() публичный Метод

Returns whether the matrix is a rotation matrix or not. Technically it checks if the forward, right and up vectors are orthogonal and normalized.
public IsRotationMatrix ( ) : bool
Результат bool

Rotate() публичный Метод

Rotates the matrix by the given angle. Postmultiplies the matrix by a rotation matrix(A = AR).
public Rotate ( Angle rotation ) : void
rotation Angle Rotation angle.
Результат void

Scale() публичный Метод

Scales the matrix by the given vector. Postmultiplies the matrix by a scaling matrix(A = AS).
public Scale ( Vector scale ) : void
scale Vector Vector to scale with matrix with.
Результат void

ScaleTranslation() публичный Метод

Scales the absolute translation with the given value.
public ScaleTranslation ( double scale ) : void
scale double Value to scale the translation with.
Результат void

Set() публичный Метод

Copies values from the given matrix object.
public Set ( VMatrix sourceMatrix ) : void
sourceMatrix VMatrix The matrix to copy values from.
Результат void

SetAngles() публичный Метод

Sets the absolute rotation of the matrix.
public SetAngles ( Angle angle ) : void
angle Angle New angles.
Результат void

SetField() публичный Метод

Sets a specific field in the matrix.
public SetField ( byte row, byte column, double value ) : void
row byte Row of the field to be set, from 1 to 4.
column byte Column of the field to be set, from 1 to 4.
value double The value to set in that field.
Результат void

SetForward() публичный Метод

Sets the forward direction of the matrix. ie. The first column of the matrix, excluding the w coordinate.
public SetForward ( Vector forward ) : void
forward Vector The forward direction of the matrix.
Результат void

SetRight() публичный Метод

Sets the right direction of the matrix. ie. The second column of the matrix, negated, excluding the w coordinate.
public SetRight ( Vector forward ) : void
forward Vector The right direction of the matrix.
Результат void

SetScale() публичный Метод

Modifies the scale of the matrix while preserving the rotation and translation.
public SetScale ( Vector scale ) : void
scale Vector The scale to set.
Результат void

SetTranslation() публичный Метод

Sets the absolute translation of the matrix.
public SetTranslation ( Vector translation ) : void
translation Vector New translation.
Результат void

SetUp() публичный Метод

Sets the up direction of the matrix. ie. The third column of the matrix, excluding the w coordinate.
public SetUp ( Vector forward ) : void
forward Vector The up direction of the matrix.
Результат void

ToTable() публичный Метод

Converts the matrix to a 4x4 table. See Global.Matrix function.
public ToTable ( ) : LuaTable
Результат LuaTable

Translate() публичный Метод

Translates the matrix by the given vector aka. adds the vector to the translation. Postmultiplies the matrix by a translation matrix(A = AT).
public Translate ( Vector translation ) : void
translation Vector Vector to translate the matrix by.
Результат void

VMatrix() публичный Метод

public VMatrix ( LuaTable data )
data LuaTable

VMatrix() публичный Метод

public VMatrix ( int index )
index int