Game Development Reference
In-Depth Information
// 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;
The D3DXMATRIX class inherits its data entries from the simpler
D3DMATRIX structure, which is defined as:
typedef struct _D3DMATRIX {
union {
struct {
float _11, _12, _13, _14;
float _21, _22, _23, _24;
float _31, _32, _33, _34;
float _41, _42, _43, _44;
};
float m[4][4];
};
} D3DMATRIX;
Observe that the D3DXMATRIX class has a myriad of useful operators,
such as testing for equality, adding and subtracting matrices, multiply-
ing a matrix by a scalar, casting, and—most importantly—multiplying
two D3DXMATRIX s together. Because matrix multiplication is so impor-
tant, we give a code example of using this operator:
D3DXMATRIX A(…); // initialize A
D3DXMATRIX B(…); // initialize B
Search WWH ::




Custom Search