Struct Matrix3x3
Represents a 3x3 mathematical matrix.
Assembly: FlaxEngine.dll
File: Engine/Core/Math/Matrix3x3.h
Syntax
public struct Matrix3x3
Constructors
Matrix3x3()
Empty constructor.
Declaration
public Matrix3x3() = default
Matrix3x3(const Matrix& matrix)
Initializes a new instance of the Matrix3x3 struct.
Declaration
public Matrix3x3(const Matrix& matrix)
Parameters
Matrix
matrix
The 4 by 4 matrix to initialize from with rotation and scale (translation is skipped). |
Matrix3x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33)
Initializes a new instance of the Matrix3x3 struct.
Declaration
public Matrix3x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33)
Parameters
float
m11
The value to assign at row 1 column 1 of the matrix. |
float
m12
The value to assign at row 1 column 2 of the matrix. |
float
m13
The value to assign at row 1 column 3 of the matrix. |
float
m21
The value to assign at row 2 column 1 of the matrix. |
float
m22
The value to assign at row 2 column 2 of the matrix. |
float
m23
The value to assign at row 2 column 3 of the matrix. |
float
m31
The value to assign at row 3 column 1 of the matrix. |
float
m32
The value to assign at row 3 column 2 of the matrix. |
float
m33
The value to assign at row 3 column 3 of the matrix. |
Matrix3x3(float values[9])
Initializes a new instance of the Matrix3x3 struct.
Declaration
public Matrix3x3(float values[9])
Parameters
float
values
The values to assign to the components of the matrix. This must be an array with nine elements. |
Fields
Identity
M11
Value at row 1 column 1 of the matrix.
Declaration
public float M11
Field Value
float
|
M12
Value at row 1 column 2 of the matrix.
Declaration
public float M12
Field Value
float
|
M13
Value at row 1 column 3 of the matrix.
Declaration
public float M13
Field Value
float
|
M21
Value at row 2 column 1 of the matrix.
Declaration
public float M21
Field Value
float
|
M22
Value at row 2 column 2 of the matrix.
Declaration
public float M22
Field Value
float
|
M23
Value at row 2 column 3 of the matrix.
Declaration
public float M23
Field Value
float
|
M31
Value at row 3 column 1 of the matrix.
Declaration
public float M31
Field Value
float
|
M32
Value at row 3 column 2 of the matrix.
Declaration
public float M32
Field Value
float
|
M33
Value at row 3 column 3 of the matrix.
Declaration
public float M33
Field Value
float
|
Raw
Declaration
public float Raw[9]
Field Value
float
|
Values
Declaration
public float Values[3][3]
Field Value
float
|
Zero
A matrix with all of its components set to zero.
Declaration
public static Matrix3x3 Zero
Field Value
Matrix3x3
|
Methods
Add(const Matrix3x3& left, const Matrix3x3& right)
Determines the sum of two matrices.
Declaration
public static Matrix3x3 Add(const Matrix3x3& left, const Matrix3x3& right)
Parameters
Matrix3x3
left
The first Matrix3x3 to add. |
Matrix3x3
right
The second Matrix3x3 to add. |
Returns
Matrix3x3
The sum of the two matrices. |
Add(const Matrix3x3& left, const Matrix3x3& right, Matrix3x3& result)
Determines the sum of two matrices.
Declaration
public static void Add(const Matrix3x3& left, const Matrix3x3& right, Matrix3x3& result)
Parameters
Matrix3x3
left
The first Matrix3x3 to add. |
Matrix3x3
right
The second Matrix3x3 to add. |
Matrix3x3
result
When the method completes, contains the sum of the two matrices. |
Decompose(Float3& scale, Matrix3x3& rotation)
Decomposes a matrix into a scale and rotation.
This method is designed to decompose an scale-rotation transformation matrix only.
Declaration
public void Decompose(Float3& scale, Matrix3x3& rotation) const
Parameters
Float3
scale
When the method completes, contains the scaling component of the decomposed matrix. |
Matrix3x3
rotation
When the method completes, contains the rotation component of the decomposed matrix. |
Decompose(Float3& scale, Quaternion& rotation)
Decomposes a matrix into a scale and rotation.
This method is designed to decompose an scale-rotation transformation matrix only.
Declaration
public void Decompose(Float3& scale, Quaternion& rotation) const
Parameters
Float3
scale
When the method completes, contains the scaling component of the decomposed matrix. |
Quaternion
rotation
When the method completes, contains the rotation component of the decomposed matrix. |
Divide(const Matrix3x3& left, const Matrix3x3& right)
Determines the quotient of two matrices.
Declaration
public static Matrix3x3 Divide(const Matrix3x3& left, const Matrix3x3& right)
Parameters
Matrix3x3
left
The first Matrix3x3 to divide. |
Matrix3x3
right
The second Matrix3x3 to divide. |
Returns
Matrix3x3
The quotient of the two matrices. |
Divide(const Matrix3x3& left, const Matrix3x3& right, Matrix3x3& result)
Determines the quotient of two matrices.
Declaration
public static void Divide(const Matrix3x3& left, const Matrix3x3& right, Matrix3x3& result)
Parameters
Matrix3x3
left
The first Matrix3x3 to divide. |
Matrix3x3
right
The second Matrix3x3 to divide. |
Matrix3x3
result
When the method completes, contains the quotient of the two matrices. |
Divide(const Matrix3x3& left, float right)
Scales a Matrix3x3 by the given value.
Declaration
public static Matrix3x3 Divide(const Matrix3x3& left, float right)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
float
right
The amount by which to scale. |
Returns
Matrix3x3
The scaled Matrix3x3. |
Divide(const Matrix3x3& left, float right, Matrix3x3& result)
Scales a Matrix3x3 by the given value.
Declaration
public static void Divide(const Matrix3x3& left, float right, Matrix3x3& result)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
float
right
The amount by which to scale. |
Matrix3x3
result
When the method completes, contains the scaled Matrix3x3. |
GetBackward()
Declaration
public Float3 GetBackward() const
Returns
Float3
|
GetColumn1()
Declaration
public Float3 GetColumn1() const
Returns
Float3
|
GetColumn2()
Declaration
public Float3 GetColumn2() const
Returns
Float3
|
GetColumn3()
Declaration
public Float3 GetColumn3() const
Returns
Float3
|
GetDeterminant()
Calculates the determinant of the Matrix3x3.
Declaration
public float GetDeterminant() const
Returns
float
|
GetDown()
Declaration
public Float3 GetDown() const
Returns
Float3
|
GetForward()
Declaration
public Float3 GetForward() const
Returns
Float3
|
GetLeft()
Declaration
public Float3 GetLeft() const
Returns
Float3
|
GetRight()
Declaration
public Float3 GetRight() const
Returns
Float3
|
GetRow1()
Declaration
public Float3 GetRow1() const
Returns
Float3
|
GetRow2()
Declaration
public Float3 GetRow2() const
Returns
Float3
|
GetRow3()
Declaration
public Float3 GetRow3() const
Returns
Float3
|
GetScaleVector()
Declaration
public Float3 GetScaleVector() const
Returns
Float3
|
GetUp()
Declaration
public Float3 GetUp() const
Returns
Float3
|
Invert()
Inverts the Matrix3x3.
Declaration
public void Invert()
Invert(const Matrix3x3& value)
Calculates the inverse of the specified Matrix3x3.
Declaration
public static Matrix3x3 Invert(const Matrix3x3& value)
Parameters
Matrix3x3
value
The Matrix3x3 whose inverse is to be calculated. |
Returns
Matrix3x3
The inverse of the specified Matrix3x3. |
Invert(const Matrix3x3& value, Matrix3x3& result)
Calculates the inverse of the specified Matrix3x3.
Declaration
public static void Invert(const Matrix3x3& value, Matrix3x3& result)
Parameters
Matrix3x3
value
The Matrix3x3 whose inverse is to be calculated. |
Matrix3x3
result
When the method completes, contains the inverse of the specified Matrix3x3. |
IsIdentity()
Gets a value indicating whether this instance is an identity Matrix3x3.
Declaration
public bool IsIdentity() const
Returns
bool
|
Multiply(const Matrix3x3& left, const Matrix3x3& right)
Determines the product of two matrices.
Declaration
public static Matrix3x3 Multiply(const Matrix3x3& left, const Matrix3x3& right)
Parameters
Matrix3x3
left
The first Matrix3x3 to multiply. |
Matrix3x3
right
The second Matrix3x3 to multiply. |
Returns
Matrix3x3
The product of the two matrices. |
Multiply(const Matrix3x3& left, const Matrix3x3& right, Matrix3x3& result)
Determines the product of two matrices.
Declaration
public static void Multiply(const Matrix3x3& left, const Matrix3x3& right, Matrix3x3& result)
Parameters
Matrix3x3
left
The first Matrix3x3 to multiply. |
Matrix3x3
right
The second Matrix3x3 to multiply. |
Matrix3x3
result
The product of the two matrices. |
Multiply(const Matrix3x3& left, float right)
Scales a Matrix3x3 by the given value.
Declaration
public static Matrix3x3 Multiply(const Matrix3x3& left, float right)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
float
right
The amount by which to scale. |
Returns
Matrix3x3
The scaled Matrix3x3. |
Multiply(const Matrix3x3& left, float right, Matrix3x3& result)
Scales a Matrix3x3 by the given value.
Declaration
public static void Multiply(const Matrix3x3& left, float right, Matrix3x3& result)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
float
right
The amount by which to scale. |
Matrix3x3
result
When the method completes, contains the scaled Matrix3x3. |
NormalizeScale()
Removes any scaling from the matrix by performing the normalization (each row magnitude is 1).
Declaration
public void NormalizeScale()
operator!=(const Matrix3x3& other)
Tests for equality between two objects.
Declaration
public bool operator!=(const Matrix3x3& other) const
Parameters
Matrix3x3
other
The other value to compare. |
Returns
bool
|
operator==(const Matrix3x3& other)
Tests for equality between two objects.
Declaration
public bool operator==(const Matrix3x3& other) const
Parameters
Matrix3x3
other
The other value to compare. |
Returns
bool
|
RotationQuaternion(const Quaternion& rotation)
Creates a rotation matrix from a quaternion
Declaration
public static Matrix3x3 RotationQuaternion(const Quaternion& rotation)
Parameters
Quaternion
rotation
The quaternion to use to build the matrix. |
Returns
Matrix3x3
The created rotation matrix |
RotationQuaternion(const Quaternion& rotation, Matrix3x3& result)
Creates a rotation matrix from a quaternion
Declaration
public static void RotationQuaternion(const Quaternion& rotation, Matrix3x3& result)
Parameters
Quaternion
rotation
The quaternion to use to build the matrix. |
Matrix3x3
result
The created rotation matrix. |
SetBackward(const Float3& value)
Declaration
public void SetBackward(const Float3& value)
Parameters
Float3
value
|
SetColumn1(const Float3& value)
Declaration
public void SetColumn1(const Float3& value)
Parameters
Float3
value
|
SetColumn2(const Float3& value)
Declaration
public void SetColumn2(const Float3& value)
Parameters
Float3
value
|
SetColumn3(const Float3& value)
Declaration
public void SetColumn3(const Float3& value)
Parameters
Float3
value
|
SetDown(const Float3& value)
Declaration
public void SetDown(const Float3& value)
Parameters
Float3
value
|
SetForward(const Float3& value)
Declaration
public void SetForward(const Float3& value)
Parameters
Float3
value
|
SetLeft(const Float3& value)
Declaration
public void SetLeft(const Float3& value)
Parameters
Float3
value
|
SetRight(const Float3& value)
Declaration
public void SetRight(const Float3& value)
Parameters
Float3
value
|
SetRow1(const Float3& value)
Declaration
public void SetRow1(const Float3& value)
Parameters
Float3
value
|
SetRow2(const Float3& value)
Declaration
public void SetRow2(const Float3& value)
Parameters
Float3
value
|
SetRow3(const Float3& value)
Declaration
public void SetRow3(const Float3& value)
Parameters
Float3
value
|
SetScaleVector(const Float3& value)
Declaration
public void SetScaleVector(const Float3& value)
Parameters
Float3
value
|
SetUp(const Float3& value)
Declaration
public void SetUp(const Float3& value)
Parameters
Float3
value
|
Subtract(const Matrix3x3& left, const Matrix3x3& right)
Determines the difference between two matrices.
Declaration
public static Matrix3x3 Subtract(const Matrix3x3& left, const Matrix3x3& right)
Parameters
Matrix3x3
left
The first Matrix3x3 to subtract. |
Matrix3x3
right
The second Matrix3x3 to subtract. |
Returns
Matrix3x3
The difference between the two matrices. |
Subtract(const Matrix3x3& left, const Matrix3x3& right, Matrix3x3& result)
Determines the difference between two matrices.
Declaration
public static void Subtract(const Matrix3x3& left, const Matrix3x3& right, Matrix3x3& result)
Parameters
Matrix3x3
left
The first Matrix3x3 to subtract. |
Matrix3x3
right
The second Matrix3x3 to subtract. |
Matrix3x3
result
When the method completes, contains the difference between the two matrices. |
ToString()
Transform2DPoint(const Float2& point, const Matrix3x3& transform, Float2& result)
Transforms given point by the matrix (in 2D). Useful to transform location of point.
Declaration
public static void Transform2DPoint(const Float2& point, const Matrix3x3& transform, Float2& result)
Parameters
Float2
point
The point. |
Matrix3x3
transform
The transform. |
Float2
result
The result. |
Transform2DVector(const Float2& vector, const Matrix3x3& transform, Float2& result)
Transforms given vector by the matrix (in 2D). Useful to transform size or distance.
Declaration
public static void Transform2DVector(const Float2& vector, const Matrix3x3& transform, Float2& result)
Parameters
Float2
vector
The vector. |
Matrix3x3
transform
The transform. |
Float2
result
The result. |
Translation2D(const Float2& translation)
Creates 2D translation matrix.
Declaration
public static Matrix3x3 Translation2D(const Float2& translation)
Parameters
Float2
translation
The translation vector. |
Returns
Matrix3x3
The result. |
Translation2D(const Float2& translation, Matrix3x3& result)
Creates 2D translation matrix.
Declaration
public static void Translation2D(const Float2& translation, Matrix3x3& result)
Parameters
Float2
translation
The translation vector. |
Matrix3x3
result
The result. |
Transpose()
Transposes the Matrix3x3.
Declaration
public void Transpose()
Transpose(const Matrix3x3& value)
Calculates the transpose of the specified Matrix3x3.
Declaration
public static Matrix3x3 Transpose(const Matrix3x3& value)
Parameters
Matrix3x3
value
The Matrix3x3 whose transpose is to be calculated. |
Returns
Matrix3x3
The transpose of the specified Matrix3x3. |
Transpose(const Matrix3x3& value, Matrix3x3& result)
Calculates the transpose of the specified Matrix3x3.
Declaration
public static void Transpose(const Matrix3x3& value, Matrix3x3& result)
Parameters
Matrix3x3
value
The Matrix3x3 whose transpose is to be calculated. |
Matrix3x3
result
When the method completes, contains the transpose of the specified Matrix3x3. |