Changeset 3016 in orxonox.OLD for orxonox/branches/bezierTrack/src
- Timestamp:
- Nov 27, 2004, 6:12:42 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/bezierTrack/src/vector.cc
r3015 r3016 21 21 22 22 #include "vector.h" 23 23 #include <fstream> 24 24 25 25 using namespace std; … … 928 928 929 929 tmpNode = tmpNode->next; 930 930 931 } 931 932 return ret; … … 934 935 Vector BezierCurve::calcDir (float t) 935 936 { 936 double diff = .00000000001; 937 938 Vector diffV = ((calcPos(t+diff) - calcPos(t))/diff); 939 diffV.normalize(); 940 return diffV; 937 PathNode* tmpNode = firstNode; 938 BezierCurve* tmpCurve = new BezierCurve(); 939 Vector ret; 940 Vector tmpVector; 941 942 while (tmpNode->next != 0) 943 { 944 tmpVector = (tmpNode->next->position)- (tmpNode->position); 945 tmpVector.x*=(float)nodeCount; 946 tmpVector.y*=(float)nodeCount; 947 tmpVector.z*=(float)nodeCount; 948 949 tmpCurve->addNode(tmpVector); 950 tmpNode = tmpNode->next; 951 } 952 ret = tmpCurve->calcPos(t); 953 ret.normalize(); 954 955 return ret; 941 956 } 942 957
Note: See TracChangeset
for help on using the changeset viewer.