History

able to reference entity ids as textures

HifiExperiments committed 5 years ago

Commit 828e6531 parent 9a247179 files · +81 −11Browse files

Showing the changes to interface/src/Application.cpp (1 of 9 files). Show all

Unified · Split

interface/src/Application.cpp+13−0
@@ -2155,6 +2155,19 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 2154 unmodified lines
21552155 return QSizeF(0.0f, 0.0f);
21562156 });
21572157
2158+ Texture::setUnboundTextureForUUIDOperator([this](const QUuid& entityID) -> gpu::TexturePointer {
2159+ if (_aboutToQuit) {
2160+ return nullptr;
2161+ }
2162+
2163+ auto renderable = getEntities()->renderableForEntityId(entityID);
2164+ if (renderable) {
2165+ return renderable->getTexture();
2166+ }
2167+
2168+ return nullptr;
2169+ });
2170+
21582171 connect(this, &Application::aboutToQuit, [this]() {
21592172 setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
21602173 });