Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4998 in orxonox.OLD for orxonox/trunk/src/world_entities/player.cc


Ignore:
Timestamp:
Aug 13, 2005, 7:19:51 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more optimizations of the Quaternion Class.
Now the 3D-rotation is much faster through this code:

Vector tmpRot = this→getAbsDir().getSpacialAxis();
glRotatef (this→getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );

instead of the old Matrix-approach. furthermore glRotate is optimized much better in openGL as is clearly stated in the red book

also implemented some other really useless functions for Quaternion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/player.cc

    r4997 r4998  
    222222  glMatrixMode(GL_MODELVIEW);
    223223  glPushMatrix();
    224   float matrix[4][4];
    225 
    226224  /* translate */
    227225  glTranslatef (this->getAbsCoor ().x,
     
    229227                this->getAbsCoor ().z);
    230228  /* rotate */
    231   this->getAbsDir ().matrix (matrix);
    232   glMultMatrixf((float*)matrix);
    233 
     229  Vector tmpRot = this->getAbsDir().getSpacialAxis();
     230  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    234231  this->model->draw();
    235232  glPopMatrix();
Note: See TracChangeset for help on using the changeset viewer.