CrossFramework Library
|
#include <XBase/Matrix44.hpp>
4x4の32bit浮動小数行列構造体。
使用頻度のことを考えて Mtx44 という名前でもアクセスできます。 配列の並びはOpenGL準拠にしてあります。
c0 c1 c2 c3 r0 [0] [4] [8] [12] r1 [1] [5] [9] [13] r2 [2] [6] [10] [14] r3 [3] [7] [11] [15]
DirectXの並びは行ベースになりますが演算上はどちらでも変わりません。 (例:Translateのx,y,z値はどちらも12,13,14番にくる。)
インデックス値 | |
enum | { Index00 = 0, Index10 = 1, Index20 = 2, Index30 = 3, Index01 = 4, Index11 = 5, Index21 = 6, Index31 = 7, Index02 = 8, Index12 = 9, Index22 = 10, Index32 = 11, Index03 = 12, Index13 = 13, Index23 = 14, Index33 = 15, IndexXX = Index00, IndexXY = Index10, IndexXZ = Index20, IndexXW = Index30, IndexYX = Index01, IndexYY = Index11, IndexYZ = Index21, IndexYW = Index31, IndexZX = Index02, IndexZY = Index12, IndexZZ = Index22, IndexZW = Index32, IndexWX = Index03, IndexWY = Index13, IndexWZ = Index23, IndexWW = Index33 } |
行列の作成 | |
static const Matrix44POD | Identity () |
単位行列の作成。 | |
static const Matrix44POD | Translate (f32 aX, f32 aY, f32 aZ) |
平行移動行列の作成。 | |
static const Matrix44POD | Translate (const Vector3POD &aVec) |
平行移動行列の作成。 | |
static const Matrix44POD | Scale (f32 aX, f32 aY, f32 aZ) |
拡大縮小行列の作成。 | |
static const Matrix44POD | Scale (const Vector3POD &aVec) |
拡大縮小行列の作成。 | |
static const Matrix44POD | Rotate (const Angle &, f32 aAxisX, f32 aAxisY, f32 aAxisZ) |
回転行列の作成。 | |
static const Matrix44POD | Rotate (const Angle &, const Vector3POD &aAxis) |
回転行列の作成。 | |
static const Matrix44POD | Ortho (f32 aLeft, f32 aTop, f32 aRight, f32 aBottom, f32 aNear, f32 aFar) |
正射影行列の作成。 | |
static const Matrix44POD | Frustum (f32 aLeft, f32 aRight, f32 aBottom, f32 aTop, f32 aNear, f32 aFar) |
透視射影行列(Frustum)の作成。 | |
static const Matrix44POD | Perspective (const Angle &aFOVY, f32 aAspect, f32 aNear, f32 aFar) |
透視射影行列(Perspective)の作成。 | |
static const Matrix44POD | LookAt (const Vector3POD &aEyePos, const Vector3POD &aTargetPos, const Vector3POD &aUpVec) |
視野変換行列の作成。 | |
f32 | m [4][4] |
2次元配列。 | |
f32 | v [16] |
1次元配列。 | |
変数 | |
union { | |
f32 m [4][4] | |
2次元配列。 | |
f32 v [16] | |
1次元配列。 | |
}; | |
XYZWアクセス(1列ごとにX,Y,Z,Wが割り当てられているとする) | |
const Vector4POD | x () const |
const Vector4POD | y () const |
const Vector4POD | z () const |
const Vector4POD | w () const |
void | setX (const Vector4POD &) |
void | setY (const Vector4POD &) |
void | setZ (const Vector4POD &) |
void | setW (const Vector4POD &) |
乗算(引数が同じオブジェクトでも問題無し) | |
const Matrix44POD | mul (const Matrix44POD &) const |
乗算した結果を得る。this x rhs。 | |
Matrix44POD & | mulAssign (const Matrix44POD &) |
乗算し結果を代入する。this = this x rhs。 | |
演算子オーバーロード | |
const Matrix44POD | operator* (const Matrix44POD &) const |
mul()。 | |
Matrix44POD & | operator*= (const Matrix44POD &) |
mulAssign()。 | |
変換 | |
const Matrix44POD | invert () const |
逆行列を取得する。 | |
const Matrix44POD | transpose () const |
転置行列を取得する。 | |
デバッグ | |
void | dump () const |