diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-06 17:35:05 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-06 17:35:05 +0000 |
commit | 47784c84f51891a5ab99aa363f231b8267773ce6 (patch) | |
tree | ba48152a874cc9d4f74d9350d1a12a56c9976df0 /game/vehicles/railloco.h | |
parent | Introduce the rail vehicle class for the definition of the vehicle (diff) | |
download | ilt-47784c84f51891a5ab99aa363f231b8267773ce6.tar.bz2 ilt-47784c84f51891a5ab99aa363f231b8267773ce6.tar.xz ilt-47784c84f51891a5ab99aa363f231b8267773ce6.zip |
Push lots of stuff into rail vehicle class
Derives lots more info directly from the model
Diffstat (limited to 'game/vehicles/railloco.h')
-rw-r--r-- | game/vehicles/railloco.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/game/vehicles/railloco.h b/game/vehicles/railloco.h index 88f9503..1bc0a51 100644 --- a/game/vehicles/railloco.h +++ b/game/vehicles/railloco.h @@ -5,20 +5,30 @@ #include <array> #include <location.hpp> #include <memory> +#include <string> #include <utility> #include <vector> class Shader; class Texture; +class ObjParser; class RailVehicleClass { public: + explicit RailVehicleClass(const std::string & name); + void render(const Shader &, const Location &, const std::array<Location, 2> &) const; + std::array<MeshPtr, 2> bogies; MeshPtr bodyMesh; std::shared_ptr<Texture> texture; float wheelBase; float length; + +private: + RailVehicleClass(std::unique_ptr<ObjParser> obj, std::shared_ptr<Texture>); + static float bogieOffset(ObjParser & o); + static float objectLength(ObjParser & o); }; using RailVehicleClassPtr = std::shared_ptr<RailVehicleClass>; |