Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10063 in orxonox.OLD for branches/playability/src


Ignore:
Timestamp:
Dec 13, 2006, 3:16:03 PM (18 years ago)
Author:
nicolasc
Message:

halo effects

Location:
branches/playability/src/world_entities/projectiles
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/projectiles/hbolt.cc

    r10049 r10063  
    2828
    2929#include "static_model.h"
     30#include "effects/billboard.h"
    3031
    3132
     
    4142  this->registerObject(this, HBolt::_objectList);
    4243
    43   this->loadModel("models/projectiles/hbolt.obj");
     44  this->loadModel("models/projectiles/hbolt.obj",1.3);
    4445
    4546  this->setMinEnergy(10);
     
    5758
    5859  this->mat = new Material("hBolt_halo");
    59   //this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
    60   this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE);
     60  this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
     61  //this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE);
    6162  this->mat->setDiffuse(1,1,1);
     63  this->mat->setAmbient(1,1,1);
     64  this->mat->setIllum(3);
    6265  this->mat->setDiffuseMap("hbolt_halo.png");
    63 //   this->mat->setDiffuseMap("hbolt.png",1);
     66//   this->mat->setDiffuseMap("hbolt_halo.png",1);
    6467//   this->mat->setDiffuseMap("hbolt_halo.png",2);
    65   dynamic_cast<StaticModel*>(this->getModel())->addMaterial(this->mat);
    66   dynamic_cast<StaticModel*>(this->getModel())->finalize();
    67   this->mat->select();
     68//   dynamic_cast<StaticModel*>(this->getModel())->addMaterial(this->mat);
     69//   dynamic_cast<StaticModel*>(this->getModel())->finalize();
     70
     71  this->halo = new Billboard();
     72  this->halo->setSize(.65, .65);
     73  this->halo->setTexture("hbolt_halo2.png");
    6874
    6975}
     
    181187                  this->getAbsCoor ().y,
    182188                  this->getAbsCoor ().z);
     189
     190//   glPushMatrix();
     191//     glEnable(GL_BLEND);
     192//     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     193//     glShadeModel(GL_FLAT);
     194//     glClearColor(0.0, 0.0, 0.0, 0.0);
     195//
     196//     glEnable(GL_TEXTURE_2D);
     197//     this->mat->select();
     198//
     199// //     Vector camera = State::getCamera()->getViewVector();
     200//
     201//     glBegin(GL_QUADS); // +X
     202//       glTexCoord2f (0.0, 0.0);
     203//       glVertex3f( 0.0f, -.7f, -.7f);
     204//
     205//       glTexCoord2f (0.0, 1.0);
     206//       glVertex3f( 0.0f, -.7f , .7f);
     207//
     208//       glTexCoord2f (1.0, 1.0);
     209//       glVertex3f( 0.0, .7f , .7f );
     210//
     211//       glTexCoord2f (1.0, 0.0);
     212//       glVertex3f( 0.0, .7f, -.7f );
     213//     glEnd();
     214//   glPopMatrix();
     215
     216//   this->billboard->toggleBillboard();
     217
     218  this->halo->draw();
     219
    183220  Vector tmpRot = this->getAbsDir().getSpacialAxis();
    184221  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    185222  glRotatef(this->angle, 0.0, 0.0, 1.0);
    186223
    187   this->getModel()->draw();
    188 
    189   this->mat->select();
    190   dynamic_cast<StaticModel*>(this->getModel())->draw();
     224//   this->getModel()->draw();
     225
     226//   this->mat->select();
     227   dynamic_cast<StaticModel*>(this->getModel())->draw();
    191228//   this->mat->select();
    192229//   dynamic_cast<StaticModel*>(this->getModel())->draw();
    193   this->mat->unselect();
     230//   this->mat->unselect();
    194231
    195232
  • branches/playability/src/world_entities/projectiles/hbolt.h

    r10047 r10063  
    88
    99#include "projectile.h"
     10#include "effects/billboard.h"
    1011
    1112class Vector;
     
    4849    float                             rotationSpeed;
    4950
     51    Billboard*                        halo;
     52
    5053    WorldEntity* hitEntity; // FIXME TEMPORARY
    5154};
  • branches/playability/src/world_entities/projectiles/lbolt.cc

    r10046 r10063  
    5959
    6060  this->mat = new Material("lBolt");
    61   //this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
    62   this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE);
     61  this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
     62  //this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE);
    6363  this->mat->setDiffuse(1,1,1);
    64   this->mat->setDiffuseMap("lbolt.png");
    65   this->mat->setDiffuseMap("lbolt.png",1);
     64  this->mat->setIllum(3);
     65  this->mat->setDiffuseMap("maps/lbolt2.png");
     66  this->mat->setDiffuseMap("maps/lbolt2.png",1);
    6667  dynamic_cast<StaticModel*>(this->getModel())->addMaterial(this->mat);
    6768  dynamic_cast<StaticModel*>(this->getModel())->finalize();
     69  this->mat->select();
     70
     71  this->halo = new Billboard();
     72  this->halo->setSize(.5, .5);
     73  this->halo->setTexture("hbolt_halo.png");
    6874}
    6975
     
    167173  float matrix[4][4];
    168174  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     175
    169176  glRotatef(angle, 1.0, 0.0, 0.0);
    170177  this->getAbsDir().matrix (matrix);
    171178  glMultMatrixf((float*)matrix);
    172   //this->getModel()->draw();
     179  this->getModel()->draw();
    173180
    174   this->mat->select();
    175   dynamic_cast<StaticModel*>(this->getModel())->draw();
    176   this->mat->select();
    177   dynamic_cast<StaticModel*>(this->getModel())->draw();
    178   this->mat->unselect();
    179   this->mat->unselect();
     181  this->halo->draw();
     182
     183//   this->mat->select();
     184//   dynamic_cast<StaticModel*>(this->getModel())->draw();
     185//   this->mat->select();
     186//   dynamic_cast<StaticModel*>(this->getModel())->draw();
     187//   this->mat->unselect();
     188//   this->mat->unselect();
    180189  glPopMatrix();
    181190
  • branches/playability/src/world_entities/projectiles/lbolt.h

    r10044 r10063  
    88
    99#include "projectile.h"
     10#include "effects/billboard.h"
    1011
    1112class Vector;
     
    4647    Material*                         mat;
    4748
     49    Billboard*                        halo;
     50
    4851    WorldEntity* hitEntity; // FIXME TEMPORARY
    4952};
Note: See TracChangeset for help on using the changeset viewer.