Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/parenting/src/curve.h @ 3321

Last change on this file since 3321 was 3321, checked in by bensch, 19 years ago

orxonox/branches/parenting: derivation-curve implemented.

File size: 1.7 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.
16class 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  Curve* dirCurve;       //!< The derivation-curve of this Curve.
23  int derivation;        //!< Which derivation of a Curve is this.
24
25  //! Handles the curve-points (dynamic List)
26  struct PathNode
27  {
28    int number;          //!< The N-th node of this curve.
29    float factor;        //!< Curve specific multiplier factor.
30    Vector position;     //!< Vector Pointung to this curve-point.
31    PathNode* next;      //!< Pointer to the next Node.
32  };
33
34  PathNode* firstNode;   //!< First node of the curve.
35  PathNode* currentNode; //!< The node we are working with (the Last node).
36
37 private:
38  virtual void rebuild(void) = 0;
39 public:
40  void addNode (const Vector& newNode);
41
42};
43
44//! Bezier Curve
45/**
46   Class to handle bezier curves in 3-dimesnsional space
47   
48   needed for  the Tracking system in OrxOnoX.
49*/
50class BezierCurve : public Curve
51{
52 private:
53  void rebuild(void);
54 public:
55  BezierCurve(void);
56  BezierCurve(int derivation);
57  ~BezierCurve(void);
58  void init(void);
59
60  Vector calcPos(float t);
61  Vector calcDir(float t);
62  Quaternion calcQuat(float t);
63 
64 
65  Vector getPos(void) const;
66};
67
68
69//! B-Spline
70/**
71   class to handle b-spline in 3d space
72*/
73class BSplieCurve : public Curve
74{
75
76
77};
78
79
80#endif /* _CURVE_H */
Note: See TracBrowser for help on using the repository browser.