Last change
on this file since 3019 was
3019,
checked in by bensch, 19 years ago
|
orxonox/branches/bezierTrack: added Class Curve, and made BezierCurve derived from it
|
File size:
832 bytes
|
Line | |
---|
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 | |
---|
15 | class Curve |
---|
16 | { |
---|
17 | protected: |
---|
18 | int nodeCount; |
---|
19 | Vector curvePoint; |
---|
20 | |
---|
21 | struct PathNode |
---|
22 | { |
---|
23 | int number; |
---|
24 | Vector position; |
---|
25 | PathNode* next; |
---|
26 | }; |
---|
27 | |
---|
28 | PathNode* firstNode; |
---|
29 | PathNode* currentNode; |
---|
30 | |
---|
31 | public: |
---|
32 | |
---|
33 | void addNode (const Vector& newNode); |
---|
34 | |
---|
35 | }; |
---|
36 | |
---|
37 | //! Bezier Curve |
---|
38 | /** |
---|
39 | Class to handle bezier curves in 3-dimesnsional space |
---|
40 | |
---|
41 | needed for the Tracking system in OrxOnoX. |
---|
42 | */ |
---|
43 | class BezierCurve : public Curve |
---|
44 | { |
---|
45 | private: |
---|
46 | // all from Curve-Class |
---|
47 | public: |
---|
48 | BezierCurve (void); |
---|
49 | ~BezierCurve (void); |
---|
50 | virtual Vector calcPos (float t); |
---|
51 | virtual Vector calcDir (float t); |
---|
52 | |
---|
53 | Vector getPos () const; |
---|
54 | }; |
---|
55 | |
---|
56 | int ncr(int n, int i); |
---|
57 | |
---|
58 | |
---|
59 | #endif /* _CURVE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.