Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5008 in orxonox.OLD for orxonox/trunk/src/lib/coord/p_node.cc


Ignore:
Timestamp:
Aug 14, 2005, 2:46:29 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better coloring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/coord/p_node.cc

    r5007 r5008  
    657657   displays the PNode at its position with its rotation as a cube.
    658658*/
    659 void PNode::debugDraw(unsigned int depth, float size) const
     659void PNode::debugDraw(unsigned int depth, float size, Vector color) const
    660660{
    661661  glMatrixMode(GL_MODELVIEW);
    662662  glPushMatrix();
     663  glDisable(GL_LIGHTING);
    663664
    664665  /* translate */
     
    671672
    672673  Vector tmpRot = this->getAbsDir().getSpacialAxis();
     674  glColor3f(color.x, color.y, color.z);
    673675  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    674676  {
     
    705707    tIterator<PNode>* iterator = this->children->getIterator();
    706708      //PNode* pn = this->children->enumerate ();
     709    Vector childColor =  color - Vector(.0,.3,.3);
    707710    PNode* pn = iterator->nextElement();
    708711    while( pn != NULL)
    709712    {
    710713      if (depth == 0)
    711         pn->debugDraw(0, size);
     714        pn->debugDraw(0, size, childColor);
    712715      else
    713         pn->debugDraw(depth - 1, size);
     716        pn->debugDraw(depth - 1, size, childColor);
    714717      pn = iterator->nextElement();
    715718    }
    716719    delete iterator;
    717720  }
     721  glEnable(GL_LIGHTING);
    718722}
    719723
Note: See TracChangeset for help on using the changeset viewer.