X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2F3d%2Fpath.cpp;fp=source%2F3d%2Fpath.cpp;h=e413ace021d2bec89cb7b132832b5b93919621db;hb=d27edb207810f0b4e44be8c3632d421faa5fed80;hp=1128b67bb9d61e9b4d0995da236650257e7b90f2;hpb=c87c4200e105a21c1d1f9faec20c4c08ddbb53ee;p=r2c2.git diff --git a/source/3d/path.cpp b/source/3d/path.cpp index 1128b67..e413ace 100644 --- a/source/3d/path.cpp +++ b/source/3d/path.cpp @@ -19,7 +19,8 @@ namespace Marklin { Path3D::Path3D(const Track3D &t): track(t), paths(0), - automatic(true) + automatic(true), + z_offs(0) { track.get_layout().get_path_scene().add(*this); } @@ -55,6 +56,11 @@ void Path3D::set_color(const GL::Color &c) 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) @@ -66,6 +72,7 @@ void Path3D::render(const GL::Tag &tag) const 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)