MQMatrixクラス

(new in Rev2.40)
 MQMatrixクラスは4x4行列を管理するクラスです。
 下記の公開メンバ変数を保持しており、自由にアクセスすることができます。

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

 コンストラクタです。行列内部のデータは初期化されません。


void MQMatrix::Identify();

 単位行列として初期化します。


void MQMatrix::Transpose3(void);

 行列のうち左上3x3成分のみを転置します。


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

p
ベクトル
戻り値
ベクトルと行列の積

 行列のうち左上3x3成分のみでベクトルと行列の積を計算します。


void MQMatrix::Transpose3(void);

 行列のうち左上3x3成分のみを転置します。


MQPoint MQMatrix::GetScaling(void) const;

戻り値
拡大成分

 SRT変換行列から拡大成分を抽出して、そのXYZごとの要素をMQPoint型として取得します。


MQAngle MQMatrix::GetRotation(void) const;

戻り値
回転成分

 SRT変換行列から回転成分を抽出して、その角度(オイラー角)をMQAngle型として取得します。


MQPoint MQMatrix::GetTranslation(void) const;

戻り値
平行移動成分

 SRT変換行列から平行移動成分を抽出して、その移動量をMQPoint型として取得します。


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

scaling
拡大成分
rotation
回転成分
trans
平行移動成分

 SRT変換行列を設定します。


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

scaling
拡大成分
rotation
回転成分
trans
平行移動成分

 SRT変換逆行列を設定します。