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成分のみを転置します。


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

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

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


MQPoint MQMatrix::GetRow3(int r) const;

r
戻り値
3x1行成分

(new in Rev3.10)

行列のうち指定した行の左側3x1成分をベクトルとして取り出します。


MQPoint MQMatrix::GetColumn3(int c) const;

c
戻り値
1x3列成分

(new in Rev3.10)

行列のうち指定した列の上側1x3成分をベクトルとして取り出します。


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

r
p
3x1行成分

(new in Rev3.10)

行列のうち指定した行の左側3x1成分にベクトルの値を設定します。


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

c
p
1x3列成分

(new in Rev3.10)

行列のうち指定した列の上側1x3成分にベクトルの値を設定します。


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変換逆行列を設定します。