Changeset 10407 in orxonox.OLD for branches/blink/src/world_entities/effects
- Timestamp:
- Jan 27, 2007, 4:01:42 PM (18 years ago)
- Location:
- branches/blink/src/world_entities/effects
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blink/src/world_entities/effects/billboard.cc
r10114 r10407 24 24 25 25 26 26 #include "debug.h" 27 27 28 28 … … 66 66 //this->setVisibiliy(true); 67 67 this->setSize(5, 5); 68 69 this->texColor = NULL; 68 70 } 69 71 … … 147 149 //v += this->getAbsCoor(); 148 150 //PRINTF(0)("sizeX: %f sizeY: %f\n", sizeX, sizeY); 151 if(this->texColor != NULL) 152 { 153 //glColor4ub((int)(this->texColor->r() * 255), (int)(this->texColor->g() * 255), (int)(this->texColor->b() * 255), (int)(this->texColor->a() * 255)); 154 glColor4ub(255, 0, 0, 255); 155 } 156 149 157 glBegin(GL_QUADS); 150 158 glTexCoord2f(0.0f, 0.0f); … … 171 179 glPopAttrib(); 172 180 } 181 182 183 /** 184 * changes the texture color 185 * @param col color for the texture 186 */ 187 void Billboard::colorTexture(Color col) 188 { 189 this->texColor = &col; 190 } -
branches/blink/src/world_entities/effects/billboard.h
r9869 r10407 10 10 class Material; 11 11 class TiXmlElement; 12 class Color; 12 13 13 14 class Billboard : public WorldEntity … … 23 24 void setSize(float sizeX, float sizeY); 24 25 void setTexture(const std::string& textureFile); 26 void colorTexture(Color col); 25 27 26 28 virtual void tick(float dt); … … 29 31 private: 30 32 Material* material; 33 Color* texColor; 31 34 float sizeX; 32 35 float sizeY; -
branches/blink/src/world_entities/effects/blink.cc
r10325 r10407 19 19 #include "debug.h" 20 20 #include "state.h" 21 21 #include "effects/billboard.h" 22 22 23 23 #include "material.h" … … 40 40 if( root) 41 41 this->loadParams(root); 42 43 // this->bBoard->setSize(this->size, this->size); 42 44 } 43 45 … … 77 79 78 80 //srand((unsigned)time(NULL)); 81 82 83 this->bBoard = new Billboard; 84 this->bBoard->setVisibiliy(true); 85 this->bBoard->setTexture("maps/star_alpha.png"); 86 this->bBoard->setAbsCoor(this->position.x, this->position.y, this->position.z); 79 87 80 88 … … 175 183 Vector diff = camCoor - this->position; 176 184 185 177 186 //glTranslatef(position.x + size/2, position.y + size/2, position.z); 178 187 … … 187 196 this->material->select(); 188 197 189 190 glColor4ub(this->color.x, this->color.y, this->color.z, 127.5*(this->blinkStr + 1));191 glBegin(GL_QUADS);192 glTexCoord2f(1, 1); glVertex3f(0, 0, 0);193 glTexCoord2f(1, 0); glVertex3f(this->size, 0, 0);194 glTexCoord2f(0, 0); glVertex3f(this->size, this->size, 0);195 glTexCoord2f(0, 1); glVertex3f(0, this->size, 0);196 glEnd();198 this->bBoard->colorTexture(Color(1, 0, 0, 0)); 199 //glColor4ub(this->color.x, this->color.y, this->color.z, 127.5*(this->blinkStr + 1)); 200 // glBegin(GL_QUADS); 201 // glTexCoord2f(1, 1); glVertex3f(0, 0, 0); 202 // glTexCoord2f(1, 0); glVertex3f(this->size, 0, 0); 203 // glTexCoord2f(0, 0); glVertex3f(this->size, this->size, 0); 204 // glTexCoord2f(0, 1); glVertex3f(0, this->size, 0); 205 // glEnd(); 197 206 198 207 -
branches/blink/src/world_entities/effects/blink.h
r10325 r10407 7 7 8 8 #include "world_entity.h" 9 #include " color.h"9 #include "effects/billboard.h" 10 10 11 11 class Material; 12 12 class TiXmlElement; 13 //class Billboard; 13 14 14 15 class Blink : public WorldEntity … … 23 24 24 25 void setPosition(float x, float y, float z) { this->position = Vector(x, y, z); } 25 void setSize(float s) { this->size = s; }26 void setSize(float s) { this->size = s; this->bBoard->setSize(this->size, this->size); } 26 27 void setOmega(float w) { this->omega = w; } 27 28 void setColor(float r, float g, float b) { this->color = Vector(r, g, b); } … … 33 34 private: 34 35 Material* material; 36 Billboard* bBoard; 35 37 Vector position; 36 38 Vector color;
Note: See TracChangeset
for help on using the changeset viewer.