Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

orxonox/trunk: better coloring

Location:
orxonox/trunk/src/lib/coord
Files:
2 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
  • orxonox/trunk/src/lib/coord/p_node.h

    r5007 r5008  
    116116
    117117  void debug (unsigned int depth = 1, unsigned int level = 0) const;
    118   void debugDraw(unsigned int depth = 1, float size = 1.0) const;
     118  void debugDraw(unsigned int depth = 1, float size = 1.0, Vector color = Vector(1,1,1)) const;
    119119
    120120
Note: See TracChangeset for help on using the changeset viewer.