Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10407 in orxonox.OLD


Ignore:
Timestamp:
Jan 27, 2007, 4:01:42 PM (18 years ago)
Author:
stefalie
Message:

some changes…

Location:
branches/blink/src/world_entities/effects
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/blink/src/world_entities/effects/billboard.cc

    r10114 r10407  
    2424
    2525
    26 
     26#include "debug.h"
    2727
    2828
     
    6666  //this->setVisibiliy(true);
    6767  this->setSize(5, 5);
     68
     69  this->texColor = NULL;
    6870}
    6971
     
    147149//v += this->getAbsCoor();
    148150    //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
    149157  glBegin(GL_QUADS);
    150158  glTexCoord2f(0.0f, 0.0f);
     
    171179  glPopAttrib();
    172180}
     181
     182
     183/**
     184 * changes the texture color
     185 * @param col color for the texture
     186 */
     187void Billboard::colorTexture(Color col)
     188{
     189  this->texColor = &col;
     190}
  • branches/blink/src/world_entities/effects/billboard.h

    r9869 r10407  
    1010class Material;
    1111class TiXmlElement;
     12class Color;
    1213
    1314class Billboard : public WorldEntity
     
    2324    void setSize(float sizeX, float sizeY);
    2425    void setTexture(const std::string& textureFile);
     26    void colorTexture(Color col);
    2527
    2628    virtual void tick(float dt);
     
    2931  private:
    3032    Material*        material;
     33    Color*           texColor;
    3134    float sizeX;
    3235    float sizeY;
  • branches/blink/src/world_entities/effects/blink.cc

    r10325 r10407  
    1919#include "debug.h"
    2020#include "state.h"
    21 
     21#include "effects/billboard.h"
    2222
    2323#include "material.h"
     
    4040  if( root)
    4141    this->loadParams(root);
     42
     43//   this->bBoard->setSize(this->size, this->size);
    4244}
    4345
     
    7779
    7880  //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);
    7987
    8088
     
    175183  Vector diff = camCoor - this->position;
    176184
     185
    177186  //glTranslatef(position.x + size/2, position.y + size/2, position.z);
    178187
     
    187196  this->material->select();
    188197
    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();
    197206
    198207
  • branches/blink/src/world_entities/effects/blink.h

    r10325 r10407  
    77
    88#include "world_entity.h"
    9 #include "color.h"
     9#include "effects/billboard.h"
    1010
    1111class Material;
    1212class TiXmlElement;
     13//class Billboard;
    1314
    1415class Blink : public WorldEntity
     
    2324
    2425    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); }
    2627    void setOmega(float w) { this->omega = w; }
    2728    void setColor(float r, float g, float b) { this->color = Vector(r, g, b); }
     
    3334  private:
    3435    Material*         material;
     36    Billboard*        bBoard;
    3537    Vector            position;
    3638    Vector            color;
Note: See TracChangeset for help on using the changeset viewer.