source:
orxonox.OLD/orxonox/branches/bezierTrack/src/curve.h
@
3019
Last change on this file since 3019 was 3019, checked in by bensch, 21 years ago | |
---|---|
File size: 832 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 | ||
[3019] | 14 | |
15 | class Curve | |
[3018] | 16 | { |
[3019] | 17 | protected: |
[3018] | 18 | int nodeCount; |
19 | Vector curvePoint; | |
[3019] | 20 | |
[3018] | 21 | struct PathNode |
22 | { | |
23 | int number; | |
24 | Vector position; | |
25 | PathNode* next; | |
26 | }; | |
27 | ||
28 | PathNode* firstNode; | |
29 | PathNode* currentNode; | |
30 | ||
[3019] | 31 | public: |
[3018] | 32 | |
[3019] | 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 | |
[3018] | 47 | public: |
48 | BezierCurve (void); | |
49 | ~BezierCurve (void); | |
[3019] | 50 | virtual Vector calcPos (float t); |
51 | virtual Vector calcDir (float t); | |
[3018] | 52 | |
53 | Vector getPos () const; | |
54 | }; | |
55 | ||
[3019] | 56 | int ncr(int n, int i); |
[3018] | 57 | |
58 | ||
59 | #endif /* _CURVE_H */ |
Note: See TracBrowser
for help on using the repository browser.