/*! \file curve.h \brief A basic 3D curve framework Contains classes to handle curves */ #ifndef _CURVE_H #define _CURVE_H #include "vector.h" //! An abstract class to handle curves. class Curve { protected: int nodeCount; //!< The count of nodes the Curve has. Vector curvePoint; //!< The point on the Cureve at a local Time. float localTime; //!< If the time of one point is asked more than once the programm will not calculate it again. Curve* dirCurve; //!< The derivation-curve of this Curve. int derivation; //!< Which derivation of a Curve is this. //! Handles the curve-points (dynamic List) struct PathNode { int number; //!< The N-th node of this curve. float factor; //!< Curve specific multiplier factor. Vector position; //!< Vector Pointung to this curve-point. PathNode* next; //!< Pointer to the next Node. }; PathNode* firstNode; //!< First node of the curve. PathNode* currentNode; //!< The node we are working with (the Last node). private: virtual void rebuild(void) = 0; public: void addNode (const Vector& newNode); virtual Vector calcPos(float t) = 0; virtual Vector calcDir(float t) = 0; virtual Quaternion calcQuat(float t) = 0; }; //! Bezier Curve /** Class to handle bezier curves in 3-dimesnsional space needed for the Tracking system in OrxOnoX. */ class BezierCurve : public Curve { private: void rebuild(void); public: BezierCurve(void); BezierCurve(int derivation); ~BezierCurve(void); void init(void); Vector calcPos(float t); Vector calcDir(float t); Quaternion calcQuat(float t); Vector getPos(void) const; }; //! B-Spline /** class to handle b-spline in 3d space */ class BSplieCurve : public Curve { }; #endif /* _CURVE_H */