Line | |
---|
1 | /*! |
---|
2 | * @file skydome.h |
---|
3 | */ |
---|
4 | |
---|
5 | #ifndef _SKYDOME_H |
---|
6 | #define _SKYDOME_H |
---|
7 | |
---|
8 | /* INCLUDES */ |
---|
9 | #include "world_entity.h" |
---|
10 | #include "shader.h" |
---|
11 | |
---|
12 | // typedef struct VERTEX |
---|
13 | // { |
---|
14 | // float x,y,z; |
---|
15 | // unsigned int color; |
---|
16 | // float u, v; |
---|
17 | // } ; |
---|
18 | |
---|
19 | |
---|
20 | //! A Class to handle a SkyDome |
---|
21 | class Skydome : public WorldEntity |
---|
22 | { |
---|
23 | ObjectListDeclaration(Skydome); |
---|
24 | public: |
---|
25 | Skydome(); |
---|
26 | |
---|
27 | virtual ~Skydome(); |
---|
28 | |
---|
29 | void init(); |
---|
30 | virtual void draw() const; |
---|
31 | |
---|
32 | void generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius, |
---|
33 | float hTile, float vTile); |
---|
34 | |
---|
35 | void setShader(Shader* shader); |
---|
36 | void setTexture(GLuint texture); |
---|
37 | |
---|
38 | void activate(); |
---|
39 | void deactivate(); |
---|
40 | |
---|
41 | private: |
---|
42 | |
---|
43 | typedef struct VertexInfo |
---|
44 | { |
---|
45 | float x,y,z; |
---|
46 | unsigned int color; |
---|
47 | float u, v; |
---|
48 | }; |
---|
49 | |
---|
50 | bool activateDome; |
---|
51 | |
---|
52 | VertexInfo *planeVertices; |
---|
53 | int numPlaneVertices; |
---|
54 | |
---|
55 | int *indices; |
---|
56 | int numIndices; |
---|
57 | |
---|
58 | float pRadius; |
---|
59 | |
---|
60 | VertexInfo *vertices; |
---|
61 | int numVertices; |
---|
62 | |
---|
63 | GLuint texture; |
---|
64 | Shader* shader; |
---|
65 | }; |
---|
66 | |
---|
67 | #endif /* _SKYDOME_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.