D3DXMATRIX

メソッドおよび operator オーバーロードを含む 4x4 行列です。

typedef struct D3DXMATRIX {
    FLOAT _ij;
} D3DXMATRIX, *LPD3DXMATRIX;

メンバ

  • _ij
    行列の (i, j) 成分です。i は行番号、j は列番号を表します。たとえば、_34 は [a34] と同じ意味になり、3 行目の 4 列目にある成分を表します。

解説 

C のプログラムでは、D3DXMATRIX 構造体は使用できないため、D3DMATRIX 構造体を使用してください。C++ プログラマは、オーバーロードされたコンストラクターや代入 operator、単項 operator、2 項 operator (統合 operator を含む) の利点を活用できます。

D3DX では、射影行列の _34 要素には負の数値を使用できません。アプリケーションでここに負の値を使う必要がある場合は、代わりに射影行列全体を -1 でスケーリングする必要があります。

D3DXMATRIX の拡張機能

D3DXMATRIX には次のような C++ 拡張機能があります。

 #ifdef __cplusplus typedef struct D3DXMATRIX : public D3DMATRIX { public:     D3DXMATRIX() {};     D3DXMATRIX( CONST FLOAT * );     D3DXMATRIX( CONST D3DMATRIX& );     D3DXMATRIX( CONST D3DXFLOAT16 * );     D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14,                 FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24,                 FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34,                 FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 );       // access grants     FLOAT& operator () ( UINT Row, UINT Col );     FLOAT  operator () ( UINT Row, UINT Col ) const;      // casting operators     operator FLOAT* ();     operator CONST FLOAT* () const;      // assignment operators     D3DXMATRIX& operator *= ( CONST D3DXMATRIX& );     D3DXMATRIX& operator += ( CONST D3DXMATRIX& );     D3DXMATRIX& operator -= ( CONST D3DXMATRIX& );     D3DXMATRIX& operator *= ( FLOAT );     D3DXMATRIX& operator /= ( FLOAT );      // unary operators     D3DXMATRIX operator + () const;     D3DXMATRIX operator - () const;      // binary operators     D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const;     D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const;     D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const;     D3DXMATRIX operator * ( FLOAT ) const;     D3DXMATRIX operator / ( FLOAT ) const;      friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& );      BOOL operator == ( CONST D3DXMATRIX& ) const;     BOOL operator != ( CONST D3DXMATRIX& ) const;  } D3DXMATRIX, *LPD3DXMATRIX;  #else //!__cplusplus typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; #endif //!__cplusplus         

要件

ヘッダー: D3dx9math.h 宣言

関連項目

D3DMATRIX