diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-05-06 16:42:08 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-05-06 16:42:08 +0100 |
commit | 72ab29786f6d4c97a92cb95c75091537490e2d0f (patch) | |
tree | 18bf013e3be660b0769cd1a601e670eb79355324 /game/vehicles/railVehicle.cpp | |
parent | Refactor InstanceVertices in terms of glContainer (diff) | |
download | ilt-72ab29786f6d4c97a92cb95c75091537490e2d0f.tar.bz2 ilt-72ab29786f6d4c97a92cb95c75091537490e2d0f.tar.xz ilt-72ab29786f6d4c97a92cb95c75091537490e2d0f.zip |
Templated BufferedLocation and single buffer storage for RVC locations
Diffstat (limited to 'game/vehicles/railVehicle.cpp')
-rw-r--r-- | game/vehicles/railVehicle.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp index c4a9e96..2d820b6 100644 --- a/game/vehicles/railVehicle.cpp +++ b/game/vehicles/railVehicle.cpp @@ -12,13 +12,12 @@ #include <ray.h> RailVehicle::RailVehicle(RailVehicleClassPtr rvc) : - rvClass {std::move(rvc)}, location {rvClass->instancesBody}, bogies { - rvClass->instancesBogies.front(), - rvClass->instancesBogies.back(), - } + RailVehicleClass::Instance {rvc->instances.acquire()}, rvClass {std::move(rvc)}, location {&LV::body, *this}, + bogies {{ + {&LV::front, *this, glm::vec3 {0, rvClass->wheelBase / 2.F, 0}}, + {&LV::back, *this, glm::vec3 {0, -rvClass->wheelBase / 2.F, 0}}, + }} { - bogies.front().setPosition({0, rvClass->wheelBase / 2.F, 0}); - bogies.back().setPosition({0, -bogies.front().position().y, 0}); } void |