Changeset 10091 in orxonox.OLD for branches/playability/src/util/track/track.cc
- Timestamp:
- Dec 18, 2006, 4:36:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/util/track/track.cc
r10088 r10091 26 26 #include "track/track.h" 27 27 28 #include "track/track_manager.h"29 28 #include "p_node.h" 30 29 … … 59 58 void Track::init() 60 59 { 61 // resetting all elements62 this->firstTrackElem = NULL;63 64 65 // make a debug track66 this->firstTrackElem = new TrackElement();67 this->firstTrackElem->ID = 1;68 this->firstTrackElem->setName("root");69 70 this->currentTrackElem = firstTrackElem;71 72 60 this->curveType = CURVE_BEZIER; 73 this->trackElemCount = 1; 74 61 this->startingTime = 0; 62 this->duration = 10; 63 this->endTime = 1; 64 this->width = 10; 65 this->curve = new BezierCurve(); 75 66 this->trackNode = new PNode(PNode::getNullParent(), PNODE_ALL); 76 67 } … … 81 72 Track::~Track() 82 73 { 83 if( this->firstTrackElem) 84 delete this->firstTrackElem; 74 85 75 } 86 76 … … 117 107 void Track::addPoint(Vector newPoint) 118 108 { 119 // if (this->currentTrackElem->isFresh) 120 // { 121 // this->setCurveType(CURVE_BEZIER, this->currentTrackElem); 122 // this->currentTrackElem->isFresh = false; 123 // } 124 // trackElem->curve->addNode(newPoint); 125 // trackElem->nodeCount++; 109 this->curve->addNode(newPoint); 110 this->nodeCount++; 126 111 } 127 112 … … 173 158 } 174 159 175 Vector Track Manager::calcPos() const176 { 177 return this->cur rentTrackElem->curve->calcPos((this->localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration);178 } 179 180 Vector Track Manager::calcDir() const181 { 182 return this->cur rentTrackElem->curve->calcDir((this->localTime - this->currentTrackElem->startingTime)/this->currentTrackElem->duration);160 Vector Track::calcPos() const 161 { 162 return this->curve->calcPos((this->localTime-this->startingTime)/this->duration); 163 } 164 165 Vector Track::calcDir() const 166 { 167 return this->curve->calcDir((this->localTime - this->startingTime)/this->duration); 183 168 } 184 169 … … 222 207 * @returns the main TrackNode 223 208 */ 224 PNode* Track Manager::getTrackNode()209 PNode* Track::getTrackNode() 225 210 { 226 211 return this->trackNode;
Note: See TracChangeset
for help on using the changeset viewer.