Changeset 3017 in orxonox.OLD for orxonox/branches
- Timestamp:
- Nov 27, 2004, 8:18:01 PM (20 years ago)
- Location:
- orxonox/branches/bezierTrack/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/bezierTrack/src/track.cc
r3015 r3017 83 83 void Track::map_camera (Location* lookat, Placement* camplc) 84 84 { 85 t+=.0001;86 if (t> 1) t =0;87 85 // Line trace(*offset, *end - *offset); 88 86 // float l = trace.len (); … … 120 118 bool Track::map_coords (Location* loc, Placement* plc) 121 119 { 120 t+=.0001; 121 if (t > 1) t =0; 122 // printf ("Pos: %f, %f, %f\n", curve.calcPos(t).x, curve.calcPos(t).y, curve.calcPos(t).z); 122 123 //Line trace(*offset, *end - *offset); 123 124 // float l = trace.len (); -
orxonox/branches/bezierTrack/src/vector.cc
r3016 r3017 883 883 void BezierCurve::addNode(const Vector& newNode) 884 884 { 885 PathNode* tmpNode; 886 if (nodeCount == 0 ) 887 tmpNode = firstNode; 888 else 885 if (nodeCount != 0 ) 889 886 { 890 tmpNode = new PathNode; 891 currentNode = currentNode->next = tmpNode; 887 currentNode = currentNode->next = new PathNode; 892 888 } 893 tmpNode->position = newNode;894 tmpNode->next = 0; // not sure if this really points to NULL!!895 tmpNode->number = (++nodeCount);889 currentNode->position = newNode; 890 currentNode->next = 0; // not sure if this really points to NULL!! 891 currentNode->number = (++nodeCount); 896 892 return; 897 893 } … … 908 904 // if (verbose >= 1) 909 905 // printf ("Please define at least 4 nodes, until now you have only defined %i.\n", nodeCount); 910 curvePoint =Vector(0,0,0);906 return Vector(0,0,0); 911 907 } 912 908 PathNode* tmpNode = firstNode; … … 914 910 Vector ret = Vector(0.0,0.0,0.0); 915 911 double factor; 916 917 for (int k=0; k < nodeCount; k++)912 int k=0; 913 while(tmpNode!=0) 918 914 { 915 k++; 919 916 factor = ncr (nodeCount, k); 920 917 … … 926 923 ret.y += factor * tmpNode->position.y; 927 924 ret.z += factor * tmpNode->position.z; 928 929 tmpNode = tmpNode->next;925 926 tmpNode = tmpNode->next; 930 927 931 928 } … … 953 950 ret.normalize(); 954 951 955 return ret;952 return Vector (0,0,0);//ret; 956 953 } 957 954 -
orxonox/branches/bezierTrack/src/world.cc
r3014 r3017 106 106 track->addPoint (Vector(10, 5, 0)); 107 107 track->addPoint (Vector(20, 0, 0)); 108 track->addPoint (Vector( 10, 3, 0));109 track->addPoint (Vector( 50, 0, 0));110 track->addPoint (Vector( 0,0, 0));108 track->addPoint (Vector(30, -10, 0)); 109 track->addPoint (Vector(40, 5, 0)); 110 track->addPoint (Vector(60, -10, 0)); 111 111 112 112
Note: See TracChangeset
for help on using the changeset viewer.