diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-04-07 20:48:14 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-04-07 20:48:14 +0100 |
commit | c2aecdc0d6089a3c41b3d15c45cdb49fee6a45cc (patch) | |
tree | 0bc8c296e89e53c6f0d9d9e9010adf2db2dc3100 /game/scenary/illuminator.cpp | |
parent | More uniform/flexible window constructors (diff) | |
download | ilt-c2aecdc0d6089a3c41b3d15c45cdb49fee6a45cc.tar.bz2 ilt-c2aecdc0d6089a3c41b3d15c45cdb49fee6a45cc.tar.xz ilt-c2aecdc0d6089a3c41b3d15c45cdb49fee6a45cc.zip |
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.
Diffstat (limited to 'game/scenary/illuminator.cpp')
-rw-r--r-- | game/scenary/illuminator.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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 <location.h> + +static_assert(std::is_constructible_v<Illuminator>); + +std::any +Illuminator::createAt(const Location & position) const +{ + return std::make_shared<InstanceVertices<LocationVertex>::InstanceProxy>( + instances.acquire(position.getRotationTransform(), position.pos)); +} bool Illuminator::SpotLight::persist(Persistence::PersistenceStore & store) |