MQMatrix class

(new in Rev2.40)

MQMatrix class manages a 4x4 matrix. There are the following member variables.

class MQMatrix {
public:
    union {
        float t[16];
        float d[4][4];
        struct {
            float _11, _12, _13, _14;
            float _21, _22, _23, _24;
            float _31, _32, _33, _34;
            float _41, _42, _43, _44;
        };
    };
};

MQMatrix::MQMatrix();

Variables contained in a matrix are not initialized in the constructor.


void MQMatrix::Identify();

It initializes as an identity matrix.


void MQMatrix::Transpose3(void);

It transposes only upper left 3x3 components in a matrix.


MQPoint MQMatrix::Mult3(const MQPoint& p) const;

p
A vector
Return value
A product of a vector and a matrix

It calculate a product of a vector and upper left 3x3 components in a matrix.


MQPoint MQMatrix::GetRow3(int r) const;

r
Row index
Return value
3x1 row component

(new in Rev3.10)

It extracts a vector from a left 3x1 row component in the matrix.


MQPoint MQMatrix::GetColumn3(int c) const;

c
Column index
Return value
1x3 column component

(new in Rev3.10)

It extracts a vector from an upper 1x3 column component in the matrix.


MQPoint MQMatrix::SetRow3(int r, const MQPoint& p) const;

r
Row index
p
3x1 row component

(new in Rev3.10)

It sets a left 3x1 row component with a vector.


MQPoint MQMatrix::SetColumn3(int c, const MQPoint& p) const;

c
Column index
p
1x3 column component

(new in Rev3.10)

It sets an upper 1x3 column component with a vector.


MQPoint MQMatrix::GetScaling(void) const;

Return value
A scaling factor

It extracts a scaling factor from a SRT transformation matrix, and returns each component for X, Y and Z as a MQPoint.


MQAngle MQMatrix::GetRotation(void) const;

Return value
A rotation angle

It extracts a rotation angle from a SRT transformation matrix, and returns each component of an Euler angle as a MQAngle.


MQPoint MQMatrix::GetTranslation(void) const;

Return value
A translation

It extracts a translation from a SRT transformation matrix, and returns the translation as a MQPoint.


void MQMatrix::SetTransform(const MQPoint *scaling, const MQAngle *rotation, const MQPoint *trans);

void MQMatrix::SetTransform(const MQPoint& scaling, const MQAngle& rotation, const MQPoint& trans);

scaling
A scaling factor
rotation
A rotation angle
trans
A translation factor

It sets a SRT transformation matrix with a scaling factor, a rotation angle and a translation.


void MQMatrix::SetInverseTransform(const MQPoint *scaling, const MQAngle *rotation, const MQPoint *trans);

void MQMatrix::SetInverseTransform(const MQPoint& scaling, const MQAngle& rotation, const MQPoint& trans);

scaling
A scaling factor
rotation
A rotation angle
trans
A translation factor

It sets an inverse SRT transformation matrix with a scaling factor, a rotation angle and a translation.


bool MQMatrix::Inverse(MQMatrix& inv_mtx)

inv_mtx
A matrix
Return value
Succeeded or failed

(new in Rev4.60)

It Inverts matrix.


bool MQMatrix::IsIdentity(void) const

Return value
[true]Identity
[false]Not identity

(new in Rev4.60)

It returns whether a matrix is identety or not.


bool MQMatrix::IsIdentity3(void) const

Return value
[true]Identity
[false]Not identity

(new in Rev4.60)

It returns whether a matrix is identety or not,only upper left 3x3 components in the matrix.