GL::PushMatrix _push;
const Point &tp = (*i)->get_position();
- GL::translate(tp.x, tp.y, 0.02);
+ GL::translate(tp.x, tp.y, tp.z+0.02);
GL::Immediate imm((GL::COLOR4_UBYTE, GL::VERTEX2));
imm.color(0.8f, 0.8f, 1.0f);
imm.begin(GL::TRIANGLE_FAN);
float x = eps[epi].pos.x;
float y = eps[epi].pos.y;
+ float z = 0;
+ float slope_norm = 0;
+ if(eps.size()==2)
+ {
+ slope_norm = slope/type.get_total_length();
+ if(epi==1)
+ {
+ z = slope;
+ slope_norm = -slope_norm;
+ }
+ }
const vector<TrackPart> &parts = type.get_parts();
const TrackPart *last_part = 0;
plen *= abs(i->radius);
if(d<plen)
{
+ z += d*slope_norm;
if(j==1)
d = plen-d;
Point p = i->get_point(d);
float c = cos(rot);
float s = sin(rot);
- return Point(pos.x+c*p.x-s*p.y, pos.y+c*p.y+s*p.x);
+ return Point(pos.x+c*p.x-s*p.y, pos.y+c*p.y+s*p.x, pos.z+z);
}
else if(part_eps.size()>1)
{
d -= plen;
x = part_eps[1-j].pos.x;
y = part_eps[1-j].pos.y;
+ z += plen*slope_norm;
last_part = &*i;
i = parts.begin();
break;