D3DMatrix.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1998-1999 DXGuide. All Rights Reserved.
- // File: D3DMatrix.h
- #ifndef _D3DMATRIX__H
- #define _D3DMATRIX__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- // turn off warnings for /W4
- #pragma warning(disable: 4201)
- #define D3D_OVERLOADS
- #include <d3d.h>
- #pragma warning(default: 4201)
- class CD3DMatrix : public _D3DMATRIX
- {
- public:
- CD3DMatrix(void);
- CD3DMatrix(
- D3DVALUE __11, D3DVALUE __12, D3DVALUE __13, D3DVALUE __14,
- D3DVALUE __21, D3DVALUE __22, D3DVALUE __23, D3DVALUE __24,
- D3DVALUE __31, D3DVALUE __32, D3DVALUE __33, D3DVALUE __34,
- D3DVALUE __41, D3DVALUE __42, D3DVALUE __43, D3DVALUE __44);
- ~CD3DMatrix();
- public:
- operator _D3DMATRIX*();
- operator const _D3DMATRIX*() const;
- friend CD3DMatrix operator+(const CD3DMatrix& a, const CD3DMatrix& b);
- friend CD3DMatrix operator*(const CD3DMatrix& a, const CD3DMatrix& b);
- CD3DMatrix& operator+=(const CD3DMatrix& m);
- CD3DMatrix& operator*=(const CD3DMatrix& m);
- public:
- void SetZero(void);
- void SetIdentity(void);
- void SetTranslate(D3DVALUE ftx, D3DVALUE fty, D3DVALUE ftz);
- void SetTranslate(const D3DVECTOR& v);
- void SetScale(D3DVALUE fsx, D3DVALUE fsy, D3DVALUE fsz);
- void SetScale(const D3DVECTOR& v);
- void SetRotateX(const D3DVALUE fRads);
- void SetRotateY(const D3DVALUE fRads);
- void SetRotateZ(const D3DVALUE fRads);
- void SetRotation(const D3DVECTOR& vDir, D3DVALUE fRads);
- bool SetView(const D3DVECTOR& vFrom,
- const D3DVECTOR& vAt, const D3DVECTOR& vWorldUp);
- bool SetProjection(
- D3DVALUE fFOV = 1.570795f,
- D3DVALUE fAspect = 1.0f,
- D3DVALUE fNearPlane = 1.0f,
- D3DVALUE fFarPlane = 1000.0f);
- bool Invert(const D3DMATRIX& a);
- };
- #endif // _D3DMATRIX__H