X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Ftrack.cpp;h=208d40f10cdbbdfe09e81f6457c1a29a3da1a7c8;hb=d88bc162df8b34f2ca966524222880033132da0f;hp=fc365862301c9acfa0734ccd3b510b7a5c6cbe77;hpb=c12e074c6b9b5136e72931fb47a562e40e0a24f9;p=r2c2.git diff --git a/source/libmarklin/track.cpp b/source/libmarklin/track.cpp index fc36586..208d40f 100644 --- a/source/libmarklin/track.cpp +++ b/source/libmarklin/track.cpp @@ -293,6 +293,11 @@ unsigned Track::traverse(unsigned i, unsigned path) const throw Exception("Track endpoint did not have a counterpart"); } +unsigned Track::traverse(unsigned i) const +{ + return traverse(i, active_path); +} + TrackPoint Track::get_point(unsigned epi, unsigned path, float d) const { TrackPoint p = type.get_point(epi, path, d); @@ -300,6 +305,7 @@ TrackPoint Track::get_point(unsigned epi, unsigned path, float d) const float s = sin(rot); p.pos = Point(pos.x+c*p.pos.x-s*p.pos.y, pos.y+s*p.pos.x+c*p.pos.y, 0); + p.dir += rot; if(type.get_endpoints().size()==2) { float len = type.get_path_length(path); @@ -319,6 +325,11 @@ TrackPoint Track::get_point(unsigned epi, unsigned path, float d) const return p; } +TrackPoint Track::get_point(unsigned epi, float d) const +{ + return get_point(epi, active_path, d); +} + void Track::save(list &st) const { st.push_back((DataFile::Statement("position"), pos.x, pos.y, pos.z));