Last change
on this file since 10646 was
10618,
checked in by bknecht, 18 years ago
|
merged cleanup into trunk (only improvements)
|
File size:
1013 bytes
|
Rev | Line | |
---|
[8732] | 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 | { |
---|
[9869] | 23 | ObjectListDeclaration(Skydome); |
---|
[8732] | 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); |
---|
[9869] | 34 | |
---|
[8732] | 35 | void setShader(Shader* shader); |
---|
| 36 | void setTexture(GLuint texture); |
---|
[9869] | 37 | |
---|
[9006] | 38 | void activate(); |
---|
| 39 | void deactivate(); |
---|
[8732] | 40 | |
---|
| 41 | private: |
---|
[9869] | 42 | |
---|
[8732] | 43 | typedef struct VertexInfo |
---|
| 44 | { |
---|
| 45 | float x,y,z; |
---|
| 46 | unsigned int color; |
---|
| 47 | float u, v; |
---|
| 48 | }; |
---|
| 49 | |
---|
[9006] | 50 | bool activateDome; |
---|
[9869] | 51 | |
---|
[8732] | 52 | VertexInfo *planeVertices; |
---|
| 53 | int numPlaneVertices; |
---|
| 54 | |
---|
| 55 | int *indices; |
---|
| 56 | int numIndices; |
---|
| 57 | |
---|
| 58 | float pRadius; |
---|
| 59 | |
---|
| 60 | VertexInfo *vertices; |
---|
| 61 | int numVertices; |
---|
[9869] | 62 | |
---|
[8732] | 63 | GLuint texture; |
---|
| 64 | Shader* shader; |
---|
| 65 | }; |
---|
| 66 | |
---|
| 67 | #endif /* _SKYDOME_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.