Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 24, 2005, 11:18:39 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: sync

File:
1 edited

Legend:

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

    r5671 r5769  
    496496  if (child != NULL)
    497497  {
    498    child->remove();
     498   child->removeNode();
    499499//   this->children->remove(child);
    500500//   child->parent = NULL;
     
    507507 * this can be the case, if an entity in the world is being destroyed.
    508508 */
    509 void PNode::remove()
     509void PNode::removeNode()
    510510{
    511511  tIterator<PNode>* iterator = this->children->getIterator();
     
    513513
    514514  while( pn != NULL)
    515     {
     515  {
    516516      NullParent::getInstance()->addChild(pn);
    517517      pn = iterator->nextElement();
     
    609609 * worry, normaly...
    610610 */
    611 void PNode::update (float dt)
     611void PNode::updateNode (float dt)
    612612{
    613613  if( likely(this->parent != NULL))
     
    698698          pn->parentDirChanged ();
    699699
    700         pn->update(dt);
     700        pn->updateNode(dt);
    701701        pn = iterator->nextElement();
    702702      }
     
    708708}
    709709
     710
     711void PNode::countChildNodes(int& nodes) const
     712{
     713  nodes++;
     714  tIterator<PNode>* it = this->children->getIterator();
     715  PNode* node = it->firstElement();
     716  while(node != NULL)
     717  {
     718    node->countChildNodes(nodes);
     719    node = it->nextElement();
     720  }
     721
     722}
     723
     724
    710725/**
    711726 *  displays some information about this pNode
     
    714729 * @param level !! INTERNAL !! The n-th level of the Node we draw (this is internal and only for nice output).
    715730 */
    716 void PNode::debug(unsigned int depth, unsigned int level) const
     731void PNode::debugNode(unsigned int depth, unsigned int level) const
    717732{
    718733  for (unsigned int i = 0; i < level; i++)
     
    722737  else
    723738    PRINT(0)(" -");
    724   PRINT(0)("PNode(%s::%s) - absCoord: (%0.2f, %0.2f, %0.2f), relCoord(%0.2f, %0.2f, %0.2f), direction(%0.2f, %0.2f, %0.2f) - %s\n",
     739
     740  int childNodeCount = 0;
     741  this->countChildNodes(childNodeCount);
     742
     743  PRINT(0)("PNode(%s::%s) - absCoord: (%0.2f, %0.2f, %0.2f), relCoord(%0.2f, %0.2f, %0.2f), direction(%0.2f, %0.2f, %0.2f) - %s - %d childs\n",
    725744           this->getClassName(),
    726745           this->getName(),
     
    734753           this->getAbsDirV().y,
    735754           this->getAbsDirV().z,
    736            this->parentingModeToChar(parentMode));
     755           this->parentingModeToChar(parentMode),
     756           childNodeCount);
    737757  if (depth >= 2 || depth == 0)
    738758  {
     
    743763    {
    744764      if (depth == 0)
    745         pn->debug(0, level + 1);
     765        pn->debugNode(0, level + 1);
    746766      else
    747         pn->debug(depth - 1, level +1);
     767        pn->debugNode(depth - 1, level +1);
    748768      pn = iterator->nextElement();
    749769    }
Note: See TracChangeset for help on using the changeset viewer.