-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMeshManager.h
69 lines (58 loc) · 1.28 KB
/
CMeshManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef CLASSMESHMANAGER
#define CLASSMESHMANAGER
#define NIFLIB_STATIC_LINK
#include <niflib.h>
#include <obj/NiNode.h>
#include <obj/NiTriStrips.h>
#include <obj/NiTriStripsData.h>
#include <obj/NiTexturingProperty.h>
#include <obj/NiTriShape.h>
#include <obj/NiTriShapeData.h>
using namespace Niflib;
typedef struct
{
D3DXVECTOR3 Pos;
D3DXVECTOR3 Norm;
D3DXVECTOR4 Color;
D3DXVECTOR2 TextUV;
} MeshVertex;
typedef struct
{
} MeshIndiceBuf;
typedef struct
{
ID3D10Buffer *pVertexBuf;
unsigned long numvert;
ID3D10Buffer *pIndiceBuf;
unsigned long numind;
CTexture *datext; // texture for this part
float local_translation[3]; //additional translation
unsigned long tristrip; //are those triangle strips
} MeshData;
class CMesh
{
public:
CMesh();
~CMesh();
unsigned long Load_Mesh(unsigned long);
unsigned long Get_FormID();
void Draw(float *,float *,float);
protected:
MeshData *AddTriStrips(NiTriStripsRef);
MeshData *AddTriShape(NiTriShapeRef);
protected:
unsigned long formID;
vector<MeshData *> listdata;
CTexture *MeshTexture;
};
class CMeshManager
{
public:
CMeshManager();
~CMeshManager();
//Load a STAT object
CMesh *Load_STAT(unsigned long);
protected:
vector<CMesh *> listmeshes;
};
#endif