Last change
on this file since 3018 was
3018,
checked in by bensch, 21 years ago
|
orxonox/branches/bezierTrack: moved Curve to its own file. I expect this class to be bigger than I thought at the beginning:
- Class Curve and its subclasses:
a) BezierCurve
b) closedBezierCurve
c) Nurbs
d) any other curve that might occure
this will take some time and many hours of thinking so please help
|
File size:
738 bytes
|
Rev | Line | |
---|
[3018] | 1 | /*! |
---|
| 2 | \file curve.h |
---|
| 3 | \brief A basic 3D curve framework |
---|
| 4 | |
---|
| 5 | Contains classes to handle curves |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #ifndef _CURVE_H |
---|
| 9 | #define _CURVE_H |
---|
| 10 | |
---|
| 11 | #include "vector.h" |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | //! Bezier Curve |
---|
| 15 | /** |
---|
| 16 | Class to handle bezier curves in 3-dimesnsional space |
---|
| 17 | |
---|
| 18 | needed for the Tracking system in OrxOnoX. |
---|
| 19 | */ |
---|
| 20 | class BezierCurve |
---|
| 21 | { |
---|
| 22 | private: |
---|
| 23 | int nodeCount; |
---|
| 24 | Vector curvePoint; |
---|
| 25 | |
---|
| 26 | struct PathNode |
---|
| 27 | { |
---|
| 28 | int number; |
---|
| 29 | Vector position; |
---|
| 30 | PathNode* next; |
---|
| 31 | }; |
---|
| 32 | |
---|
| 33 | PathNode* firstNode; |
---|
| 34 | PathNode* currentNode; |
---|
| 35 | |
---|
| 36 | int ncr(int n, int i); |
---|
| 37 | |
---|
| 38 | public: |
---|
| 39 | BezierCurve (void); |
---|
| 40 | ~BezierCurve (void); |
---|
| 41 | void addNode (const Vector& newNode); |
---|
| 42 | Vector calcPos (float t); |
---|
| 43 | Vector calcDir (float t); |
---|
| 44 | |
---|
| 45 | Vector getPos () const; |
---|
| 46 | }; |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | #endif /* _CURVE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.