summaryrefslogtreecommitdiff
path: root/game/vehicles
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-02-20 14:06:29 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-02-20 14:06:29 +0000
commitb77024de4351bcddee5c4781aa9fc031131f293b (patch)
treec51d7c8add4c450a0b6e980da88830fa53215171 /game/vehicles
parentdos2unix shader sources (diff)
downloadilt-b77024de4351bcddee5c4781aa9fc031131f293b.tar.bz2
ilt-b77024de4351bcddee5c4781aa9fc031131f293b.tar.xz
ilt-b77024de4351bcddee5c4781aa9fc031131f293b.zip
Pass linters
Diffstat (limited to 'game/vehicles')
-rw-r--r--game/vehicles/railloco.cpp4
-rw-r--r--game/vehicles/railloco.h7
-rw-r--r--game/vehicles/vehicle.cpp1
-rw-r--r--game/vehicles/vehicle.h2
4 files changed, 9 insertions, 5 deletions
diff --git a/game/vehicles/railloco.cpp b/game/vehicles/railloco.cpp
index b47722e..6a43965 100644
--- a/game/vehicles/railloco.cpp
+++ b/game/vehicles/railloco.cpp
@@ -6,7 +6,9 @@
#include <algorithm>
#include <array>
#include <cache.h>
+#include <filesystem>
#include <glm/glm.hpp>
+#include <iterator>
#include <lib/resource.h>
#include <maths.h>
#include <memory>
@@ -61,7 +63,7 @@ RailLoco::updateRailVehiclePosition(RailVehicle * w, float trailBy) const
{
const auto overhang {(w->length - w->wheelBase) / 2};
const auto & b1Pos = w->bogeys[0].location = getBogeyPosition(linkDist, trailBy += overhang);
- const auto & b2Pos = w->bogeys[1].location = getBogeyPosition(linkDist, trailBy += wheelBase);
+ const auto & b2Pos = w->bogeys[1].location = getBogeyPosition(linkDist, trailBy + wheelBase);
const auto diff = glm::normalize(b2Pos.GetPos() - b1Pos.GetPos());
w->location.GetPos() = (b1Pos.GetPos() + b2Pos.GetPos()) / 2.F;
w->location.GetRot() = {-vector_pitch(diff), vector_yaw(diff), 0};
diff --git a/game/vehicles/railloco.h b/game/vehicles/railloco.h
index 0d0425a..df5f970 100644
--- a/game/vehicles/railloco.h
+++ b/game/vehicles/railloco.h
@@ -1,11 +1,14 @@
#include "game/network/link.h"
#include "game/vehicles/vehicle.h"
#include "game/worldobject.h"
+#include "gfx/gl/transform.h"
#include "gfx/models/mesh.h"
+#include <array>
#include <memory>
-#include <string>
#include <vector>
+class Shader;
+
class Texture;
class RailVehicle : public Vehicle {
public:
@@ -42,7 +45,7 @@ public:
private:
void move(TickDuration dur);
- Transform getBogeyPosition(float linkDist, float dist) const;
+ [[nodiscard]] Transform getBogeyPosition(float linkDist, float dist) const;
void updateRailVehiclePosition(RailVehicle *, float trailBy) const;
void updateWagons() const;
};
diff --git a/game/vehicles/vehicle.cpp b/game/vehicles/vehicle.cpp
index b9d10bc..26e33d4 100644
--- a/game/vehicles/vehicle.cpp
+++ b/game/vehicles/vehicle.cpp
@@ -1,6 +1,5 @@
#include "vehicle.h"
#include "game/network/link.h"
-#include <array>
#include <memory>
#include <utility>
diff --git a/game/vehicles/vehicle.h b/game/vehicles/vehicle.h
index bbfa6ea..228f15a 100644
--- a/game/vehicles/vehicle.h
+++ b/game/vehicles/vehicle.h
@@ -1,11 +1,11 @@
#ifndef VEHICLE_H
#define VEHICLE_H
+#include "gfx/gl/transform.h"
#include <game/network/link.h>
#include <game/worldobject.h>
#include <gfx/renderable.h>
#include <memory>
-#include <string>
#include <utility>
#include <vector>