From 918e13b2fcf33a5589eb7fcb89ac3d2917392913 Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 13 Oct 2017 15:03:23 -0700 Subject: [PATCH] fixing the zone entity not rendering when created or when avatar appears in one --- .../src/EntityTreeRenderer.cpp | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 9e700b0efe..85916baf60 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -237,19 +237,7 @@ void EntityTreeRenderer::update(bool simulate) { EntityTreePointer tree = std::static_pointer_cast(_tree); tree->update(simulate); - if (simulate) { - // Handle enter/leave entity logic - checkEnterLeaveEntities(); - - // Even if we're not moving the mouse, if we started clicking on an entity and we have - // not yet released the hold then this is still considered a holdingClickOnEntity event - // and we want to simulate this message here as well as in mouse move - if (_lastPointerEventValid && !_currentClickingOnEntityID.isInvalidID()) { - emit holdingClickOnEntity(_currentClickingOnEntityID, _lastPointerEvent); - _entitiesScriptEngine->callEntityScriptMethod(_currentClickingOnEntityID, "holdingClickOnEntity", _lastPointerEvent); - } - } - + // Update the rendereable entities as needed { PerformanceTimer sceneTimer("scene"); auto scene = _viewState->getMain3DScene(); @@ -269,6 +257,20 @@ void EntityTreeRenderer::update(bool simulate) { } } } + + if (simulate) { + // Handle enter/leave entity logic + checkEnterLeaveEntities(); + + // Even if we're not moving the mouse, if we started clicking on an entity and we have + // not yet released the hold then this is still considered a holdingClickOnEntity event + // and we want to simulate this message here as well as in mouse move + if (_lastPointerEventValid && !_currentClickingOnEntityID.isInvalidID()) { + emit holdingClickOnEntity(_currentClickingOnEntityID, _lastPointerEvent); + _entitiesScriptEngine->callEntityScriptMethod(_currentClickingOnEntityID, "holdingClickOnEntity", _lastPointerEvent); + } + } + } }