Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5232 in orxonox.OLD for trunk/src/lib/math/curve.cc


Ignore:
Timestamp:
Sep 24, 2005, 12:37:39 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: solved a memory leak in the QuadtreeNode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/math/curve.cc

    r5231 r5232  
    6464  if (dirCurve)
    6565    delete dirCurve;
    66 
    6766}
    6867
     
    203202
    204203  // rebuilding the Curve itself
    205   float k=0;
     204  float k = 0;
    206205  float n = nodeCount -1;
    207206  float binCoef = 1;
    208   while(tmpNode)
     207  while( tmpNode)
    209208    {
    210209      tmpNode->factor = binCoef;
    211       if (tmpNode =tmpNode->next)
     210      if( tmpNode = tmpNode->next)
    212211        {
    213           binCoef *=(n-k)/(k+1);
     212          binCoef *= (n-k) / (k+1);
    214213          ++k;
    215214        }
     
    217216
    218217  // rebuilding the Derivation curve
    219   if(this->derivation <= 1)
     218  if( this->derivation <= 1)
    220219    {
    221220      tmpNode = firstNode;
    222221      delete dirCurve;
    223222      dirCurve = new BezierCurve(1);
    224       while(tmpNode->next)
     223      while( tmpNode->next)
    225224        {
    226           Vector tmpVector = (tmpNode->next->position)- (tmpNode->position);
     225          Vector tmpVector = (tmpNode->next->position) - (tmpNode->position);
    227226          tmpVector.x*=(float)nodeCount;
    228227          tmpVector.y*=(float)nodeCount;
Note: See TracChangeset for help on using the changeset viewer.