-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathObj.h
51 lines (31 loc) · 1.05 KB
/
Obj.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
#ifndef __OBJ__
#define __OBJ__
#include "RenderableThing.h"
class RenderSystem;
using VERTICE::PosNormalTexTan;
class Obj : public RenderableThing
{
protected:
PosNormalTexTan *vertices; //正常渲染的顶点
DWORD *indices; //索引
UINT32 vcount;
UINT32 icount;
Material mate; //材质
UINT32 vertCount; //顶点数量
public:
Obj();
virtual ~Obj();
void CreateTestTriangle();
void CreateBox(float width, float height, float depth, const Material &material = Material() );
void CreateGrid(float width, float height, UINT32 m, UINT32 n, const Material &material = Material());
void CreateSphere(float radius, int slice, int stack, const Material &material = Material());
void AssembleShadowMapVertices();
void SetMaterial(const Material &material);
const Material& GetMaterial() const;
UINT32 GetVerticeCount() const;
virtual void Update(float time);
private:
BOOL InitBuffers();
void Release();
};
#endif