Show / Hide Table of Contents

    Struct Tensor4

    6x6 matrix to represet Tensor inertia of an object in 4D.

    public struct Tensor4
    Remarks

    Because its immense computation size, this matrix is intended only for holding inertia data for the internal physics engine. The elements is stored in row-major order.

    Constructors

    Tensor4(Euler4)

    Create a diagonal tensor matrix.

    public Tensor4(Euler4 scale)

    Tensor4(Euler4, Euler4, Euler4, Euler4, Euler4, Euler4)

    Create and assign matrix values with rows.

    public Tensor4(Euler4 x, Euler4 y, Euler4 z, Euler4 t, Euler4 u, Euler4 v)

    Tensor4(Single)

    Create a diagonally uniform tensor matrix.

    public Tensor4(float scale)

    Fields

    et

    Fourth row of the matrix

    public Euler4 et

    eu

    Fifth row of the matrix

    public Euler4 eu

    ev

    Sixth row of the matrix

    public Euler4 ev

    ex

    First row of the matrix

    public Euler4 ex

    ey

    Second row of the matrix

    public Euler4 ey

    ez

    Third row of the matrix

    public Euler4 ez

    Properties

    Column0

    Access first column of the matrix

    public Euler4 Column0 { get; set; }

    Column1

    Access first column of the matrix

    public Euler4 Column1 { get; set; }

    Column2

    Access first column of the matrix

    public Euler4 Column2 { get; set; }

    Column3

    Access first column of the matrix

    public Euler4 Column3 { get; set; }

    Column4

    Access first column of the matrix

    public Euler4 Column4 { get; set; }

    Column5

    Access first column of the matrix

    public Euler4 Column5 { get; set; }

    identity

    Create a tensor as an identity matrix.

    public static Tensor4 identity { get; }

    Item[Int32]

    Get Nth-row of the matrix

    public Euler4 this[int index] { get; set; }

    zero

    Create a tensor with zero values.

    public static Tensor4 zero { get; }

    Methods

    Column(Int32)

    Get Nth-column of the matrix

    public Euler4 Column(int i)

    Cross(Matrix4)

    Create inertia from rotation matrix.

    public static Tensor4 Cross(Matrix4 t)

    Inverse(Tensor4)

    Inverse the tensor.

    public static Tensor4 Inverse(Tensor4 m)
    Remarks

    The operation is working, but unoptimized, yet expensive.

    OuterProduct(Vector4, Vector4)

    ? (WIP)

    public static Tensor4 OuterProduct(Vector4 u, Vector4 v)

    Transform(Tensor4, Matrix4)

    Rotate the tensor orientation by the matrix

    public static Tensor4 Transform(Tensor4 I, Matrix4 r)

    Transform(Tensor4, Matrix4x5, Single)

    Transform the inertia.

    public static Tensor4 Transform(Tensor4 I, Matrix4x5 T, float mass)

    Transform(Vector4, Single)

    Create a tensor translation.

    public static Tensor4 Transform(Vector4 p, float mass)

    Transpose(Tensor4)

    Transpose the tensor.

    public static Tensor4 Transpose(Tensor4 m)

    Operators

    Addition(Tensor4, Tensor4)

    Scale the tensor.

    public static Tensor4 operator +(Tensor4 lhs, Tensor4 rhs)

    Multiply(Tensor4, Euler4)

    Transform euler rotation by the tensor.

    public static Euler4 operator *(Tensor4 lhs, Euler4 rhs)

    Multiply(Tensor4, Tensor4)

    Combine two tensor.

    public static Tensor4 operator *(Tensor4 lhs, Tensor4 rhs)

    Multiply(Tensor4, Single)

    Scale the tensor.

    public static Tensor4 operator *(Tensor4 lhs, float f)

    Subtraction(Tensor4, Tensor4)

    Element-wisely subract two tensor.

    public static Tensor4 operator -(Tensor4 lhs, Tensor4 rhs)
    ▲ Copyright © 2017 Wello Soft