From 1c3b48446659703005cc0de28634eae752ee1895 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 15 Jun 2015 12:48:51 -0700 Subject: [PATCH] fix detailed ray picking against models --- libraries/render-utils/src/Model.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 145f352658..71178070c6 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1761,7 +1761,7 @@ void Model::setupBatchTransform(gpu::Batch& batch, RenderArgs* args) { } AABox Model::getPartBounds(int meshIndex, int partIndex) { - if (!_calculatedMeshPartBoxesValid) { + if (!_calculatedMeshPartBoxesValid || !_calculatedMeshBoxesValid) { recalculateMeshBoxes(true); } @@ -1802,7 +1802,7 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran // we always need these properly calculated before we can render, this will likely already have been done // since the engine will call our getPartBounds() before rendering us. - if (!_calculatedMeshPartBoxesValid) { + if (!_calculatedMeshPartBoxesValid || !_calculatedMeshBoxesValid) { recalculateMeshBoxes(true); } auto textureCache = DependencyManager::get();