📄 model.h
字号:
#pragma once
#include <vector>
#include <d3dx9.h>
struct BoundingBox
{
bool isPointInside(D3DXVECTOR3& p);
D3DXVECTOR3 _min;
D3DXVECTOR3 _max;
};
struct BoundingSphere
{
D3DXVECTOR3 _center;
float _radius;
};
class CModel
{
public:
CModel(char *File,IDirect3DDevice9 *device,bool pmesh);
~CModel();
void Draw();
void walk(float units); // forward/backward
void yaw(float angle); // rotate on up vector
bool ComputeBoundingSphere(ID3DXMesh* mesh, BoundingSphere* sphere);
D3DXVECTOR3 vecRot; // vector for rotation angles
D3DXVECTOR3 vecPos; // vector for translation units
D3DXVECTOR3 vecScale; // vector for scaling units
D3DXVECTOR3 look;
float alphaLevel;
bool alpha;
bool pm; //is progressive mesh?
ID3DXPMesh *pMesh; //progressive mesh
ID3DXMesh *Mesh;
BoundingSphere BS;
private:
IDirect3DDevice9 *Device;
std::vector<IDirect3DTexture9*> Textures;
std::vector<D3DMATERIAL9> Mtrls;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -