summaryrefslogtreecommitdiff
path: root/game/vehicles/railVehicleClass.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-05 01:59:16 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-05 01:59:16 +0000
commitd4c073a18adaed73973f34c6c39fc15664d9211d (patch)
tree44536af3af0284ab75eae79ef81a5e4452019269 /game/vehicles/railVehicleClass.h
parentAdd helper operator to perform vec3*mat4 and perspective divide (diff)
parentRemove old hard coded asset factory test, run entirely from XML load and rend... (diff)
downloadilt-d4c073a18adaed73973f34c6c39fc15664d9211d.tar.bz2
ilt-d4c073a18adaed73973f34c6c39fc15664d9211d.tar.xz
ilt-d4c073a18adaed73973f34c6c39fc15664d9211d.zip
Merge branch 'model-factory'
Diffstat (limited to 'game/vehicles/railVehicleClass.h')
-rw-r--r--game/vehicles/railVehicleClass.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/game/vehicles/railVehicleClass.h b/game/vehicles/railVehicleClass.h
index bd74ab9..a2222fb 100644
--- a/game/vehicles/railVehicleClass.h
+++ b/game/vehicles/railVehicleClass.h
@@ -1,5 +1,6 @@
#pragma once
+#include "assetFactory/asset.h"
#include "gfx/models/mesh.h"
#include <array>
#include <memory>
@@ -11,12 +12,13 @@ class Texture;
class ObjParser;
class Location;
-class RailVehicleClass {
+class RailVehicleClass : public Asset {
public:
explicit RailVehicleClass(const std::string & name);
+ RailVehicleClass();
void render(const SceneShader &, const Location &, const std::array<Location, 2> &) const;
- void shadows(const ShadowMapper &, const Location &) const;
+ void shadows(const ShadowMapper &, const Location &, const std::array<Location, 2> &) const;
std::array<Mesh::Ptr, 2> bogies;
Mesh::Ptr bodyMesh;
@@ -25,6 +27,10 @@ public:
float length;
float maxSpeed;
+protected:
+ friend Persistence::SelectionPtrBase<std::shared_ptr<RailVehicleClass>>;
+ bool persist(Persistence::PersistenceStore & store) override;
+
private:
RailVehicleClass(std::unique_ptr<ObjParser> obj, std::shared_ptr<Texture>);
static float bogieOffset(ObjParser & o);