Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3004 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Nov 26, 2004, 11:29:46 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: implemented Bezier-Diff

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/track.cc

    r2636 r3004  
    1313   ### File Specific:
    1414   main-programmer: Christian Meyer
    15    co-programmer: ...
     15   co-programmer: Benjamin Grauer
    1616*/
    1717
     
    7575  //    camplc->r = *offset + Vector(0,0,0.5);
    7676  //    camplc->w = Quaternion (trace.a, Vector(0,0,1));
    77   float r = (lookat->dist)*PI / l;
     77  //  float r = (lookat->dist)*PI / l;
    7878  camplc->r = trace.r + (trace.a * ((lookat->dist-10.0) / l)) + Vector(0,0,5.0);
    7979 
     
    111111        if( loc->dist > l)
    112112        {
    113                 loc->dist -= l;
     113                loc->dist -= l;
    114114                loc->part = nextID;
    115115                //FIXME: loc->track = this;
  • orxonox/trunk/src/vector.cc

    r3002 r3004  
    898898
    899899/**
    900    \brief calculates (and does not return) the Position on the curve
     900   \brief calculates the Position on the curve
    901901   \param t The position on the Curve (0<=t<=1)
    902 */
    903 void BezierCurve::calcPos(float t)
     902   \return the Position on the Path
     903*/
     904Vector BezierCurve::calcPos(float t)
    904905{
    905906  if (nodeCount <=4)
     
    943944    tmpNode = tmpNode->next;
    944945  }
    945   curvePoint = b;
    946   return;
     946  return b;
     947}
     948
     949Vector BezierCurve::calcDirection (float t)
     950{
     951  double diff = .00000000001;
     952 
     953  Vector diffV = ((calcPos(t+diff) - calcPos(t))/diff);
     954  diffV.normalize();
     955  return diffV;
    947956}
    948957
     
    955964  return curvePoint;
    956965}
    957 
    958 /**
    959   \brief returns the position of the point on the Curve at position t
    960   \param t The position on the Curve (0<=t<=1)
    961   \return a Vector to the calculated position
    962 */
    963 Vector BezierCurve::getPos(float t)
    964 {
    965   calcPos(t);
    966   return curvePoint;
    967 }
  • orxonox/trunk/src/vector.h

    r3002 r3004  
    177177  ~BezierCurve (void);
    178178  void addNode (const Vector& newNode);
    179   void calcPos (float t);
     179  Vector calcPos (float t);
     180  Vector calcDirection (float t);
    180181 
    181182  Vector getPos () const;
    182   Vector getPos (float t);
    183183};
    184184
  • orxonox/trunk/src/world.cc

    r2864 r3004  
    428428    }
    429429
    430   for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
     430  //  for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
    431431}
    432432
Note: See TracChangeset for help on using the changeset viewer.