Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3804 in orxonox.OLD


Ignore:
Timestamp:
Apr 13, 2005, 7:51:49 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: performance tweaking on PNode continiued: inlined all interface functions that are processed often (>100'000 times per game of 7sec.)

Location:
orxonox/trunk/src/lib/coord
Files:
2 edited

Legend:

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

    r3802 r3804  
    7272/**
    7373   \brief standard deconstructor
    74 
    75    \todo this deconstructor is not jet implemented - do it
    7674*/
    7775PNode::~PNode ()
    7876{
    79   /*
    80   delete &this->children;
    81   delete &this->relCoordinate;
    82   delete &this->absCoordinate;
    83   delete &this->relDirection;
    84   delete &this->absDirection;
    85   */
    86   //this->parent = NULL;
    87   /* there is currently a problem with cleaning up - fix*/
    88 
    89   PNode* pn = this->children->enumerate();
     77  tIterator<PNode>* iterator = this->children->getIterator();
     78  PNode* pn = iterator->nextElement();
    9079  while( pn != NULL)
    9180    {
    9281      delete pn;
    93       pn = this->children->nextElement();
    94 
    95     }
    96    
     82      pn = iterator->nextElement();
     83    }
     84  delete iterator;
    9785  /* this deletes all children in the list */
    9886  delete this->children;
    99 
     87  this->parent = NULL;
    10088  delete []this->objectName;
     89
     90  delete this->relCoordinate;
     91  delete this->absCoordinate;
     92  delete this->relDirection;
     93  delete this->absDirection;
     94  delete this->lastAbsCoordinate;
     95  delete this->diffCoordinate;
    10196}
    10297
     
    148143   change it unless you realy know what you are doing.
    149144*/
    150 Vector* PNode::getRelCoor () const
    151 {
    152   //Vector r = *this->relCoordinate; /* return a copy, so it can't be modified */
    153   return this->relCoordinate;
    154 }
     145//Vector* PNode::getRelCoor () const
     146
    155147
    156148
     
    189181   \returns absolute coordinates from (0,0,0)
    190182*/
    191 Vector PNode::getAbsCoor () const
    192 {
    193   return *this->absCoordinate;
    194 }
     183//Vector PNode::getAbsCoor () const
    195184
    196185
     
    300289   \returns relative direction to its parent
    301290*/
    302 Quaternion PNode::getRelDir () const
    303 {
    304   return *this->relDirection;
    305 }
     291//Quaternion* PNode::getRelDir () const
     292
    306293
    307294
     
    332319   \returns absolute coordinates
    333320*/
    334 Quaternion PNode::getAbsDir () const
    335 {
    336   return *this->absDirection;
    337 }
     321//Quaternion PNode::getAbsDir () const
     322
    338323
    339324
  • orxonox/trunk/src/lib/coord/p_node.h

    r3802 r3804  
    2323
    2424#include "base_object.h"
    25 //#include "vector.h"
     25#include "vector.h"
    2626
    2727// FORWARD DEFINITION \\
    2828class PNode; /* forward decleration, so that parentEntry has access to PNode */
    29 class Quaternion;
    30 class Vector;
     29//class Quaternion;
     30//class Vector;
    3131template<class T> class tList;
    3232
     
    5757
    5858
    59   Vector* getRelCoor () const;
     59  inline Vector* getRelCoor () const { return this->relCoordinate; }
    6060  void setRelCoor (Vector* relCoord);
    6161  void setRelCoor (Vector relCoord);
    62   Vector getAbsCoor () const;
     62  inline Vector getAbsCoor () const { return *this->absCoordinate; }
    6363  void setAbsCoor (Vector* absCoord);
    6464  void setAbsCoor (Vector absCoord);
     
    6767  //void shiftCoor (Vector shift);
    6868
    69   Quaternion getRelDir () const;
     69  inline Quaternion getRelDir () const { return *this->relDirection; }
    7070  void setRelDir (Quaternion* relDir);
    7171  void setRelDir (Quaternion relDir);
    72   Quaternion getAbsDir () const;
     72  inline Quaternion getAbsDir () const { return *this->absDirection; }
    7373  void setAbsDir (Quaternion* absDir);
    7474  void setAbsDir (Quaternion absDir);
Note: See TracChangeset for help on using the changeset viewer.