Last change
on this file since 3542 was
3028,
checked in by bensch, 20 years ago
|
orxonox/branches/bezierTrack: now Camera follows Path. heavy cleanUp of not used stuff like elyptical Camera and so on…
|
File size:
967 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 | float localTime; //!< if the time of one point is asked more than once the programm will not calculate it again. |
---|
21 | |
---|
22 | struct PathNode |
---|
23 | { |
---|
24 | int number; |
---|
25 | Vector position; |
---|
26 | PathNode* next; |
---|
27 | }; |
---|
28 | |
---|
29 | PathNode* firstNode; |
---|
30 | PathNode* currentNode; |
---|
31 | |
---|
32 | public: |
---|
33 | |
---|
34 | void addNode (const Vector& newNode); |
---|
35 | |
---|
36 | }; |
---|
37 | |
---|
38 | //! Bezier Curve |
---|
39 | /** |
---|
40 | Class to handle bezier curves in 3-dimesnsional space |
---|
41 | |
---|
42 | needed for the Tracking system in OrxOnoX. |
---|
43 | */ |
---|
44 | class BezierCurve : public Curve |
---|
45 | { |
---|
46 | private: |
---|
47 | // all from Curve-Class |
---|
48 | public: |
---|
49 | BezierCurve (void); |
---|
50 | ~BezierCurve (void); |
---|
51 | Vector calcPos (float t); |
---|
52 | Vector calcDir (float t); |
---|
53 | Quaternion calcQuat (float t); |
---|
54 | |
---|
55 | |
---|
56 | Vector getPos () const; |
---|
57 | }; |
---|
58 | |
---|
59 | int ncr(int n, int i); |
---|
60 | |
---|
61 | |
---|
62 | #endif /* _CURVE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.