Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10635 in orxonox.OLD for branches/vs-enhencements/src


Ignore:
Timestamp:
Apr 19, 2007, 1:13:11 PM (18 years ago)
Author:
nicolasc
Message:

pulse grid update, drawing corrections

Location:
branches/vs-enhencements/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/vs-enhencements/src/world_entities/effects/billboard.cc

    r10633 r10635  
    1111### File Specific:
    1212   main-programmer: David Hasenfratz
     13   co-programmer: Nicolas Schlumberger
    1314*/
    1415
     
    7374  this->bPulse = false;
    7475
    75   this->angularSpeed = M_PI; //180;
     76  this->angularSpeed = M_2_PI; //360;
    7677  this->angle = 0;
    7778
     
    122123{
    123124  this->angle += dt * this->angularSpeed;
    124   if (this->angle > 2 * M_PI)
    125     this->angle -= 2 * M_PI;
     125  if (this->angle > M_2_PI)
     126    this->angle -= M_2_PI;
    126127}
    127128
     
    158159  float tmp = 1;
    159160  if (this->bPulse)
    160     tmp = 1 + this->pulseMagnitude * updatePulse(this->angle);
     161    tmp += this->pulseMagnitude * updatePulse(this->angle);
    161162
    162163  v *= sizeX * tmp;
  • branches/vs-enhencements/src/world_entities/effects/billboard.h

    r10633 r10635  
    3131    inline float getPulse () { return this->bPulse; };
    3232
     33    inline void setPulseMagnitude(float mag) {this->pulseMagnitude = mag; };
     34
    3335    virtual void tick(float dt);
    3436    virtual void draw() const;
  • branches/vs-enhencements/src/world_entities/projectiles/lbolt.cc

    r10618 r10635  
    6565  this->halo->setVisibility(false);
    6666
     67  this->halo->setPulse();
    6768
    6869}
     
    148149
    149150  angle += LBolt::rotationSpeed * dt;
     151  if(angle > 360)
     152    angle -= 360;
    150153
    151154  for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
     
    183186    float matrix[4][4];
    184187    glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    185     Vector tmpRot = this->getAbsDir().getSpacialAxis();
     188    this->halo->draw();
     189
     190    Vector tmpRot;
     191    tmpRot = this->flightDirection.getNormalized();
     192    glRotatef(this->angle, tmpRot.x, tmpRot.y, tmpRot.z);
     193    tmpRot = this->getAbsDir().getSpacialAxis();
    186194    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    187     glRotatef(this->angle, 1.0, 0.0, 0.0);
     195
    188196    this->getAbsDir().matrix (matrix);
    189197    glMultMatrixf((float*)matrix);
    190198    this->getModel()->draw();
    191199
    192     this->halo->draw();
    193 
    194200  glPopMatrix();
    195201  glPopAttrib();
  • branches/vs-enhencements/src/world_entities/projectiles/mbolt.cc

    r10618 r10635  
    212212  float matrix[4][4];
    213213  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    214   glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile
     214//   glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile
     215  glRotatef(this->angle, this->flightDirection.x, this->flightDirection.y, this->flightDirection.z);
    215216  this->getAbsDir().matrix (matrix);
    216217  glMultMatrixf((float*)matrix);
Note: See TracChangeset for help on using the changeset viewer.