Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6004 in orxonox.OLD for trunk/src/world_entities/npcs/npc_test.cc


Ignore:
Timestamp:
Dec 9, 2005, 11:12:04 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: new algorithm to rotate entities for drawing works (shifcoor ONLY takes normalized Vectors…)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/npcs/npc_test.cc

    r5750 r6004  
    3333NPC2::NPC2()
    3434{
    35   this->setClassID(CL_NPC, "NPC");
     35  this->setClassID(CL_NPC_TEST2, "NPC2");
    3636
    3737  if ((float)rand()/RAND_MAX > .5f)
     
    8383void NPC2::draw() const
    8484{
    85   glMatrixMode(GL_MODELVIEW);
    86   glPushMatrix();
    87   float matrix[4][4];
    88 
    89   /* translate */
    90   glTranslatef (this->getAbsCoor ().x,
    91                 this->getAbsCoor ().y,
    92                 this->getAbsCoor ().z);
    93   /* rotate */
    94   this->getAbsDir ().matrix (matrix);
    95   glMultMatrixf((float*)matrix);
    96 
    97   if (this->shader != NULL && this->shader != Shader::getActiveShader())
    98     shader->activateShader();
    99   gluSphere(this->obj, 3, 10, 10);
    100   shader->deactivateShader();
    101 
    102 
    103 /*  if (this->model)
    104     this->model->draw();*/
    105   glPopMatrix();
     85//   glMatrixMode(GL_MODELVIEW);
     86//   glPushMatrix();
     87//   float matrix[4][4];
     88//
     89//   /* translate */
     90//   glTranslatef (this->getAbsCoor ().x,
     91//                 this->getAbsCoor ().y,
     92//                 this->getAbsCoor ().z);
     93//   /* rotate */
     94//   this->getAbsDir ().matrix (matrix);
     95//   glMultMatrixf((float*)matrix);
     96//
     97//   if (this->shader != NULL && this->shader != Shader::getActiveShader())
     98//     shader->activateShader();
     99//   gluSphere(this->obj, 3, 10, 10);
     100//   shader->deactivateShader();
     101//
     102//
     103// /*  if (this->model)
     104//     this->model->draw();*/
     105//   glPopMatrix();
    106106}
    107107
Note: See TracChangeset for help on using the changeset viewer.