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.


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

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::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);

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);

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.