Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10297 in orxonox.OLD for branches/playability/src/lib


Ignore:
Timestamp:
Jan 20, 2007, 9:27:04 PM (17 years ago)
Author:
bknecht
Message:

track now works a bit can be partly used now

Location:
branches/playability/src/lib/math
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/lib/math/curve.cc

    r9110 r10297  
    142142    tmpNode = tmpNode->next;
    143143  return tmpNode->position;
     144}
     145
     146/**
     147 * This function returns an approximation of the length of the curve
     148 *
     149*/
     150float Curve::getLength()
     151{
     152      float length = 0;
     153      PathNode* tmpNode = this->firstNode;
     154      for(int i = 1; i < this->nodeCount; i++)
     155      {
     156              length += Vector(tmpNode->next->position - tmpNode->position).len();
     157      }
     158      return length;
    144159}
    145160
  • branches/playability/src/lib/math/curve.h

    r6616 r10297  
    4747  /** @returns the directional Curve */
    4848  Curve* getDirCurve() const { return this->dirCurve; };
     49  float getLength();
    4950
    5051  /** @param t the value on the curve [0-1] @returns Vector to the position */
Note: See TracChangeset for help on using the changeset viewer.