Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2006, 5:07:55 PM (18 years ago)
Author:
nicolasc
Message:

loads of tests, not really working

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

Legend:

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

    r9987 r9989  
    3939  this->registerObject(this, HBolt::_objectList);
    4040
    41   this->loadModel("models/projectiles/hbolt.obj");   //!< Model not yet in repo
     41  this->loadModel("models/projectiles/hbolt.obj");
    4242
    4343  this->setMinEnergy(10);
    4444  this->setHealthMax(0);
    4545  this->lifeSpan = 5.0;
     46
     47  this->angle = 0;
     48  this->rotationSpeed = 90;
    4649
    4750  this->emitter = new DotEmitter(100, 5, M_2_PI);
     
    112115}
    113116
     117
     118void HBolt::updateAngle ()
     119{
     120  this->angle = this->angle + this->rotationSpeed;
     121}
     122
     123
    114124/**
    115125 *  signal tick, time dependent things will be handled here
     
    125135    this->deactivate();
    126136
     137  //this->updateAngle();
    127138
    128139}
     
    141152
    142153
    143 void HBolt::draw () const
     154void HBolt::draw () //const
    144155{
     156
     157  glBegin(GL_TRIANGLES);
     158  this->getModel();
     159  glEnd();
     160
    145161  glPushAttrib(GL_ENABLE_BIT);
    146162  glDisable(GL_LIGHTING);
     
    149165  //glRotatef(30, 0.0f, 1.0f, 0.0f);
    150166
    151   WorldEntity::draw();
    152 /*  glMatrixMode(GL_MODELVIEW);
     167  //WorldEntity::draw();
     168  glMatrixMode(GL_MODELVIEW);
    153169  glPushMatrix();
    154170
    155   float matrix[4][4];
     171/*  float matrix[4][4];
    156172  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    157173  this->getAbsDir().matrix (matrix);
     
    161177  glPopMatrix();*/
    162178
    163 /*
     179  this->updateAngle();
    164180
    165181  float matrix[4][4];
     
    167183  this->getAbsDir().matrix (matrix);
    168184  glMultMatrixf((float*)matrix);
    169   glRotatef(30, 0.0, 1.0, 0.0);
    170   //glMultMatrixf((float*)matrix);
    171   this->getModel()->draw();*/
    172   //glPopMatrix();
     185  glScalef(4.0, 4.0, 4.0);
     186  glRotatef(this->getAngle(), 0.0, 1.0, 0.0);
     187  this->getModel()->draw();
     188  glPopMatrix();
    173189  glPopAttrib();
    174190}
  • branches/playability/src/world_entities/projectiles/hbolt.h

    r9979 r9989  
    3131
    3232    virtual void tick (float dt);
    33     virtual void draw () const;
     33    virtual void draw (); //const;
    3434
     35    virtual void updateAngle();
     36    inline float getAngle() { return this->angle; };
    3537
    3638  private:
     
    4143    ParticleEmitter*                  emitter;
    4244
     45    float                             angle;
     46    float                             rotationSpeed;
    4347
    4448    WorldEntity* hitEntity; // FIXME TEMPORARY
Note: See TracChangeset for help on using the changeset viewer.