diff options
Diffstat (limited to 'game/scenary/illuminator.h')
-rw-r--r-- | game/scenary/illuminator.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/game/scenary/illuminator.h b/game/scenary/illuminator.h index db9acfb..99b87eb 100644 --- a/game/scenary/illuminator.h +++ b/game/scenary/illuminator.h @@ -11,11 +11,27 @@ class Texture; class Illuminator : public Asset, public Renderable, public StdTypeDefs<Illuminator> { Mesh::Ptr bodyMesh; std::shared_ptr<Texture> texture; - glVertexArray instanceVAO; + glVertexArray instanceVAO, instancesSpotLightVAO; + +public: + struct SpotLightVertex { + RelativePosition3D position; + Direction3D direction; + RGB colour; + RelativeDistance kq; + Angle arc; + }; + + struct SpotLight : Persistence::Persistable, SpotLightVertex, StdTypeDefs<SpotLight> { + private: + friend Persistence::SelectionPtrBase<std::shared_ptr<SpotLight>>; + bool persist(Persistence::PersistenceStore & store) override; + }; public: using LocationVertex = std::pair<glm::mat4, GlobalPosition3D>; mutable InstanceVertices<LocationVertex> instances; + mutable InstanceVertices<SpotLightVertex> instancesSpotLight; void render(const SceneShader &) const override; void lights(const SceneShader &) const override; @@ -23,4 +39,7 @@ protected: friend Persistence::SelectionPtrBase<std::shared_ptr<Illuminator>>; bool persist(Persistence::PersistenceStore & store) override; void postLoad() override; + + std::vector<SpotLight::Ptr> spotLight; + std::vector<InstanceVertices<SpotLightVertex>::InstanceProxy> spotLightInstances; }; |