From 8ec84bdde826edecdc5260abf6bde4239f4d892e Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Fri, 11 Dec 2015 17:35:18 -0800 Subject: [PATCH] don't simulate model until it has geometry --- .../src/RenderableModelEntityItem.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index f2826db43f..b5203ea460 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -455,13 +455,6 @@ bool RenderableModelEntityItem::isReadyToComputeShape() { return false; // hmm... } - if (_needsInitialSimulation) { - // the _model's offset will be wrong until _needsInitialSimulation is false - PerformanceTimer perfTimer("_model->simulate"); - _model->simulate(0.0f); - _needsInitialSimulation = false; - } - assert(!_model->getCollisionURL().isEmpty()); if (_model->getURL().isEmpty()) { @@ -475,6 +468,14 @@ bool RenderableModelEntityItem::isReadyToComputeShape() { if ((collisionNetworkGeometry && collisionNetworkGeometry->isLoaded()) && (renderNetworkGeometry && renderNetworkGeometry->isLoaded())) { // we have both URLs AND both geometries AND they are both fully loaded. + + if (_needsInitialSimulation) { + // the _model's offset will be wrong until _needsInitialSimulation is false + PerformanceTimer perfTimer("_model->simulate"); + _model->simulate(0.0f); + _needsInitialSimulation = false; + } + return true; }