Class Matrix

    Definition

    Namespace:
    Tizen.NUI
    Assembly:
    Tizen.NUI.dll

    The Matrix class represents transformations and projections.
    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):

    0   4   8   12
    1   5   9   13
    2   6   10  14
    3   7   11  15

    Each axis is contiguous in memory, so the x-axis corresponds to elements 0, 1, 2 and 3, the y-axis corresponds to elements 4, 5, 6, 7, the z-axis corresponds to elements 12, 13, 14 and 15, and the translation vector corresponds to elements 12, 13 and 14.

    public class Matrix : Disposable
    Inheritance
    object
    Disposable
    Matrix

    Constructors

    View Source

    Matrix()

    The constructor initialized as zero.

    Declaration
    public Matrix()
    View Source

    Matrix(bool)

    The constructor whether initialize matrix or not.

    Declaration
    public Matrix(bool initialize)
    Parameters
    Type Name Description
    bool initialize

    True if we want to initialize values as zero. False if we just allocate and do not initalize value.

    View Source

    Matrix(float[])

    The constructor with continuous float array.

    Declaration
    public Matrix(float[] array)
    Parameters
    Type Name Description
    float[] array

    Array of float value.

    View Source

    Matrix(Matrix)

    The constructor.

    Declaration
    public Matrix(Matrix matrix)
    Parameters
    Type Name Description
    Matrix matrix

    Matrix to create this matrix from

    View Source

    Matrix(Rotation)

    The constructor with Rotation to be rotation transform matrix.

    Declaration
    public Matrix(Rotation rotation)
    Parameters
    Type Name Description
    Rotation rotation

    Rotation information.

    Properties

    View Source

    Identity

    The matrix as identity

    Declaration
    public static Matrix Identity { get; }
    Property Value
    Type Description
    Matrix
    View Source

    this[uint]

    Get/set the value of matrix by it's index.

    Declaration
    public float this[uint index] { get; set; }
    Parameters
    Type Name Description
    uint index

    The index to get/set value.

    Property Value
    Type Description
    float

    Methods

    View Source

    EqualTo(Matrix)

    Compares if rhs is equal to.

    Declaration
    public bool EqualTo(Matrix rhs)
    Parameters
    Type Name Description
    Matrix rhs

    The matrix to compare.

    Returns
    Type Description
    bool

    Returns true if the two matrixes are equal, otherwise false.

    View Source

    GetHashCode()

    Gets the hash code of this Matrix.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    The Hash Code.

    View Source

    GetTransformComponents(Vector3, Rotation, Vector3)

    Gets the position, scale and rotation components from the given transform matrix.

    Declaration
    public void GetTransformComponents(Vector3 position, Rotation rotation, Vector3 scale)
    Parameters
    Type Name Description
    Vector3 position

    Position to set.

    Rotation rotation

    Rotation to set - only valid if the transform matrix has not been skewed or sheared

    Vector3 scale

    Scale to set - only valid if the transform matrix has not been skewed or sheared.

    View Source

    GetTranslation()

    Gets the translate from a Transform matrix.
    This assumes the matrix is a transform matrix.

    Declaration
    public Vector4 GetTranslation()
    Returns
    Type Description
    Vector4

    The Translation.

    View Source

    GetTranslation3()

    Gets the x, y, and z components of translate from a Transform matrix.
    This assumes the matrix is a transform matrix.

    Declaration
    public Vector3 GetTranslation3()
    Returns
    Type Description
    Vector3

    The Translation.

    View Source

    GetXAxis()

    Returns the X Axis from a Transform matrix.

    Declaration
    public Vector3 GetXAxis()
    Returns
    Type Description
    Vector3

    The X axis.

    View Source

    GetYAxis()

    Returns the Y Axis from a Transform matrix.

    Declaration
    public Vector3 GetYAxis()
    Returns
    Type Description
    Vector3

    The Y axis.

    View Source

    GetZAxis()

    Returns the Z Axis from a Transform matrix.

    Declaration
    public Vector3 GetZAxis()
    Returns
    Type Description
    Vector3

    The Z axis.

    View Source

    Invert()

    Generic brute force matrix invert.

    Declaration
    public bool Invert()
    Returns
    Type Description
    bool

    True if successful.

    View Source

    InvertTransform(Matrix)

    Inverts a transform Matrix.
    Any Matrix representing only a rotation and/or translation can be inverted using this function. It is faster and more accurate then using Invert().

    Declaration
    public void InvertTransform(Matrix result)
    Parameters
    Type Name Description
    Matrix result

    The inverse of this Matrix.

    View Source

    Multiply(Matrix, Matrix, Matrix)

    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
    public static void Multiply(Matrix result, Matrix lhs, Matrix rhs)
    Parameters
    Type Name Description
    Matrix result

    Result of the multiplication.

    Matrix lhs

    The left-hand-side Matrix. this can be same matrix as result.

    Matrix rhs

    The right-hand-side Matrix. this cannot be same matrix as result.

    View Source

    Multiply(Matrix, Matrix, Rotation)

    Function to multiply a matrix and rotataion and store the result onto third.
    Use this method in time critical path as it does not require temporaries.

    Declaration
    public static void Multiply(Matrix result, Matrix lhs, Rotation rhs)
    Parameters
    Type Name Description
    Matrix result

    Result of the multiplication.

    Matrix lhs

    The left-hand-side Matrix. this can be same matrix as result.

    Rotation rhs

    The right-hand-side Rotation.

    View Source

    Multiply(Matrix)

    Multiply the Matrix and Matrix.

    Declaration
    public Matrix Multiply(Matrix rhs)
    Parameters
    Type Name Description
    Matrix rhs

    The right-hand-side Matrix.

    Returns
    Type Description
    Matrix

    The matrix multiply as this * rhs.

    View Source

    Multiply(Vector4)

    Multiply the Matrix and Vector4.

    Declaration
    public Vector4 Multiply(Vector4 rhs)
    Parameters
    Type Name Description
    Vector4 rhs

    The right-hand-side Vector4.

    Returns
    Type Description
    Vector4

    The vector multiply as this * rhs.

    View Source

    MultiplyAssign(Matrix)

    Multiply the Matrix and Matrix. Result will be stored into this Matrix.

    Declaration
    public void MultiplyAssign(Matrix rhs)
    Parameters
    Type Name Description
    Matrix rhs

    The right-hand-side Matrix.

    View Source

    NotEqualTo(Matrix)

    Compares if rhs is not equal to.

    Declaration
    public bool NotEqualTo(Matrix rhs)
    Parameters
    Type Name Description
    Matrix rhs

    The matrix to compare.

    Returns
    Type Description
    bool

    Returns true if the two matrixes are not equal, otherwise false.

    View Source

    OrthoNormalize()

    Makes the axes of the matrix orthogonal to each other and of unit length.
    This function is used to correct floating point errors which would otherwise accumulate as operations are applied to the matrix.
    This assumes the matrix is a transform matrix.

    Declaration
    public void OrthoNormalize()
    View Source

    ReleaseSwigCPtr(HandleRef)

    Declaration
    protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
    Parameters
    Type Name Description
    System.Runtime.InteropServices.HandleRef swigCPtr
    Overrides
    Disposable.ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef)
    View Source

    SetIdentity()

    Make matrix as identity.

    Declaration
    public void SetIdentity()
    View Source

    SetIdentityAndScale(Vector3)

    Make matrix as identity and multiply scale.

    Declaration
    public void SetIdentityAndScale(Vector3 scale)
    Parameters
    Type Name Description
    Vector3 scale

    The scale value to be multiplied into identity Matrix.

    View Source

    SetInverseTransformComponents(Vector3, Rotation, Vector3)

    Sets this matrix to contain the inverse of the position, scale and rotation components.
    Performs scale, rotation, then translation

    Declaration
    public void SetInverseTransformComponents(Vector3 scale, Rotation rotation, Vector3 translation)
    Parameters
    Type Name Description
    Vector3 scale

    Scale to apply.

    Rotation rotation

    Rotation to apply.

    Vector3 translation

    Translation to apply.

    View Source

    SetInverseTransformComponents(Vector3, Vector3, Vector3, Vector3)

    Sets this matrix to contain the inverse of the orthonormal basis and position components.
    Performs scale, rotation, then translation

    Declaration
    public void SetInverseTransformComponents(Vector3 xAxis, Vector3 yAxis, Vector3 zAxis, Vector3 translation)
    Parameters
    Type Name Description
    Vector3 xAxis

    The X axis of the basis.

    Vector3 yAxis

    The Y axis of the basis.

    Vector3 zAxis

    The Z axis of the basis.

    Vector3 translation

    Translation to apply.

    View Source

    SetTransformComponents(Vector3, Rotation, Vector3)

    Sets this matrix to contain the position, scale and rotation components.
    Performs scale, rotation, then translation

    Declaration
    public void SetTransformComponents(Vector3 scale, Rotation rotation, Vector3 translation)
    Parameters
    Type Name Description
    Vector3 scale

    Scale to apply.

    Rotation rotation

    Rotation to apply.

    Vector3 translation

    Translation to apply.

    View Source

    SetTranslation(Vector3)

    Sets the translate to a Transform matrix.
    This assumes the matrix is a transform matrix.

    Declaration
    public void SetTranslation(Vector3 translation)
    Parameters
    Type Name Description
    Vector3 translation

    The translation.

    View Source

    SetTranslation(Vector4)

    Sets the translate to a Transform matrix.
    This assumes the matrix is a transform matrix.

    Declaration
    public void SetTranslation(Vector4 translation)
    Parameters
    Type Name Description
    Vector4 translation

    The translation.

    View Source

    SetValueAtIndex(uint, float)

    Set the value at matrix by it's index.

    Declaration
    public void SetValueAtIndex(uint index, float value)
    Parameters
    Type Name Description
    uint index

    The index to set value.

    float value

    The value to set.

    View Source

    SetValueAtIndex(uint, uint, float)

    Set the value at matrix by it's row index and column index.

    Declaration
    public void SetValueAtIndex(uint indexRow, uint indexColumn, float value)
    Parameters
    Type Name Description
    uint indexRow

    The row index to set value.

    uint indexColumn

    The column index to set value.

    float value

    The value to set.

    View Source

    SetXAxis(Vector3)

    Sets the X Axis to a Transform matrix.
    This assumes the matrix is a transform matrix.

    Declaration
    public void SetXAxis(Vector3 axis)
    Parameters
    Type Name Description
    Vector3 axis

    The X axis.

    View Source

    SetYAxis(Vector3)

    Sets the Y Axis to a Transform matrix.
    This assumes the matrix is a transform matrix.

    Declaration
    public void SetYAxis(Vector3 axis)
    Parameters
    Type Name Description
    Vector3 axis

    The Y axis.

    View Source

    SetZAxis(Vector3)

    Sets the Z Axis to a Transform matrix.
    This assumes the matrix is a transform matrix.

    Declaration
    public void SetZAxis(Vector3 axis)
    Parameters
    Type Name Description
    Vector3 axis

    The Z axis.

    View Source

    Transpose()

    Swaps the rows to columns.

    Declaration
    public void Transpose()
    View Source

    ValueOfIndex(uint, uint)

    Get the value of matrix by it's row index and column index.

    Declaration
    public float ValueOfIndex(uint indexRow, uint indexColumn)
    Parameters
    Type Name Description
    uint indexRow

    The row index to get value.

    uint indexColumn

    The column index to get value.

    Returns
    Type Description
    float

    A value of index

    View Source

    ValueOfIndex(uint)

    Get the value of matrix by it's index.

    Declaration
    public float ValueOfIndex(uint index)
    Parameters
    Type Name Description
    uint index

    The index to get value.

    Returns
    Type Description
    float

    A value of index

    Operators

    View Source

    operator *(Matrix, Matrix)

    Multiply Matrix and Matrix.

    Declaration
    public static Matrix operator *(Matrix lhs, Matrix rhs)
    Parameters
    Type Name Description
    Matrix lhs

    The left-hand-side Matrix.

    Matrix rhs

    The right-hand-side Matrix.

    Returns
    Type Description
    Matrix

    The Matrix multiply as lhs * rhs.

    View Source

    operator *(Matrix, Vector4)

    Multiply Matrix and Vector4.

    Declaration
    public static Vector4 operator *(Matrix lhs, Vector4 rhs)
    Parameters
    Type Name Description
    Matrix lhs

    The left-hand-side Matrix.

    Vector4 rhs

    The right-hand-side Vector4.

    Returns
    Type Description
    Vector4

    The vector multiply as lhs * rhs.

    View Source

    operator *(Rotation, Matrix)

    Multiply Rotation matrix and Matrix.

    Declaration
    public static Matrix operator *(Rotation lhs, Matrix rhs)
    Parameters
    Type Name Description
    Rotation lhs

    The left-hand-side Rotation.

    Matrix rhs

    The right-hand-side Matrix.

    Returns
    Type Description
    Matrix

    The Matrix multiply as lhs * rhs.

    Extension Methods

    EXamlExtensions.LoadFromEXaml<T>(T, string)
    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    EXamlExtensions.LoadFromEXamlPath<TXaml>(TXaml, string)
    EXamlExtensions.LoadFromEXamlPath<T>(T, Type)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX