Class Matrix3
Definition
- Namespace:
- Tizen.NUI
- Assembly:
- Tizen.NUI.dll
A 3x3 matrix.
The matrix is stored as a flat array and is Column Major, i.e. the storage order is as follows (numbers represent indices of array):
Copy0 3 6 1 4 7 2 5 8
Each axis is contiguous in memory, so the x-axis corresponds to elements 0, 1, and 2, the y-axis corresponds to elements 3, 4, 5, the z-axis corresponds to elements 6, 7, and 8.
C#Copypublic class Matrix3 : Disposable
- Inheritance
Constructors
Declaration
C#Copypublic Matrix3()
Matrix3(Single, Single, Single, Single, Single, Single, Single, Single, Single)
The constructor with nine floats.
Declaration
C#Copypublic Matrix3(float s00, float s01, float s02, float s10, float s11, float s12, float s20, float s21, float s22)
Parameters
Type | Name | Description |
---|---|---|
Single | s00 | Value of 0 column, 0 row. |
Single | s01 | Value of 0 column, 1 row. |
Single | s02 | Value of 0 column, 2 row. |
Single | s10 | Value of 1 column, 0 row. |
Single | s11 | Value of 1 column, 1 row. |
Single | s12 | Value of 1 column, 2 row. |
Single | s20 | Value of 2 column, 0 row. |
Single | s21 | Value of 2 column, 1 row. |
Single | s22 | Value of 2 column, 2 row. |
Declaration
C#Copypublic Matrix3(Matrix matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | The matrix to copy value. The translation and shear components are ignored. |
Declaration
C#Copypublic Matrix3(Matrix3 matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix3 | matrix | The matrix to copy value. |
Properties
Declaration
C#Copypublic static Matrix3 Identity { get; }
Property Value
Type | Description |
---|---|
Matrix3 |
Declaration
C#Copypublic float this[uint index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
UInt32 | index | The index to get/set value. |
Property Value
Type | Description |
---|---|
Single |
Methods
Declaration
C#Copypublic bool EqualTo(Matrix3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Matrix3 | rhs | The matrix to compare. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the two matrixes are equal, otherwise false. |
Declaration
C#Copypublic override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The Hash Code. |
Declaration
C#Copypublic bool Invert()
Returns
Type | Description |
---|---|
Boolean | True if successful. |
Magnitude()
Magnitude returns the average of the absolute values of the elements * 3.0f. The Magnitude of the unit matrix is therefore 1.
Declaration
C#Copypublic float Magnitude()
Returns
Type | Description |
---|---|
Single | The magnitude - always positive. |
Declaration
C#Copypublic Matrix3 Multiply(Matrix3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Matrix3 | rhs | The right-hand-side Matrix3. |
Returns
Type | Description |
---|---|
Matrix3 | The matrix multiply as this * rhs. |
Multiply(Matrix3, Matrix3, Matrix3)
Function to multiply two matrices and store the result onto third.
Use this method in time critical path as it does not require temporaries.
Declaration
C#Copypublic static void Multiply(Matrix3 result, Matrix3 lhs, Matrix3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Matrix3 | result | Result of the multiplication. |
Matrix3 | lhs | The left-hand-side Matrix3. this can be same matrix as result. |
Matrix3 | rhs | The right-hand-side Matrix3. this cannot be same matrix as result. |
Declaration
C#Copypublic Vector3 Multiply(Vector3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | rhs | The right-hand-side Vector3. |
Returns
Type | Description |
---|---|
Vector3 | The vector multiply as this * rhs. |
MultiplyAssign(Matrix3)
Multiply the Matrix3 and Matrix3. Result will be stored into this Matrix3.
Declaration
C#Copypublic void MultiplyAssign(Matrix3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Matrix3 | rhs | The right-hand-side Matrix3. |
Declaration
C#Copypublic bool NotEqualTo(Matrix3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Matrix3 | rhs | The matrix to compare. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the two matrixes are not equal, otherwise false. |
Declaration
C#Copyprotected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type | Name | Description |
---|---|---|
Tizen.System.Runtime.InteropServices.HandleRef | swigCPtr |
Overrides
Declaration
C#Copypublic void Scale(float scale)
Parameters
Type | Name | Description |
---|---|---|
Single | scale | The value by which to scale the whole matrix. |
ScaledInverseTranspose()
If the matrix is invertible, then this method inverts, transposes
and scales the matrix such that the resultant element values
average 1.
If the matrix is not invertible, then the matrix is left unchanged.
Declaration
C#Copypublic bool ScaledInverseTranspose()
Returns
Type | Description |
---|---|
Boolean | True if the matrix is invertable. False otherwise |
Declaration
C#Copypublic void SetIdentity()
Declaration
C#Copypublic void SetValueAtIndex(uint index, float value)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | index | The index to set value. |
Single | value | The value to set. |
SetValueAtIndex(UInt32, UInt32, Single)
Set the value at matrix by it's row index and column index.
Declaration
C#Copypublic void SetValueAtIndex(uint indexRow, uint indexColumn, float value)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | indexRow | The row index to set value. |
UInt32 | indexColumn | The column index to set value. |
Single | value | The value to set. |
Declaration
C#Copypublic bool Transpose()
Returns
Type | Description |
---|---|
Boolean |
Declaration
C#Copypublic float ValueOfIndex(uint index)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | index | The index to get value. |
Returns
Type | Description |
---|---|
Single | A value of index |
ValueOfIndex(UInt32, UInt32)
Get the value of matrix by it's row index and column index.
Declaration
C#Copypublic float ValueOfIndex(uint indexRow, uint indexColumn)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | indexRow | The row index to get value. |
UInt32 | indexColumn | The column index to get value. |
Returns
Type | Description |
---|---|
Single | A value of index |
Operators
Declaration
C#Copypublic static Matrix3 operator *(Matrix3 lhs, Matrix3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Matrix3 | lhs | The left-hand-side Matrix3. |
Matrix3 | rhs | The right-hand-side Matrix3. |
Returns
Type | Description |
---|---|
Matrix3 | The Matrix3 multiply as lhs * rhs. |
Declaration
C#Copypublic static Vector3 operator *(Matrix3 lhs, Vector3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Matrix3 | lhs | The left-hand-side Matrix3. |
Vector3 | rhs | The right-hand-side Vector3. |
Returns
Type | Description |
---|---|
Vector3 | The vector multiply as lhs * rhs. |