C# Class GarrysModLuaShared.Classes.VMatrix

Representation of a mathematical construct that allows Vectors to be transformed. This object can be created with Global.Matrix function.
Inheritance: LuaObject
Afficher le fichier Open project: OmegaExtern/gmod-csharp-binary-module

Méthodes publiques

Méthode Description
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 )

Method Details

GetAngles() public méthode

Returns the absolute rotation of the matrix.
public GetAngles ( ) : Angle
Résultat Angle

GetField() public méthode

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.
Résultat double

GetForward() public méthode

Gets the forward direction of the matrix. ie. The first column of the matrix, excluding the w coordinate.
public GetForward ( ) : Vector
Résultat Vector

GetInverse() public méthode

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
Résultat VMatrix

GetInverseTR() public méthode

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
Résultat VMatrix

GetRight() public méthode

Gets the right direction of the matrix. ie. The second column of the matrix, negated, excluding the w coordinate.
public GetRight ( ) : Vector
Résultat Vector

GetScale() public méthode

Returns the absolute scale of the matrix.
public GetScale ( ) : Vector
Résultat Vector

GetTranslation() public méthode

Returns the absolute translation of the matrix.
public GetTranslation ( ) : Vector
Résultat Vector

GetUp() public méthode

Gets the up direction of the matrix. ie. The third column of the matrix, excluding the w coordinate.
public GetUp ( ) : Vector
Résultat Vector

Identity() public méthode

Initializes the matrix as Identity matrix.
public Identity ( ) : void
Résultat void

Invert() public méthode

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
Résultat bool

InvertTR() public méthode

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
Résultat void

IsIdentity() public méthode

Returns whether the matrix is equal to Identity matrix or not.
public IsIdentity ( ) : bool
Résultat bool

IsRotationMatrix() public méthode

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
Résultat bool

Rotate() public méthode

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.
Résultat void

Scale() public méthode

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.
Résultat void

ScaleTranslation() public méthode

Scales the absolute translation with the given value.
public ScaleTranslation ( double scale ) : void
scale double Value to scale the translation with.
Résultat void

Set() public méthode

Copies values from the given matrix object.
public Set ( VMatrix sourceMatrix ) : void
sourceMatrix VMatrix The matrix to copy values from.
Résultat void

SetAngles() public méthode

Sets the absolute rotation of the matrix.
public SetAngles ( Angle angle ) : void
angle Angle New angles.
Résultat void

SetField() public méthode

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.
Résultat void

SetForward() public méthode

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.
Résultat void

SetRight() public méthode

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.
Résultat void

SetScale() public méthode

Modifies the scale of the matrix while preserving the rotation and translation.
public SetScale ( Vector scale ) : void
scale Vector The scale to set.
Résultat void

SetTranslation() public méthode

Sets the absolute translation of the matrix.
public SetTranslation ( Vector translation ) : void
translation Vector New translation.
Résultat void

SetUp() public méthode

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.
Résultat void

ToTable() public méthode

Converts the matrix to a 4x4 table. See Global.Matrix function.
public ToTable ( ) : LuaTable
Résultat LuaTable

Translate() public méthode

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.
Résultat void

VMatrix() public méthode

public VMatrix ( LuaTable data )
data LuaTable

VMatrix() public méthode

public VMatrix ( int index )
index int