Changeset 8668 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h
- Timestamp:
- Jun 21, 2006, 1:56:41 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h
r8663 r8668 31 31 #define at3(rx,ry,rz) ( rx * q[0] + ry * q[1] + rz * q[2] ) 32 32 33 34 #define DTOR (PI/180.0f) 35 #define SQR(x) (x*x) 36 37 typedef struct { 38 float x,y,z; 39 unsigned int color; 40 float u, v; 41 } VERTEX; 42 43 33 44 class CloudEffect : public WeatherEffect 34 45 { … … 45 56 46 57 inline void activateCloud() 47 { 48 this->activate(); 49 } 58 { this->activate(); } 59 50 60 inline void deactivateCloud() 51 { 52 this->deactivate(); 53 } 61 { this->deactivate(); } 62 54 63 inline void setCloudOption(const std::string& option) 55 64 { … … 57 66 this->cloudActivate = true; 58 67 } 68 59 69 inline void setAnimationSpeed(float speed) 60 { 61 this->animationSpeed = speed; 62 } 70 { this->animationSpeed = speed; } 71 72 inline void setLightPosition(float x, float y, float z) 73 { this->lightPos = Vector(x,y,z); } 63 74 75 inline void setCloudScale(float scale) 76 { this->scale = scale; } 77 78 inline void setPlanetRadius(float planetRadius) 79 { this->planetRadius = planetRadius; } 80 81 inline void setAtmosphericRadius(float atmosphericRadius) 82 { this->atmosphericRadius = atmosphericRadius; } 83 84 inline void setDivisions(int divs) 85 { this->divs = divs; } 86 64 87 virtual void draw() const; 65 88 virtual void tick(float dt); … … 72 95 void normalize3(double v[3]); 73 96 97 void generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius, 98 float hTile, float vTile); 74 99 private: 75 100 76 bool cloudActivate;77 float animationSpeed;101 bool cloudActivate; 102 float animationSpeed; 78 103 79 104 // Material cloudMaterial; 80 Shader* shader; 81 Shader::Uniform* offset; 105 106 // SHADER STUFF 107 Shader* shader; 108 Shader::Uniform* offset; 109 float offsetZ; 110 Vector lightPos; 111 float scale; 112 float planetRadius; 113 float atmosphericRadius; 114 int divs; 82 115 83 float offsetZ; 116 // NOISE STUFF 117 int noise3DTexSize; 118 GLuint noise3DTexName; 119 GLubyte *noise3DTexPtr; 84 120 85 int noise3DTexSize; 86 GLuint noise3DTexName; 87 GLubyte *noise3DTexPtr; 121 int p[MAXB + MAXB + 2]; 122 double g3[MAXB + MAXB + 2][3]; 123 double g2[MAXB + MAXB + 2][2]; 124 double g1[MAXB + MAXB + 2]; 88 125 89 int p[MAXB + MAXB + 2]; 90 double g3[MAXB + MAXB + 2][3]; 91 double g2[MAXB + MAXB + 2][2]; 92 double g1[MAXB + MAXB + 2]; 126 int start; 127 int B; 128 int BM; 129 130 // SKYPLANE STUFF 131 VERTEX *planeVertices; 132 int numPlaneVertices; 93 133 94 int start; 95 int B; 96 int BM; 134 int *indices; 135 int numIndices; 136 137 float pRadius; 138 139 VERTEX *vertices; 140 int numVertices; 97 141 }; 98 142
Note: See TracChangeset
for help on using the changeset viewer.