summaryrefslogtreecommitdiff
path: root/game/vehicles/railVehicle.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-13 00:17:11 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-13 00:17:11 +0000
commit356e874050e5ad5af87b04a2bb01ce34a86640bb (patch)
treec3f2a5d548340821378f6d79b03c81bd63382282 /game/vehicles/railVehicle.cpp
parentRefactor BufferedLocationT to use a callback (diff)
downloadilt-356e874050e5ad5af87b04a2bb01ce34a86640bb.tar.bz2
ilt-356e874050e5ad5af87b04a2bb01ce34a86640bb.tar.xz
ilt-356e874050e5ad5af87b04a2bb01ce34a86640bb.zip
Send position and rotation matrix to GPU separately
Diffstat (limited to 'game/vehicles/railVehicle.cpp')
-rw-r--r--game/vehicles/railVehicle.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp
index 1ed904d..6e6e18f 100644
--- a/game/vehicles/railVehicle.cpp
+++ b/game/vehicles/railVehicle.cpp
@@ -14,15 +14,18 @@
RailVehicle::RailVehicle(RailVehicleClassPtr rvc) :
RailVehicleClass::Instance {rvc->instances.acquire()}, rvClass {std::move(rvc)},
location {[this](const BufferedLocation * l) {
- this->get()->body = l->getTransform();
+ this->get()->body = l->getRotationTransform();
+ this->get()->bodyPos = l->position();
}},
bogies {{
{[this](const BufferedLocation * l) {
- this->get()->front = l->getTransform();
+ this->get()->front = l->getRotationTransform();
+ this->get()->frontPos = l->position();
},
Position3D {0, rvClass->wheelBase / 2.F, 0}},
{[this](const BufferedLocation * l) {
- this->get()->back = l->getTransform();
+ this->get()->back = l->getRotationTransform();
+ this->get()->backPos = l->position();
},
Position3D {0, -rvClass->wheelBase / 2.F, 0}},
}}