Changeset 3588 in orxonox.OLD for orxonox/trunk/src/lib/math
- Timestamp:
- Mar 17, 2005, 2:47:16 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/math
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/math/curve.cc
r3473 r3588 28 28 #include <math.h> 29 29 #include <stdio.h> 30 31 32 /** 33 \brief default constructor for a Curve 34 */ 35 Curve::Curve(void) 36 { 37 nodeCount = 0; 38 firstNode = new PathNode; 39 currentNode = firstNode; 40 41 firstNode->position = Vector (.0, .0, .0); 42 firstNode->number = 0; 43 firstNode->next = 0; // not sure if this really points to NULL!! 44 } 30 45 31 46 /** … … 131 146 this->derivation = 0; 132 147 dirCurve = new BezierCurve(1); 133 this->init();134 148 } 135 149 … … 141 155 this->derivation = derivation; 142 156 dirCurve=NULL; 143 this->init();144 157 } 145 158 … … 161 174 if (dirCurve) 162 175 delete dirCurve; 163 }164 165 /**166 \brief Initializes a BezierCurve167 */168 void BezierCurve::init(void)169 {170 nodeCount = 0;171 firstNode = new PathNode;172 currentNode = firstNode;173 174 firstNode->position = Vector (.0, .0, .0);175 firstNode->number = 0;176 firstNode->next = 0; // not sure if this really points to NULL!!177 178 return;179 176 } 180 177 … … 297 294 { 298 295 this->derivation = 0; 299 this->init();300 296 } 301 297 … … 307 303 this->derivation = derivation; 308 304 dirCurve=NULL; 309 this->init();310 305 } 311 306 … … 327 322 if (dirCurve) 328 323 delete dirCurve; 329 }330 331 /**332 \brief Initializes a UPointCurve333 */334 void UPointCurve::init(void)335 {336 nodeCount = 0;337 firstNode = new PathNode;338 currentNode = firstNode;339 340 firstNode->position = Vector (.0, .0, .0);341 firstNode->number = 0;342 firstNode->next = 0; // not sure if this really points to NULL!!343 344 return;345 324 } 346 325 -
orxonox/trunk/src/lib/math/curve.h
r3473 r3588 38 38 PathNode* currentNode; //!< The node we are working with (the Last node). 39 39 40 40 41 private: 41 42 virtual void rebuild(void) = 0; 42 43 public: 44 Curve(void); 45 43 46 Curve* dirCurve; //!< The derivation-curve of this Curve. 44 47 void addNode(const Vector& newNode); … … 68 71 BezierCurve(void); 69 72 BezierCurve(int derivation); 70 ~BezierCurve(void); 71 void init(void); 73 virtual ~BezierCurve(void); 72 74 73 75 Vector calcPos(float t); … … 106 108 UPointCurve(int derivation); 107 109 ~UPointCurve(void); 108 void init(void);109 110 110 111 Vector calcPos(float t);
Note: See TracChangeset
for help on using the changeset viewer.