Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5007 in orxonox.OLD for orxonox/trunk/src


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

orxonox/trunk: better method to display PNodes

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

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

    r5006 r5007  
    559559      PRINTF(5)("PNode::update - %s - (%f, %f, %f)\n", this->getName(), this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
    560560
     561
     562      if( this->parentMode & PNODE_LOCAL_ROTATE && this->bRelDirChanged)
     563      {
     564        /* update the current absDirection - remember * means rotation around sth.*/
     565        this->absDirection = this->relDirection * parent->getAbsDir();;
     566      }
     567
    561568      if(likely(this->parentMode & PNODE_MOVEMENT))
    562569      {
     
    564571        this->absCoordinate = this->parent->getAbsCoor() + this->relCoordinate;
    565572      }
    566 
    567       if( this->parentMode & PNODE_LOCAL_ROTATE && this->bRelDirChanged)
    568       {
    569         /* update the current absDirection - remember * means rotation around sth.*/
    570         this->absDirection = this->relDirection * parent->getAbsDir();;
    571       }
    572 
    573       if( this->parentMode & PNODE_ROTATE_MOVEMENT)
     573      else if( this->parentMode & PNODE_ROTATE_MOVEMENT)
    574574      {
    575575        /* update the current absCoordinate */
     
    657657   displays the PNode at its position with its rotation as a cube.
    658658*/
    659 void PNode::debugDraw(float size) const
     659void PNode::debugDraw(unsigned int depth, float size) const
    660660{
    661661  glMatrixMode(GL_MODELVIEW);
     
    701701
    702702  glPopMatrix();
     703  if (depth >= 2 || depth == 0)
     704  {
     705    tIterator<PNode>* iterator = this->children->getIterator();
     706      //PNode* pn = this->children->enumerate ();
     707    PNode* pn = iterator->nextElement();
     708    while( pn != NULL)
     709    {
     710      if (depth == 0)
     711        pn->debugDraw(0, size);
     712      else
     713        pn->debugDraw(depth - 1, size);
     714      pn = iterator->nextElement();
     715    }
     716    delete iterator;
     717  }
    703718}
    704719
  • orxonox/trunk/src/lib/coord/p_node.h

    r5006 r5007  
    116116
    117117  void debug (unsigned int depth = 1, unsigned int level = 0) const;
    118   void debugDraw(float size = 1.0) const;
     118  void debugDraw(unsigned int depth = 1, float size = 1.0) const;
    119119
    120120
  • orxonox/trunk/src/world_entities/camera.cc

    r5005 r5007  
    144144       this->softReparent("Player");
    145145       this->target->softReparent("Player");
    146        this->setRelCoorSoft(4, 0, 0);
    147        this->target->setRelCoorSoft(10,0,0);
     146       this->setRelCoorSoft(4, 0, 0, 5);
     147       this->target->setRelCoorSoft(Vector(10,0,0), 5);
    148148//      this->target->setRelDirSoft(Quaternion(M_PI/4.0, Vector(0,1,0)));
    149149      break;
     
    192192void Camera::apply ()
    193193{
    194   this->target->debugDraw(2);
     194  this->target->getParent()->debugDraw(0, 2);
    195195  // switching to Projection Matrix
    196196  glMatrixMode (GL_PROJECTION);
Note: See TracChangeset for help on using the changeset viewer.