diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-06 19:44:58 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-06 19:44:58 +0000 |
commit | e118b1f5d8071460e3a9d4d731c6d69221f785dc (patch) | |
tree | 64ea6b1761afba27d36319648e78ddd457670ff8 /game/vehicles/railVehicleClass.h | |
parent | Introduce the Train concept as a literal collection of rail vehicles (diff) | |
download | ilt-e118b1f5d8071460e3a9d4d731c6d69221f785dc.tar.bz2 ilt-e118b1f5d8071460e3a9d4d731c6d69221f785dc.tar.xz ilt-e118b1f5d8071460e3a9d4d731c6d69221f785dc.zip |
Carve up the mess in game/vehicles
Diffstat (limited to 'game/vehicles/railVehicleClass.h')
-rw-r--r-- | game/vehicles/railVehicleClass.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/game/vehicles/railVehicleClass.h b/game/vehicles/railVehicleClass.h new file mode 100644 index 0000000..b902367 --- /dev/null +++ b/game/vehicles/railVehicleClass.h @@ -0,0 +1,33 @@ +#ifndef RAILVEHICLECLASS_H +#define RAILVEHICLECLASS_H + +#include "gfx/models/mesh.h" +#include <array> +#include <memory> +#include <string> + +class Shader; +class Texture; +class ObjParser; +class Location; + +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>; + +#endif |