model.h
来自「Battle Balls v1.0 nice」· C头文件 代码 · 共 44 行
H
44 行
#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 + =
减小字号Ctrl + -
显示快捷键?