diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-04 15:47:22 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-04 15:47:22 +0000 |
commit | c32674d9bac2cf6283cafc3bf446a45be22b2851 (patch) | |
tree | b28ea4d923fa945aba3f91d636394f74429d2ae1 /game/vehicles/railVehicle.cpp | |
parent | RailVehicleClass now renders bogie shadows as well as body (diff) | |
download | ilt-c32674d9bac2cf6283cafc3bf446a45be22b2851.tar.bz2 ilt-c32674d9bac2cf6283cafc3bf446a45be22b2851.tar.xz ilt-c32674d9bac2cf6283cafc3bf446a45be22b2851.zip |
Default RailVehicle bogie positions according to class wheelBase
Useful for render tests so everything looks sane
Diffstat (limited to 'game/vehicles/railVehicle.cpp')
-rw-r--r-- | game/vehicles/railVehicle.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp index cbe36a6..77907be 100644 --- a/game/vehicles/railVehicle.cpp +++ b/game/vehicles/railVehicle.cpp @@ -11,6 +11,12 @@ #include <memory> #include <ray.hpp> +RailVehicle::RailVehicle(RailVehicleClassPtr rvc) : rvClass {std::move(rvc)} +{ + bogies.front().pos.y = rvClass->wheelBase / 2.F; + bogies.back().pos.y = -bogies.front().pos.y; +} + void RailVehicle::render(const SceneShader & shader) const { |