From 328a485ad100843c85457a0886d56b91d97a7b68 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Mon, 25 Jun 2018 10:38:53 -0700 Subject: [PATCH] Prevent ray-picks against ModelEntity bounding boxes when loading has not yet completed. --- .../entities-renderer/src/RenderableModelEntityItem.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index a7126b847e..d8ac3dc63e 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -279,18 +279,16 @@ EntityItemProperties RenderableModelEntityItem::getProperties(EntityPropertyFlag } bool RenderableModelEntityItem::supportsDetailedRayIntersection() const { - return isModelLoaded(); + return true; } bool RenderableModelEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, OctreeElementPointer& element, float& distance, BoxFace& face, glm::vec3& surfaceNormal, QVariantMap& extraInfo, bool precisionPicking) const { auto model = getModel(); - if (!model) { - return true; + if (!model || !isModelLoaded()) { + return false; } - // qCDebug(entitiesrenderer) << "RenderableModelEntityItem::findDetailedRayIntersection() precisionPicking:" - // << precisionPicking; return model->findRayIntersectionAgainstSubMeshes(origin, direction, distance, face, surfaceNormal, extraInfo, precisionPicking, false);