Last change
on this file since 3314 was
3311,
checked in by patrick, 20 years ago
|
oroxnox/branches/parenting: implemented helperParent and made some tests with the opengl nurbs lib
|
File size:
1.4 KB
|
Line | |
---|
1 | |
---|
2 | /*! |
---|
3 | \file curve.h |
---|
4 | \brief A basic 3D curve framework |
---|
5 | |
---|
6 | Contains classes to handle curves |
---|
7 | */ |
---|
8 | |
---|
9 | #ifndef _CURVE_H |
---|
10 | #define _CURVE_H |
---|
11 | |
---|
12 | #include "vector.h" |
---|
13 | |
---|
14 | |
---|
15 | //! An abstract class to handle curves. |
---|
16 | class Curve |
---|
17 | { |
---|
18 | protected: |
---|
19 | int nodeCount; //!< The count of nodes the Curve has. |
---|
20 | Vector curvePoint; //!< The point on the Cureve at a local Time. |
---|
21 | float localTime; //!< If the time of one point is asked more than once the programm will not calculate it again. |
---|
22 | |
---|
23 | //! Handles the curve-points (dynamic List) |
---|
24 | struct PathNode |
---|
25 | { |
---|
26 | int number; //!< The N-th node of this curve. |
---|
27 | Vector position; //!< Vector Pointung to this curve-point. |
---|
28 | PathNode* next; //!< Pointer to the next Node. |
---|
29 | }; |
---|
30 | |
---|
31 | PathNode* firstNode; //!< First node of the curve. |
---|
32 | PathNode* currentNode; //!< The node we are working with (the Last node). |
---|
33 | |
---|
34 | public: |
---|
35 | void addNode (const Vector& newNode); |
---|
36 | |
---|
37 | }; |
---|
38 | |
---|
39 | //! Bezier Curve |
---|
40 | /** |
---|
41 | Class to handle bezier curves in 3-dimesnsional space |
---|
42 | |
---|
43 | needed for the Tracking system in OrxOnoX. |
---|
44 | */ |
---|
45 | class BezierCurve : public Curve |
---|
46 | { |
---|
47 | private: |
---|
48 | // all from Curve-Class |
---|
49 | public: |
---|
50 | BezierCurve (void); |
---|
51 | ~BezierCurve (void); |
---|
52 | Vector calcPos (float t); |
---|
53 | Vector calcDir (float t); |
---|
54 | Quaternion calcQuat (float t); |
---|
55 | |
---|
56 | |
---|
57 | Vector getPos () const; |
---|
58 | }; |
---|
59 | |
---|
60 | |
---|
61 | //! B-Spline |
---|
62 | /** |
---|
63 | class to handle b-spline in 3d space |
---|
64 | */ |
---|
65 | class BSplieCurve : public Curve |
---|
66 | { |
---|
67 | |
---|
68 | |
---|
69 | }; |
---|
70 | |
---|
71 | |
---|
72 | int ncr(int n, int i); |
---|
73 | |
---|
74 | |
---|
75 | #endif /* _CURVE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.