summaryrefslogtreecommitdiff
path: root/game/scenary/illuminator.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-09 20:17:55 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-09 20:17:55 +0000
commitbb693756b9aace889f806a768b54655023d163ab (patch)
tree47216b8c5bef15acd5a84124a64c9a036498d25f /game/scenary/illuminator.h
parentInteger support in persistence (diff)
downloadilt-bb693756b9aace889f806a768b54655023d163ab.tar.bz2
ilt-bb693756b9aace889f806a768b54655023d163ab.tar.xz
ilt-bb693756b9aace889f806a768b54655023d163ab.zip
Add the Illuminator (type) and Light (instance) classes
Diffstat (limited to 'game/scenary/illuminator.h')
-rw-r--r--game/scenary/illuminator.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/game/scenary/illuminator.h b/game/scenary/illuminator.h
new file mode 100644
index 0000000..db9acfb
--- /dev/null
+++ b/game/scenary/illuminator.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include "assetFactory/asset.h"
+#include "gfx/gl/instanceVertices.h"
+#include "gfx/renderable.h"
+
+class SceneShader;
+class Location;
+class Texture;
+
+class Illuminator : public Asset, public Renderable, public StdTypeDefs<Illuminator> {
+ Mesh::Ptr bodyMesh;
+ std::shared_ptr<Texture> texture;
+ glVertexArray instanceVAO;
+
+public:
+ using LocationVertex = std::pair<glm::mat4, GlobalPosition3D>;
+ mutable InstanceVertices<LocationVertex> instances;
+ void render(const SceneShader &) const override;
+ void lights(const SceneShader &) const override;
+
+protected:
+ friend Persistence::SelectionPtrBase<std::shared_ptr<Illuminator>>;
+ bool persist(Persistence::PersistenceStore & store) override;
+ void postLoad() override;
+};