Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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
Files:
4 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
  • branches/playability/src/world_entities/test_entity2.cc

    r9987 r9989  
    8484  this->material->setAmbient(1.0, 0.0, 1.0);
    8585
     86  this->angle = 0;
     87  this->rotationSpeed = 10;
     88
    8689  //this->material->setDiffuseMap("maps/torp2.png");
    8790}
     
    9598{
    9699  WorldEntity::loadParams(root);
     100}
     101
     102
     103void TestEntity2::updateAngle()
     104{
     105  this->angle = this->angle + this->rotationSpeed;
    97106}
    98107
     
    231240  glEnd();
    232241
     242  //this->angle += this->rotationSpeed;
     243  glRotatef(this->angle, 0.0, 1.0, 0.0);
     244
    233245  glPopMatrix();
    234246  glPopAttrib();
     
    245257  this->setParent(pl);
    246258
    247 }
    248 
    249 
    250 
    251 
    252 
    253 
     259  this->updateAngle();
     260}
     261
     262
     263
     264
     265
     266
  • branches/playability/src/world_entities/test_entity2.h

    r9974 r9989  
    2424
    2525  private:
     26    virtual void updateAngle();
     27
    2628    Material*       material;
     29    float           angle;
     30    float           rotationSpeed;
    2731};
    2832
Note: See TracChangeset for help on using the changeset viewer.