Line | |
---|
1 |
|
---|
2 | #pragma once
|
---|
3 |
|
---|
4 | class Mesh
|
---|
5 | {
|
---|
6 | //IDirect3DDevice9* pd3dDevice;
|
---|
7 | ID3DXMesh* pMesh;
|
---|
8 | IDirect3DTexture9* pMeshTexture;
|
---|
9 |
|
---|
10 | DWORD numMaterials;
|
---|
11 | D3DXVECTOR3 originalSize;
|
---|
12 | float originalDiameter;
|
---|
13 | float preferredDiameter;
|
---|
14 | D3DXVECTOR3 position;
|
---|
15 | D3DXVECTOR3 containerSize;
|
---|
16 |
|
---|
17 | HRESULT hr;
|
---|
18 |
|
---|
19 | public:
|
---|
20 | Mesh(float preferredDiameter);
|
---|
21 | Mesh(LPCWSTR fileName, LPCWSTR texFileName, float preferredDiameter, D3DXVECTOR3 offset);
|
---|
22 | ~Mesh();
|
---|
23 | void Move(D3DXVECTOR3 movement);
|
---|
24 |
|
---|
25 | void Load(LPCWSTR fileName);
|
---|
26 |
|
---|
27 | HRESULT Draw();
|
---|
28 |
|
---|
29 | D3DXVECTOR3 GetMeshSize() { return GetMeshScale() * originalSize; }
|
---|
30 | float GetMeshScale() { return preferredDiameter / originalDiameter; }
|
---|
31 | D3DXVECTOR3 GetMeshPosition() { return position; }
|
---|
32 | void SetContainerSize(D3DXVECTOR3 size) { containerSize = size; }
|
---|
33 | IDirect3DTexture9* GetTexture() { return pMeshTexture; }
|
---|
34 |
|
---|
35 | protected:
|
---|
36 | HRESULT CalculateMeshSize( );
|
---|
37 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.