D3DXMATRIX 구조체(D3dx9math.h)

참고

D3DX 유틸리티 라이브러리는 더 이상 사용되지 않습니다. 대신 DirectXMath 를 사용하는 것이 좋습니다.

메서드 및 연산자 오버로드를 포함하는 4x4 행렬입니다.

구문

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

멤버

_Ij

형식: FLOAT

행렬의 (i, j) 구성 요소입니다. 여기서 i는 행 번호이고 j는 열 번호입니다. 예를 들어 _34는 세 번째 행과 네 번째 열의 구성 요소인 [a]와 동일합니다.

설명

C 프로그래머는 D3DXMATRIX 구조를 사용할 수 없으며 D3DMATRIX 구조를 사용해야 합니다. C++ 프로그래머는 오버로드된 생성자 및 할당, 단항 및 이진(같음 포함) 연산자를 활용할 수 있습니다.

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

추가 정보

D3DX 구조체

D3DMATRIX