summaryrefslogtreecommitdiff
path: root/game/vehicles
diff options
context:
space:
mode:
Diffstat (limited to 'game/vehicles')
-rw-r--r--game/vehicles/railVehicle.cpp2
-rw-r--r--game/vehicles/railVehicleClass.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp
index a2373e7..aea7f8c 100644
--- a/game/vehicles/railVehicle.cpp
+++ b/game/vehicles/railVehicle.cpp
@@ -21,6 +21,6 @@ RailVehicle::move(const Train * t, float & trailBy)
const auto & b2Pos = bogies[1] = t->getBogiePosition(t->linkDist, trailBy += rvClass->wheelBase);
const auto diff = glm::normalize(b2Pos.pos - b1Pos.pos);
location.pos = (b1Pos.pos + b2Pos.pos) / 2.F;
- location.rot = {-vector_pitch(diff), vector_yaw(diff), 0};
+ location.rot = {vector_pitch(diff), vector_yaw(diff), 0};
trailBy += 0.6F + overhang;
}
diff --git a/game/vehicles/railVehicleClass.cpp b/game/vehicles/railVehicleClass.cpp
index 83eb9a0..52b7dbe 100644
--- a/game/vehicles/railVehicleClass.cpp
+++ b/game/vehicles/railVehicleClass.cpp
@@ -60,12 +60,12 @@ RailVehicleClass::bogieOffset(ObjParser & o)
std::set<std::pair<float, int>> vertexIds;
for (const auto & face : object.second) {
for (const auto & faceElement : face) {
- vertexIds.emplace(o.vertices[faceElement.x - 1].z, faceElement.x - 1);
+ vertexIds.emplace(o.vertices[faceElement.x - 1].y, faceElement.x - 1);
}
}
const auto offset = (vertexIds.begin()->first + vertexIds.rbegin()->first) / 2;
for (const auto & v : vertexIds) {
- o.vertices[v.second].z -= offset;
+ o.vertices[v.second].y -= offset;
}
wheelBase += std::abs(offset);
}
@@ -76,7 +76,7 @@ float
RailVehicleClass::objectLength(ObjParser & o)
{
const auto mme = std::minmax_element(o.vertices.begin(), o.vertices.end(), [](const auto & v1, const auto & v2) {
- return v1.z < v2.z;
+ return v1.y < v2.y;
});
- return mme.second->z - mme.first->z;
+ return mme.second->y - mme.first->y;
}