#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 { Mesh::Ptr bodyMesh; std::shared_ptr texture; glVertexArray instanceVAO, instancesSpotLightVAO; public: struct SpotLightVertex { RelativePosition3D position; Direction3D direction; RGB colour; RelativeDistance kq; Angle arc; }; struct SpotLight : Persistence::Persistable, SpotLightVertex, StdTypeDefs { private: friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; }; public: using LocationVertex = std::pair; mutable InstanceVertices instances; mutable InstanceVertices instancesSpotLight; void render(const SceneShader &) const override; void lights(const SceneShader &) const override; protected: friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; void postLoad() override; std::vector spotLight; std::vector::InstanceProxy> spotLightInstances; };