Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3365 in orxonox.OLD for orxonox/trunk/src/curve.h


Ignore:
Timestamp:
Jan 7, 2005, 1:14:33 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged branches/parenting back to the.
merged with command:
svn merge branches/parenting trunk -r 3247:HEAD
resolved all conflicts in favor of parenting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/curve.h

    r3217 r3365  
     1
    12/*!
    23    \file curve.h
     
    1112#include "vector.h"
    1213
     14//! An Enumerator that defines what sort of Curves are availible
     15enum CurveType {BEZIERCURVE, UPOINTCURVE};
    1316
    14 //! An abstract class to handle curves.
     17
     18//! An abstract class to handle curves. Needed for the Tracking system in orxonox.
    1519class Curve
    1620{
     
    1923  Vector curvePoint;     //!< The point on the Cureve at a local Time.
    2024  float localTime;       //!< If the time of one point is asked more than once the programm will not calculate it again.
     25  Curve* dirCurve;       //!< The derivation-curve of this Curve.
     26  int derivation;        //!< Which derivation of a Curve is this.
    2127
    2228  //! Handles the curve-points (dynamic List)
     
    2430  {
    2531    int number;          //!< The N-th node of this curve.
     32    float factor;        //!< Curve specific multiplier factor.
     33    Vector vFactor;      //!< A Vector-factor for multipliing.
    2634    Vector position;     //!< Vector Pointung to this curve-point.
    2735    PathNode* next;      //!< Pointer to the next Node.
     
    3139  PathNode* currentNode; //!< The node we are working with (the Last node).
    3240
     41 private:
     42  virtual void rebuild(void) = 0;
    3343 public:
    34   void addNode (const Vector& newNode);
     44  void addNode(const Vector& newNode);
     45  Vector getNode(unsigned int nodeToFind);
     46  inline int getNodeCount(void) { return this->nodeCount;}
    3547
     48  virtual Vector calcPos(float t) = 0;
     49  virtual Vector calcDir(float t) = 0;
     50  virtual Quaternion calcQuat(float t) = 0;
     51 
    3652};
    3753
    38 //! Bezier Curve
     54//!    Class to handle bezier curves in 3-dimesnsional space
    3955/**
    40    Class to handle bezier curves in 3-dimesnsional space
    41    
    42    needed for  the Tracking system in OrxOnoX.
     56   This Curve is good, for Fast Interaction. If you want to change it during the game, go on.
     57   !!be aware!! BezierCurves only flow through their first and last Node. Their Tangents at those Points a directed to the second and second-last Point.
    4358*/
    4459class BezierCurve : public Curve
    4560{
    4661 private:
    47   // all from Curve-Class
     62  void rebuild(void);
    4863 public:
    49   BezierCurve (void);
    50   ~BezierCurve (void);
    51   Vector calcPos (float t);
    52   Vector calcDir (float t);
    53   Quaternion calcQuat (float t);
     64  BezierCurve(void);
     65  BezierCurve(int derivation);
     66  ~BezierCurve(void);
     67  void init(void);
     68
     69  Vector calcPos(float t);
     70  Vector calcDir(float t);
     71  Quaternion calcQuat(float t);
    5472 
    5573 
    56   Vector getPos () const;
     74  Vector getPos(void) const;
    5775};
    5876
    59 int ncr(int n, int i);
     77
     78//! B-Spline
     79/**
     80   class to handle b-spline in 3d space
     81*/
     82class BSplieCurve : public Curve
     83{
    6084
    6185
     86};
     87
     88//! Uniform Point Curve-class
     89/**
     90   A UPoint Curve is a A Curve, that flows through all the nodes given it.
     91   The Algorithm to buid the curve is rather slow, but Painting and tracing along the curve has high speed, so do not change this curve during the Game.
     92
     93   This Curve is very erattic, so i do not recommend to use it.
     94*/
     95class UPointCurve : public Curve
     96{
     97 private:
     98  void rebuild(void);
     99 public:
     100  UPointCurve(void);
     101  UPointCurve(int derivation);
     102  ~UPointCurve(void);
     103  void init(void);
     104
     105  Vector calcPos(float t);
     106  Vector calcDir(float t);
     107  Quaternion calcQuat(float t);
     108 
     109  Vector getPos(void) const;
     110};
     111
    62112#endif /* _CURVE_H */
Note: See TracChangeset for help on using the changeset viewer.