summaryrefslogtreecommitdiff
path: root/game/vehicles/railVehicle.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-05-07 01:41:31 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-05-07 01:41:31 +0100
commit9ab2aad4aa00afe3373b3a779377fa049459fb4d (patch)
tree18bf013e3be660b0769cd1a601e670eb79355324 /game/vehicles/railVehicle.cpp
parentRename strings.h to something that won't conflict with a system header (diff)
parentTemplated BufferedLocation and single buffer storage for RVC locations (diff)
downloadilt-9ab2aad4aa00afe3373b3a779377fa049459fb4d.tar.bz2
ilt-9ab2aad4aa00afe3373b3a779377fa049459fb4d.tar.xz
ilt-9ab2aad4aa00afe3373b3a779377fa049459fb4d.zip
Merge branch 'containers'
Diffstat (limited to 'game/vehicles/railVehicle.cpp')
-rw-r--r--game/vehicles/railVehicle.cpp11
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