Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Mar 15, 2005, 12:21:28 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: nicer constructor

File:
1 edited

Legend:

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

    r3552 r3554  
    4848PNode::PNode (Vector* absCoordinate, PNode* parent )
    4949{
     50  this->init(parent);
     51
    5052  this->absCoordinate = *absCoordinate;
    51   this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
    52  
    53   this->init(parent);
    54 
    55   parent->addChild (this);
    56 }
    57 
    58 
    59 /**
    60    \brief this constructor is very special.
    61    \param with the name of the class
    62 
    63    this constuctor exists, because there was a little issue with a
    64    PNode<->NullPointer relation. It is crutial, that this construcor
    65    exists, and is never used except from the NullParent itself. If you
    66    delete it, there will probably be a endless loop, because in the
    67    default constcutor of PNode NullPointer is generated, and NullPointer
    68    gerenates itself again and again...
    69    dont't think about it...
    70    \todo patrick think about this one here...
    71 */
    72 PNode::PNode(char* name)
    73 {
    74   this->init(NULL);
     53  if (parent != NULL)
     54    {
     55      this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
     56      parent->addChild (this);
     57    }
     58  else
     59    this->relCoordinate = Vector(0,0,0);
    7560}
    7661
Note: See TracChangeset for help on using the changeset viewer.