diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-12 01:15:26 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-12 01:15:26 +0000 |
| commit | 6d9d393ae60bfc6b2625a5540cd60ffed478aa13 (patch) | |
| tree | bfb184ff995f03c998129e79f786208586fa9360 /game/vehicles/railVehicle.cpp | |
| parent | Reuse vertex array objects for common structures with DSA (diff) | |
| download | ilt-6d9d393ae60bfc6b2625a5540cd60ffed478aa13.tar.bz2 ilt-6d9d393ae60bfc6b2625a5540cd60ffed478aa13.tar.xz ilt-6d9d393ae60bfc6b2625a5540cd60ffed478aa13.zip | |
Shared VAO for all 3 parts of RailVehicleClass
Rearranges its LocationVertex to be 3 repeated Parts. Adds helpers to
glvglVertexArray for useBuffer with various offsets. Render is then an
iteration of the meshes and the location data at the nth offset.
Diffstat (limited to 'game/vehicles/railVehicle.cpp')
| -rw-r--r-- | game/vehicles/railVehicle.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp index 4a0a22d..61f6c93 100644 --- a/game/vehicles/railVehicle.cpp +++ b/game/vehicles/railVehicle.cpp @@ -14,18 +14,18 @@ RailVehicle::RailVehicle(RailVehicleClassPtr rvc) : RailVehicleClass::Instance {rvc->instances.acquire()}, rvClass {std::move(rvc)}, location {[this](const BufferedLocation * l) { - this->get()->body = l->getRotationTransform(); - this->get()->bodyPos = l->position(); + this->get()->body.rotation = l->getRotationTransform(); + this->get()->body.position = l->position(); }}, bogies {{ {[this](const BufferedLocation * l) { - this->get()->front = l->getRotationTransform(); - this->get()->frontPos = l->position(); + this->get()->front.rotation = l->getRotationTransform(); + this->get()->front.position = l->position(); }, GlobalPosition3D {0, rvClass->wheelBase / 2.F, 0}}, {[this](const BufferedLocation * l) { - this->get()->back = l->getRotationTransform(); - this->get()->backPos = l->position(); + this->get()->back.rotation = l->getRotationTransform(); + this->get()->back.position = l->position(); }, GlobalPosition3D {0, -rvClass->wheelBase / 2.F, 0}}, }} |
