Path3D::Path3D(const Track3D &t):
track(t),
paths(0),
- automatic(true)
+ automatic(true),
+ z_offs(0)
{
track.get_layout().get_path_scene().add(*this);
}
color = c;
}
+void Path3D::set_layer(float l)
+{
+ z_offs = l*track.get_track().get_layout().get_catalogue().get_gauge()*0.01;
+}
+
void Path3D::render(const GL::Tag &tag) const
{
- if(tag==0)
+ if(tag=="unlit")
{
unsigned mask = (automatic ? 1<<track.get_track().get_active_path() : paths);
mask &= track.get_track().get_type().get_paths();
GL::PushMatrix push_mat;
track.apply_matrix();
+ GL::translate(0, 0, z_offs);
glColor4f(color.r, color.g, color.b, color.a);
for(unsigned i=0; mask; ++i, mask>>=1)