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
|
Rev | Line | |
---|
[3311] | 1 | |
---|
[3018] | 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 | |
---|
[3217] | 15 | //! An abstract class to handle curves. |
---|
[3019] | 16 | class Curve |
---|
[3018] | 17 | { |
---|
[3019] | 18 | protected: |
---|
[3217] | 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. |
---|
[3019] | 22 | |
---|
[3217] | 23 | //! Handles the curve-points (dynamic List) |
---|
[3018] | 24 | struct PathNode |
---|
| 25 | { |
---|
[3217] | 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. |
---|
[3018] | 29 | }; |
---|
| 30 | |
---|
[3217] | 31 | PathNode* firstNode; //!< First node of the curve. |
---|
| 32 | PathNode* currentNode; //!< The node we are working with (the Last node). |
---|
[3018] | 33 | |
---|
[3019] | 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 |
---|
[3018] | 49 | public: |
---|
| 50 | BezierCurve (void); |
---|
| 51 | ~BezierCurve (void); |
---|
[3028] | 52 | Vector calcPos (float t); |
---|
| 53 | Vector calcDir (float t); |
---|
| 54 | Quaternion calcQuat (float t); |
---|
[3018] | 55 | |
---|
[3028] | 56 | |
---|
[3018] | 57 | Vector getPos () const; |
---|
| 58 | }; |
---|
| 59 | |
---|
[3311] | 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 | |
---|
[3019] | 72 | int ncr(int n, int i); |
---|
[3018] | 73 | |
---|
| 74 | |
---|
| 75 | #endif /* _CURVE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.