Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10003 in orxonox.OLD


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

hbolt rotates

Location:
branches/playability/src/world_entities
Files:
3 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 
  • branches/playability/src/world_entities/projectiles/hbolt.h

    r10001 r10003  
    3131
    3232    virtual void tick (float dt);
    33     virtual void draw (); //const;
     33    virtual void draw () const;
    3434
    3535    virtual void updateAngle(float time);
     
    4545    float                             angle;
    4646    float                             rotationSpeed;
    47     Vector                            axis;
    4847
    4948    WorldEntity* hitEntity; // FIXME TEMPORARY
  • branches/playability/src/world_entities/test_entity2.cc

    r9991 r10003  
    8787  this->rotationSpeed = 3;
    8888
    89   //this->material->setDiffuseMap("maps/torp2.png");
     89  this->material->setDiffuseMap("maps/torp2.png");
    9090}
    9191
     
    130130
    131131  glColor3f(0.0, 1.0, 0.0);
    132   glBindTexture( GL_TEXTURE_2D, 1 );
     132
     133  glBindTexture( GL_TEXTURE_2D, 0 );
     134
    133135  glBegin(GL_QUADS); // +X
    134136    glTexCoord2f (0.0, 0.0);
Note: See TracChangeset for help on using the changeset viewer.