From c2aecdc0d6089a3c41b3d15c45cdb49fee6a45cc Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 7 Apr 2025 20:48:14 +0100 Subject: Add Asset interface to create an arbitrarily placed instance InstanceProxy is returned out via a std::any containing a std::shared_ptr because any can only contain copyable things. --- game/scenary/illuminator.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'game/scenary/illuminator.cpp') diff --git a/game/scenary/illuminator.cpp b/game/scenary/illuminator.cpp index f1a02b2..d8e4c4e 100644 --- a/game/scenary/illuminator.cpp +++ b/game/scenary/illuminator.cpp @@ -2,6 +2,16 @@ #include "gfx/gl/sceneShader.h" #include "gfx/gl/vertexArrayObject.h" #include "gfx/models/texture.h" // IWYU pragma: keep +#include + +static_assert(std::is_constructible_v); + +std::any +Illuminator::createAt(const Location & position) const +{ + return std::make_shared::InstanceProxy>( + instances.acquire(position.getRotationTransform(), position.pos)); +} bool Illuminator::SpotLight::persist(Persistence::PersistenceStore & store) -- cgit v1.2.3