- eps.push_back(Endpoint(x+cos(dir)*length, y+sin(dir)*length, dir, 1<<route));
+ eps.push_back(Endpoint(pos.x+cos(dir)*length, pos.y+sin(dir)*length, dir, 1<<path));
+}
+
+Point TrackPart::get_point(float d) const
+{
+ if(radius)
+ {
+ float a = d/radius;
+ float c = cos(a);
+ float s = sin(a);
+ float rx = radius*sin(dir);
+ float ry = -radius*cos(dir);
+ return Point(pos.x+c*rx-s*ry-rx, pos.y+c*ry+s*rx-ry);
+ }
+ else
+ return Point(pos.x+cos(dir)*d, pos.y+sin(dir)*d);