Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2006, 9:56:51 PM (18 years ago)
Author:
nicolasc
Message:

hbolt rotates

File:
1 edited

Legend:

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

    r10002 r10003  
    4646
    4747  this->angle = 0;
    48   this->rotationSpeed = 3;
    49   this->axis = Vector (0, 0, -1);
     48  this->rotationSpeed = 1000;
    5049
    5150  this->emitter = new DotEmitter(100, 5, M_2_PI);
     
    119118void HBolt::updateAngle (float time)
    120119{
    121   this->angle = this->angle + this->rotationSpeed * time / 1000;
     120  this->angle = this->angle + this->rotationSpeed * time;
    122121}
    123122
     
    158157
    159158
    160 void HBolt::draw () //const
     159void HBolt::draw () const
    161160{
    162   glPushAttrib(GL_ENABLE_BIT);
    163   glDisable(GL_LIGHTING);
    164161
    165162  glMatrixMode(GL_MODELVIEW);
     
    176173  //this->updateAngle();
    177174
    178   glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    179   glRotatef(this->angle, 0.0, 0.0, -1.0);
     175  //glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     176  //glRotatef(this->angle, 0.0, 0.0, -1.0);
     177  glTranslatef (this->getAbsCoor ().x,
     178                  this->getAbsCoor ().y,
     179                  this->getAbsCoor ().z);
     180  Vector tmpRot = this->getAbsDir().getSpacialAxis();
     181  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     182  glRotatef(this->angle, 0.0, 0.0, 1.0);
    180183  this->getModel()->draw();
    181   //WorldEntity::draw();
    182184  glPopMatrix();
    183   glPopAttrib();
    184185}
    185 
Note: See TracChangeset for help on using the changeset viewer.