X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fvehicle.cpp;fp=source%2Flibr2c2%2Fvehicle.cpp;h=17d67b666a28a49ae73822f82e91aec6162db1b1;hb=a2b6ee3a345cb851c98e52608020ba2838326769;hp=fa44916a19b56cdc5bc5919026917c514994635c;hpb=64d23de66c33d0f77454c3db2e40cccc18f7851b;p=r2c2.git diff --git a/source/libr2c2/vehicle.cpp b/source/libr2c2/vehicle.cpp index fa44916..17d67b6 100644 --- a/source/libr2c2/vehicle.cpp +++ b/source/libr2c2/vehicle.cpp @@ -204,6 +204,7 @@ void Vehicle::update_position() position = p.position; position.z += layout.get_catalogue().get_rail_elevation(); rotation = p.rotation; + tilt = p.tilt; signal_moved.emit(); } @@ -378,6 +379,7 @@ OrientedPoint Vehicle::get_point(const Vector &front, const Vector &back, float OrientedPoint p; p.position = back+span*ratio; p.rotation = Geometry::atan2(span.y, span.x); + p.tilt = Geometry::atan2(span.z, LinAl::Vector(span).norm()); return p; }