Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3248 in orxonox.OLD for orxonox/branches/parenting/src/p_node.cc


Ignore:
Timestamp:
Dec 22, 2004, 3:28:14 PM (19 years ago)
Author:
patrick
Message:

orxonox/branches/parenting: defined all function/variables now will have to implement them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/p_node.cc

    r3247 r3248  
    2828   \todo this constructor is not jet implemented - do it
    2929*/
    30 PNode::PNode () {}
     30PNode::PNode ()
     31{
     32  this->children = new tList<PNode>();
     33}
    3134
    3235
     
    3639   \todo this deconstructor is not jet implemented - do it
    3740*/
    38 PNode::~PNode () {}
     41PNode::~PNode ()
     42{
     43  this->children->destroy();
     44  delete this->children;
     45}
    3946
    4047
     
    4451*/
    4552Vector PNode::getRelCoor ()
    46 {}
     53{
     54  Vector r = this->relCoordinate; /* return a copy, so it can't be modified */
     55  return r;
     56}
    4757
    4858
     
    8090
    8191/**
     92   \brief shift coordinate (abs and rel)
     93   \param shift vector
     94
     95   this function shifts the current coordinates about the vector shift. this is
     96   usefull because from some place else you can:
     97   PNode* someNode = ...;
     98   Vector objectMovement = calculateShift();
     99   someNode->shiftCoor(objectMovement);
     100
     101   elsewhere you would have to:
     102   PNode* someNode = ...;
     103   Vector objectMovement = calculateShift();
     104   Vector currentCoor = someNode->getRelCoor();
     105   Vector newCoor = currentCoor + objectMovement;
     106   someNode->setRelCoor(newCoor);
     107   
     108   yea right... shorter...
     109
     110*/
     111void PNode::shiftCoor (Vector shift)
     112{}
     113
     114
     115
     116/**
    82117   \brief get relative direction
    83118   \returns relative direction to its parent
     
    120155
    121156/**
     157   \brief shift coordinate (abs and rel)
     158   \param shift vector
     159
     160   this function shifts the current coordinates about the vector shift. this is
     161   usefull because from some place else you can:
     162   PNode* someNode = ...;
     163   Quaternion objectMovement = calculateShift();
     164   someNode->shiftCoor(objectMovement);
     165
     166   elsewhere you would have to:
     167   PNode* someNode = ...;
     168   Quaternion objectMovement = calculateShift();
     169   Quaternion currentCoor = someNode->getRelCoor();
     170   Quaternion newCoor = currentCoor + objectMovement;
     171   someNode->setRelCoor(newCoor);
     172   
     173   yea right... shorter...
     174
     175*/
     176void PNode::shiftDir (Quaternion shift)
     177{}
     178
     179
     180
     181/**
    122182   \brief adds a child and makes this node to a parent
    123183   \param child reference
     
    126186*/
    127187void PNode::addChild (PNode* pNode)
    128 {}
    129 
    130 
     188{
     189  this->addChild(pNode, DEFAULT_MODE);
     190}
     191
     192
     193/**
     194   \brief adds a child and makes this node to a parent
     195   \param child reference
     196   \param on which changes the child should also change ist state
     197
     198   use this to add a child to this node.
     199*/
     200void PNode::addChild (PNode* pNode, parentingMode mode)
     201{
     202  pNode->mode = mode;
     203  this->children->add (pNode);
     204}
     205
     206
     207/**
     208   /brief removes a child from the node
     209*/
    131210void PNode::removeChild (PNode* pNode)
    132 {}
    133 
    134 
     211{
     212  this->children->remove (pNode);
     213}
     214
     215
     216/**
     217   \brief sets the parent of this PNode
     218*/
    135219void PNode::setParent (PNode* parent)
    136 {}
    137 
     220{
     221  this->parent = parent;
     222}
     223
     224
     225/**
     226   \brief updates the absCoordinate/absDirection
     227
     228   this is used to go through the parent-tree to update all the absolute coordinates
     229   and directions. this update should be done by the engine, so you don't have to
     230   worry, normaly...
     231*/
     232void PNode::update()
     233{
     234 
     235}
     236
Note: See TracChangeset for help on using the changeset viewer.