- float a=((radius<0) ? -length : length);
- float c=cos(a);
- float s=sin(a);
- float rx=radius*sin(dir);
- float ry=-radius*cos(dir);
- eps.push_back(Endpoint(x+c*rx-s*ry-rx, y+c*ry+s*rx-ry, dir+a, 1<<route));
+ float a = ((radius<0) ? -length : length);
+ Point p = get_point(length*abs(radius));
+ eps.push_back(Endpoint(p.x, p.y, dir+a, 1<<path));
+ }
+ else
+ 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);